Skip to content

Commit

Permalink
feat: Automated regeneration of BigtableAdmin client (#10889)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 01:33:24 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent d401f70 commit 224d3d3
Show file tree
Hide file tree
Showing 19 changed files with 185 additions and 228 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,136 +25,6 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Operations do

@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
## Parameters
* `connection` (*type:* `GoogleApi.BigtableAdmin.V2.Connection.t`) - Connection to server
* `operations_id` (*type:* `String.t`) - Part of `name`. The name of the operation resource to be cancelled.
* `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").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.BigtableAdmin.V2.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec bigtableadmin_operations_cancel(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.BigtableAdmin.V2.Model.Empty.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def bigtableadmin_operations_cancel(
connection,
operations_id,
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
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v2/operations/{operationsId}:cancel", %{
"operationsId" => URI.encode(operations_id, &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.BigtableAdmin.V2.Model.Empty{}])
end

@doc """
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
## Parameters
* `connection` (*type:* `GoogleApi.BigtableAdmin.V2.Connection.t`) - Connection to server
* `operations_id` (*type:* `String.t`) - Part of `name`. The name of the operation resource to be deleted.
* `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").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.BigtableAdmin.V2.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec bigtableadmin_operations_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.BigtableAdmin.V2.Model.Empty.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def bigtableadmin_operations_delete(
connection,
operations_id,
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
}

request =
Request.new()
|> Request.method(:delete)
|> Request.url("/v2/operations/{operationsId}", %{
"operationsId" => URI.encode(operations_id, &(URI.char_unreserved?(&1) || &1 == ?/))
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.BigtableAdmin.V2.Model.Empty{}])
end

@doc """
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
Expand Down Expand Up @@ -216,7 +86,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Operations do
end

@doc """
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
## Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
end

@doc """
Gets the access control policy for a Table resource. Returns an empty policy if the resource exists but does not have a policy set.
Gets the access control policy for a Table or Backup resource. Returns an empty policy if the resource exists but does not have a policy set.
## Parameters
Expand Down Expand Up @@ -2190,7 +2190,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
end

@doc """
Sets the access control policy on a Table resource. Replaces any existing policy.
Sets the access control policy on a Table or Backup resource. Replaces any existing policy.
## Parameters
Expand Down Expand Up @@ -2277,7 +2277,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
end

