Skip to content

Commit

Permalink
feat: Automated regeneration of AccessContextManager client (#10879)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 01:31:24 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent dd9cfd3 commit 1f2f061
Show file tree
Hide file tree
Showing 28 changed files with 933 additions and 27 deletions.
2 changes: 1 addition & 1 deletion clients/access_context_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Access Context Manager API client library.

An API for setting attribute based access control to requests to GCP services.
An API for setting attribute based access control to requests to Google Cloud services. *Warning:* Do not mix *v1alpha* and *v1* API usage in the same access policy. The v1alpha API supports new Access Context Manager features, which may have different attributes or behaviors that are not supported by v1. The practice of mixed API usage within a policy may result in the inability to update that policy, including any access levels or service perimeters belonging to it. It is not recommended to use both v1 and v1alpha for modifying policies with critical service perimeters. Modifications using v1alpha should be limited to policies with non-production/non-critical service perimeters.

## Installation

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ defmodule GoogleApi.AccessContextManager.V1.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 @@ -335,7 +335,7 @@ defmodule GoogleApi.AccessContextManager.V1.Api.Organizations do
* `: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").
* `:updateMask` (*type:* `String.t`) - Required. Only the fields specified in this mask are updated. Because name and group_key cannot be changed, update_mask is required and must always be: update_mask { paths: "access_levels" }
* `:updateMask` (*type:* `String.t`) - Required. Only the fields specified in this mask are updated. Because name and group_key cannot be changed, update_mask is required and may only contain the following fields: `access_levels`, `dry_run_access_levels`. update_mask { paths: "access_levels" }
* `:body` (*type:* `GoogleApi.AccessContextManager.V1.Model.GcpUserAccessBinding.t`) -
* `opts` (*type:* `keyword()`) - Call options
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# 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.AccessContextManager.V1.Api.Services do
@moduledoc """
API calls for all endpoints tagged `Services`.
"""

alias GoogleApi.AccessContextManager.V1.Connection
alias GoogleApi.Gax.{Request, Response}

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

@doc """
Returns a VPC-SC supported service based on the service name.
## Parameters
* `connection` (*type:* `GoogleApi.AccessContextManager.V1.Connection.t`) - Connection to server
* `name` (*type:* `String.t`) - The name of the service to get information about. The names must be in the same format as used in defining a service perimeter, for example, `storage.googleapis.com`.
* `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.AccessContextManager.V1.Model.SupportedService{}}` on success
* `{:error, info}` on failure
"""
@spec accesscontextmanager_services_get(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.AccessContextManager.V1.Model.SupportedService.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def accesscontextmanager_services_get(connection, name, 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("/v1/services/{name}", %{
"name" => URI.encode(name, &(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.AccessContextManager.V1.Model.SupportedService{}]
)
end

@doc """
Lists all VPC-SC supported services.
## Parameters
* `connection` (*type:* `GoogleApi.AccessContextManager.V1.Connection.t`) - Connection to server
* `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()`) - This flag specifies the maximum number of services to return per page. Default is 100.
* `:pageToken` (*type:* `String.t`) - Token to start on a later page. Default is the first page.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.AccessContextManager.V1.Model.ListSupportedServicesResponse{}}` on success
* `{:error, info}` on failure
"""
@spec accesscontextmanager_services_list(Tesla.Env.client(), keyword(), keyword()) ::
{:ok, GoogleApi.AccessContextManager.V1.Model.ListSupportedServicesResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def accesscontextmanager_services_list(connection, 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("/v1/services", %{})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(
opts ++ [struct: %GoogleApi.AccessContextManager.V1.Model.ListSupportedServicesResponse{}]
)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.AccessContextManager.V1 do
API client metadata for GoogleApi.AccessContextManager.V1.
"""

