From 4e7a5f300e79b0c6010773c6f85a2c16bb46c240 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:30:23 -0700 Subject: [PATCH] feat: Automated regeneration of CloudProfiler client (#10918) Auto-created at 2024-03-12 02:28:12 +0000 using the toys pull request generator. --- clients/cloud_profiler/README.md | 4 +- .../cloud_profiler/v2/api/projects.ex | 70 ++++++++++++++++++- .../google_api/cloud_profiler/v2/metadata.ex | 2 +- .../v2/model/create_profile_request.ex | 4 +- .../v2/model/list_profiles_response.ex | 52 ++++++++++++++ .../cloud_profiler/v2/model/profile.ex | 5 +- clients/cloud_profiler/mix.exs | 4 +- 7 files changed, 130 insertions(+), 11 deletions(-) create mode 100644 clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/list_profiles_response.ex diff --git a/clients/cloud_profiler/README.md b/clients/cloud_profiler/README.md index ce105c6cc1..d942f872b6 100644 --- a/clients/cloud_profiler/README.md +++ b/clients/cloud_profiler/README.md @@ -1,6 +1,6 @@ # GoogleApi.CloudProfiler -Stackdriver Profiler API client library. +Cloud Profiler API client library. Manages continuous profiling information. @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding ```elixir def deps do - [{:google_api_cloud_profiler, "~> 0.6"}] + [{:google_api_cloud_profiler, "~> 0.7"}] end ``` diff --git a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/api/projects.ex b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/api/projects.ex index 31e84b8ddd..61ecd5ffd9 100644 --- a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/api/projects.ex +++ b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/api/projects.ex @@ -26,7 +26,7 @@ defmodule GoogleApi.CloudProfiler.V2.Api.Projects do @library_version Mix.Project.config() |> Keyword.get(:version, "") @doc """ - CreateProfile creates a new profile resource in the online mode. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin". + CreateProfile creates a new profile resource in the online mode. _Direct use of this API is discouraged, please use a [supported profiler agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) instead for profile collection._ The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin". ## Parameters @@ -98,7 +98,7 @@ defmodule GoogleApi.CloudProfiler.V2.Api.Projects do end @doc """ - CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it. + CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it. _Direct use of this API is discouraged, please use a [supported profiler agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) instead for profile collection._ ## Parameters @@ -170,7 +170,71 @@ defmodule GoogleApi.CloudProfiler.V2.Api.Projects do end @doc """ - UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation. + Lists profiles which have been collected so far and for which the caller has permission to view. + + ## Parameters + + * `connection` (*type:* `GoogleApi.CloudProfiler.V2.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. The parent, which owns this collection of profiles. Format: projects/{user_project_id} + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:pageSize` (*type:* `integer()`) - The maximum number of items to return. Default page_size is 1000. Max limit is 1000. + * `:pageToken` (*type:* `String.t`) - The token to continue pagination and get profiles from a particular page. When paginating, all other parameters provided to `ListProfiles` must match the call that provided the page token. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.CloudProfiler.V2.Model.ListProfilesResponse{}}` on success + * `{:error, info}` on failure + """ + @spec cloudprofiler_projects_profiles_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.CloudProfiler.V2.Model.ListProfilesResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def cloudprofiler_projects_profiles_list(connection, parent, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v2/{+parent}/profiles", %{ + "parent" => URI.encode(parent, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.CloudProfiler.V2.Model.ListProfilesResponse{}]) + end + + @doc """ + UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation. _Direct use of this API is discouraged, please use a [supported profiler agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent) instead for profile collection._ ## Parameters diff --git a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/metadata.ex b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/metadata.ex index a8393bfe23..9ab96d2141 100644 --- a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/metadata.ex +++ b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/metadata.ex @@ -20,7 +20,7 @@ defmodule GoogleApi.CloudProfiler.V2 do API client metadata for GoogleApi.CloudProfiler.V2. """ - @discovery_revision "20220627" + @discovery_revision "20240305" def discovery_revision(), do: @discovery_revision end diff --git a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/create_profile_request.ex b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/create_profile_request.ex index fa3b871eab..a039dbcb79 100644 --- a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/create_profile_request.ex +++ b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/create_profile_request.ex @@ -21,8 +21,8 @@ defmodule GoogleApi.CloudProfiler.V2.Model.CreateProfileRequest do ## Attributes - * `deployment` (*type:* `GoogleApi.CloudProfiler.V2.Model.Deployment.t`, *default:* `nil`) - Required. Deployment details. - * `profileType` (*type:* `list(String.t)`, *default:* `nil`) - Required. One or more profile types that the agent is capable of providing. + * `deployment` (*type:* `GoogleApi.CloudProfiler.V2.Model.Deployment.t`, *default:* `nil`) - Deployment details. + * `profileType` (*type:* `list(String.t)`, *default:* `nil`) - One or more profile types that the agent is capable of providing. """ use GoogleApi.Gax.ModelBase diff --git a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/list_profiles_response.ex b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/list_profiles_response.ex new file mode 100644 index 0000000000..2b761f6d63 --- /dev/null +++ b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/list_profiles_response.ex @@ -0,0 +1,52 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.CloudProfiler.V2.Model.ListProfilesResponse do + @moduledoc """ + ListProfileResponse contains the list of collected profiles for deployments in projects which the user has permissions to view. + + ## Attributes + + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - Token to receive the next page of results. This field maybe empty if there are no more profiles to fetch. + * `profiles` (*type:* `list(GoogleApi.CloudProfiler.V2.Model.Profile.t)`, *default:* `nil`) - List of profiles fetched. + * `skippedProfiles` (*type:* `integer()`, *default:* `nil`) - Number of profiles that were skipped in the current page since they were not able to be fetched successfully. This should typically be zero. A non-zero value may indicate a transient failure, in which case if the number is too high for your use case, the call may be retried. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :nextPageToken => String.t() | nil, + :profiles => list(GoogleApi.CloudProfiler.V2.Model.Profile.t()) | nil, + :skippedProfiles => integer() | nil + } + + field(:nextPageToken) + field(:profiles, as: GoogleApi.CloudProfiler.V2.Model.Profile, type: :list) + field(:skippedProfiles) +end + +defimpl Poison.Decoder, for: GoogleApi.CloudProfiler.V2.Model.ListProfilesResponse do + def decode(value, options) do + GoogleApi.CloudProfiler.V2.Model.ListProfilesResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.CloudProfiler.V2.Model.ListProfilesResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/profile.ex b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/profile.ex index 9d2db4c611..64b5742eec 100644 --- a/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/profile.ex +++ b/clients/cloud_profiler/lib/google_api/cloud_profiler/v2/model/profile.ex @@ -27,6 +27,7 @@ defmodule GoogleApi.CloudProfiler.V2.Model.Profile do * `name` (*type:* `String.t`, *default:* `nil`) - Output only. Opaque, server-assigned, unique ID for this profile. * `profileBytes` (*type:* `String.t`, *default:* `nil`) - Input only. Profile bytes, as a gzip compressed serialized proto, the format is https://github.com/google/pprof/blob/master/proto/profile.proto. * `profileType` (*type:* `String.t`, *default:* `nil`) - Type of profile. For offline mode, this must be specified when creating the profile. For online mode it is assigned and returned by the server. + * `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Start time for the profile. This output is only present in response from the ListProfiles method. """ use GoogleApi.Gax.ModelBase @@ -37,7 +38,8 @@ defmodule GoogleApi.CloudProfiler.V2.Model.Profile do :labels => map() | nil, :name => String.t() | nil, :profileBytes => String.t() | nil, - :profileType => String.t() | nil + :profileType => String.t() | nil, + :startTime => DateTime.t() | nil } field(:deployment, as: GoogleApi.CloudProfiler.V2.Model.Deployment) @@ -46,6 +48,7 @@ defmodule GoogleApi.CloudProfiler.V2.Model.Profile do field(:name) field(:profileBytes) field(:profileType) + field(:startTime, as: DateTime) end defimpl Poison.Decoder, for: GoogleApi.CloudProfiler.V2.Model.Profile do diff --git a/clients/cloud_profiler/mix.exs b/clients/cloud_profiler/mix.exs index d7805cd174..45f01956fc 100644 --- a/clients/cloud_profiler/mix.exs +++ b/clients/cloud_profiler/mix.exs @@ -18,7 +18,7 @@ defmodule GoogleApi.CloudProfiler.Mixfile do use Mix.Project - @version "0.6.3" + @version "0.7.0" def project() do [ @@ -48,7 +48,7 @@ defmodule GoogleApi.CloudProfiler.Mixfile do defp description() do """ - Stackdriver Profiler API client library. Manages continuous profiling information. + Cloud Profiler API client library. Manages continuous profiling information. """ end