Skip to content

Commit

Permalink
feat: Automated regeneration of CloudProfiler client (#10918)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 02:28:12 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent d7f7151 commit 4e7a5f3
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 11 deletions.
4 changes: 2 additions & 2 deletions clients/cloud_profiler/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GoogleApi.CloudProfiler

Stackdriver Profiler API client library.
Cloud Profiler API client library.

Manages continuous profiling information.

Expand All @@ -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
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions clients/cloud_profiler/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defmodule GoogleApi.CloudProfiler.Mixfile do
use Mix.Project

@version "0.6.3"
@version "0.7.0"

def project() do
[
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4e7a5f3

Please sign in to comment.