@discovery_revision "20220826"
@discovery_revision "20240226"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.AccessContextManager.V1.Model.AccessLevel do
* `basic` (*type:* `GoogleApi.AccessContextManager.V1.Model.BasicLevel.t`, *default:* `nil`) - A `BasicLevel` composed of `Conditions`.
* `custom` (*type:* `GoogleApi.AccessContextManager.V1.Model.CustomLevel.t`, *default:* `nil`) - A `CustomLevel` written in the Common Expression Language.
* `description` (*type:* `String.t`, *default:* `nil`) - Description of the `AccessLevel` and its use. Does not affect behavior.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. Resource name for the Access Level. The `short_name` component must begin with a letter and only include alphanumeric and '_'. Format: `accessPolicies/{access_policy}/accessLevels/{access_level}`. The maximum length of the `access_level` component is 50 characters.
* `name` (*type:* `String.t`, *default:* `nil`) - Resource name for the `AccessLevel`. Format: `accessPolicies/{access_policy}/accessLevels/{access_level}`. The `access_level` component must begin with a letter, followed by alphanumeric characters or `_`. Its maximum length is 50 characters. After you create an `AccessLevel`, you cannot change its `name`.
* `title` (*type:* `String.t`, *default:* `nil`) - Human readable title. Must be unique within the Policy.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule GoogleApi.AccessContextManager.V1.Model.AccessPolicy do
* `etag` (*type:* `String.t`, *default:* `nil`) - Output only. An opaque identifier for the current version of the `AccessPolicy`. This will always be a strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.
* `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the `AccessPolicy`. Format: `accessPolicies/{access_policy}`
* `parent` (*type:* `String.t`, *default:* `nil`) - Required. The parent of this `AccessPolicy` in the Cloud Resource Hierarchy. Currently immutable once created. Format: `organizations/{organization_id}`
* `scopes` (*type:* `list(String.t)`, *default:* `nil`) - The scopes of a policy define which resources an ACM policy can restrict, and where ACM resources can be referenced. For example, a policy with scopes=["folders/123"] has the following behavior: - vpcsc perimeters can only restrict projects within folders/123 - access levels can only be referenced by resources within folders/123. If empty, there are no limitations on which resources can be restricted by an ACM policy, and there are no limitations on where ACM resources can be referenced. Only one policy can include a given scope (attempting to create a second policy which includes "folders/123" will result in an error). Currently, scopes cannot be modified after a policy is created. Currently, policies can only have a single scope. Format: list of `folders/{folder_number}` or `projects/{project_number}`
* `scopes` (*type:* `list(String.t)`, *default:* `nil`) - The scopes of the AccessPolicy. Scopes define which resources a policy can restrict and where its resources can be referenced. For example, policy A with `scopes=["folders/123"]` has the following behavior: - ServicePerimeter can only restrict projects within `folders/123`. - ServicePerimeter within policy A can only reference access levels defined within policy A. - Only one policy can include a given scope; thus, attempting to create a second policy which includes `folders/123` will result in an error. If no scopes are provided, then any resource within the organization can be restricted. Scopes cannot be modified after a policy is created. Policies can only have a single scope. Format: list of `folders/{folder_number}` or `projects/{project_number}`
* `title` (*type:* `String.t`, *default:* `nil`) - Required. Human readable title. Does not affect behavior.
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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.AccessContextManager.V1.Model.AuthorizedOrgsDesc do
@moduledoc """
`AuthorizedOrgsDesc` contains data for an organization's authorization policy.
## Attributes
* `assetType` (*type:* `String.t`, *default:* `nil`) - The asset type of this authorized orgs desc. Valid values are `ASSET_TYPE_DEVICE`, and `ASSET_TYPE_CREDENTIAL_STRENGTH`.
* `authorizationDirection` (*type:* `String.t`, *default:* `nil`) - The direction of the authorization relationship between this organization and the organizations listed in the `orgs` field. The valid values for this field include the following: `AUTHORIZATION_DIRECTION_FROM`: Allows this organization to evaluate traffic in the organizations listed in the `orgs` field. `AUTHORIZATION_DIRECTION_TO`: Allows the organizations listed in the `orgs` field to evaluate the traffic in this organization. For the authorization relationship to take effect, all of the organizations must authorize and specify the appropriate relationship direction. For example, if organization A authorized organization B and C to evaluate its traffic, by specifying `AUTHORIZATION_DIRECTION_TO` as the authorization direction, organizations B and C must specify `AUTHORIZATION_DIRECTION_FROM` as the authorization direction in their `AuthorizedOrgsDesc` resource.
* `authorizationType` (*type:* `String.t`, *default:* `nil`) - A granular control type for authorization levels. Valid value is `AUTHORIZATION_TYPE_TRUST`.
* `name` (*type:* `String.t`, *default:* `nil`) - Resource name for the `AuthorizedOrgsDesc`. Format: `accessPolicies/{access_policy}/authorizedOrgsDescs/{authorized_orgs_desc}`. The `authorized_orgs_desc` component must begin with a letter, followed by alphanumeric characters or `_`. After you create an `AuthorizedOrgsDesc`, you cannot change its `name`.
* `orgs` (*type:* `list(String.t)`, *default:* `nil`) - The list of organization ids in this AuthorizedOrgsDesc. Format: `organizations/` Example: `organizations/123456`
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:assetType => String.t() | nil,
:authorizationDirection => String.t() | nil,
:authorizationType => String.t() | nil,
:name => String.t() | nil,
:orgs => list(String.t()) | nil
}

field(:assetType)
field(:authorizationDirection)
field(:authorizationType)
field(:name)
field(:orgs, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AccessContextManager.V1.Model.AuthorizedOrgsDesc do
def decode(value, options) do
GoogleApi.AccessContextManager.V1.Model.AuthorizedOrgsDesc.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.AccessContextManager.V1.Model.AuthorizedOrgsDesc do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Loading

0 comments on commit 1f2f061

Please sign in to comment.