@doc """
Returns permissions that the caller has on the specified table resource.
Returns permissions that the caller has on the specified Table or Backup resource.
## Parameters
Expand Down Expand Up @@ -2696,7 +2696,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
end

@doc """
Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix.
Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix. Note that row key prefixes used here are treated as service data. For more information about how service data is handled, see the [Google Cloud Privacy Notice](https://cloud.google.com/terms/cloud-privacy-notice).
## Parameters
Expand Down Expand Up @@ -2944,7 +2944,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
end

@doc """
Gets the access control policy for a Table resource. Returns an empty policy if the resource exists but does not have a policy set.
Gets the access control policy for a Table or Backup resource. Returns an empty policy if the resource exists but does not have a policy set.
## Parameters
Expand Down Expand Up @@ -3348,7 +3348,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
end

@doc """
Sets the access control policy on a Table resource. Replaces any existing policy.
Sets the access control policy on a Table or Backup resource. Replaces any existing policy.
## Parameters
Expand Down Expand Up @@ -3431,7 +3431,7 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
end

@doc """
Returns permissions that the caller has on the specified table resource.
Returns permissions that the caller has on the specified Table or Backup resource.
## Parameters
Expand Down Expand Up @@ -3598,80 +3598,6 @@ defmodule GoogleApi.BigtableAdmin.V2.Api.Projects do
|> Response.decode(opts ++ [struct: %GoogleApi.BigtableAdmin.V2.Model.Operation{}])
end

@doc """
Gets information about a location.
## Parameters
* `connection` (*type:* `GoogleApi.BigtableAdmin.V2.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Resource name for the location.
* `locations_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`.
* `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").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.BigtableAdmin.V2.Model.Location{}}` on success
* `{:error, info}` on failure
"""
@spec bigtableadmin_projects_locations_get(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.BigtableAdmin.V2.Model.Location.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def bigtableadmin_projects_locations_get(
connection,
projects_id,
locations_id,
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
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v2/projects/{projectsId}/locations/{locationsId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"locationsId" => URI.encode(locations_id, &(URI.char_unreserved?(&1) || &1 == ?/))
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.BigtableAdmin.V2.Model.Location{}])
end

@doc """
Lists information about the supported locations for this service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.BigtableAdmin.V2 do
API client metadata for GoogleApi.BigtableAdmin.V2.
"""

@discovery_revision "20221101"
@discovery_revision "20240225"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ defmodule GoogleApi.BigtableAdmin.V2.Model.AppProfile do
* `etag` (*type:* `String.t`, *default:* `nil`) - Strongly validated etag for optimistic concurrency control. Preserve the value returned from `GetAppProfile` when calling `UpdateAppProfile` to fail the request if there has been a modification in the mean time. The `update_mask` of the request need not include `etag` for this protection to apply. See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more details.
* `multiClusterRoutingUseAny` (*type:* `GoogleApi.BigtableAdmin.V2.Model.MultiClusterRoutingUseAny.t`, *default:* `nil`) - Use a multi-cluster routing policy.
* `name` (*type:* `String.t`, *default:* `nil`) - The unique name of the app profile. Values are of the form `projects/{project}/instances/{instance}/appProfiles/_a-zA-Z0-9*`.
* `priority` (*type:* `String.t`, *default:* `nil`) - This field has been deprecated in favor of `standard_isolation.priority`. If you set this field, `standard_isolation.priority` will be set instead. The priority of requests sent using this app profile.
* `singleClusterRouting` (*type:* `GoogleApi.BigtableAdmin.V2.Model.SingleClusterRouting.t`, *default:* `nil`) - Use a single-cluster routing policy.
* `standardIsolation` (*type:* `GoogleApi.BigtableAdmin.V2.Model.StandardIsolation.t`, *default:* `nil`) - The standard options used for isolating this app profile's traffic from other use cases.
"""

use GoogleApi.Gax.ModelBase
Expand All @@ -36,7 +38,10 @@ defmodule GoogleApi.BigtableAdmin.V2.Model.AppProfile do
:multiClusterRoutingUseAny =>
GoogleApi.BigtableAdmin.V2.Model.MultiClusterRoutingUseAny.t() | nil,
:name => String.t() | nil,
:singleClusterRouting => GoogleApi.BigtableAdmin.V2.Model.SingleClusterRouting.t() | nil
:priority => String.t() | nil,
:singleClusterRouting =>
GoogleApi.BigtableAdmin.V2.Model.SingleClusterRouting.t() | nil,
:standardIsolation => GoogleApi.BigtableAdmin.V2.Model.StandardIsolation.t() | nil
}

field(:description)
Expand All @@ -45,7 +50,9 @@ defmodule GoogleApi.BigtableAdmin.V2.Model.AppProfile do
field(:multiClusterRoutingUseAny, as: GoogleApi.BigtableAdmin.V2.Model.MultiClusterRoutingUseAny)

field(:name)
field(:priority)
field(:singleClusterRouting, as: GoogleApi.BigtableAdmin.V2.Model.SingleClusterRouting)
field(:standardIsolation, as: GoogleApi.BigtableAdmin.V2.Model.StandardIsolation)
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.AppProfile do
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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.BigtableAdmin.V2.Model.AutomatedBackupPolicy do
@moduledoc """
Defines an automated backup policy for a table
## Attributes
* `frequency` (*type:* `String.t`, *default:* `nil`) - Required. How frequently automated backups should occur. The only supported value at this time is 24 hours.
* `retentionPeriod` (*type:* `String.t`, *default:* `nil`) - Required. How long the automated backups should be retained. The only supported value at this time is 3 days.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:frequency => String.t() | nil,
:retentionPeriod => String.t() | nil
}

field(:frequency)
field(:retentionPeriod)
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.AutomatedBackupPolicy do
def decode(value, options) do
GoogleApi.BigtableAdmin.V2.Model.AutomatedBackupPolicy.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.BigtableAdmin.V2.Model.AutomatedBackupPolicy do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit 224d3d3

Please sign in to comment.