|
| 1 | +# Copyright 2019 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# NOTE: This file is auto generated by the elixir code generator program. |
| 16 | +# Do not edit this file manually. |
| 17 | + |
| 18 | +defmodule GoogleApi.BeyondCorp.V1.Api.V do |
| 19 | + @moduledoc """ |
| 20 | + API calls for all endpoints tagged `V`. |
| 21 | + """ |
| 22 | + |
| 23 | + alias GoogleApi.BeyondCorp.V1.Connection |
| 24 | + alias GoogleApi.Gax.{Request, Response} |
| 25 | + |
| 26 | + @library_version Mix.Project.config() |> Keyword.get(:version, "") |
| 27 | + |
| 28 | + @doc """ |
| 29 | + Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. |
| 30 | +
|
| 31 | + ## Parameters |
| 32 | +
|
| 33 | + * `connection` (*type:* `GoogleApi.BeyondCorp.V1.Connection.t`) - Connection to server |
| 34 | + * `resource` (*type:* `String.t`) - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. |
| 35 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 36 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 37 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 38 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 39 | + * `:callback` (*type:* `String.t`) - JSONP |
| 40 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 41 | + * `: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. |
| 42 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 43 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 44 | + * `: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. |
| 45 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 46 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 47 | + * `:body` (*type:* `GoogleApi.BeyondCorp.V1.Model.GoogleIamV1SetIamPolicyRequest.t`) - |
| 48 | + * `opts` (*type:* `keyword()`) - Call options |
| 49 | +
|
| 50 | + ## Returns |
| 51 | +
|
| 52 | + * `{:ok, %GoogleApi.BeyondCorp.V1.Model.GoogleIamV1Policy{}}` on success |
| 53 | + * `{:error, info}` on failure |
| 54 | + """ |
| 55 | + @spec beyondcorp_v_projects_locations_security_gateways_set_iam_policy( |
| 56 | + Tesla.Env.client(), |
| 57 | + String.t(), |
| 58 | + keyword(), |
| 59 | + keyword() |
| 60 | + ) :: |
| 61 | + {:ok, GoogleApi.BeyondCorp.V1.Model.GoogleIamV1Policy.t()} |
| 62 | + | {:ok, Tesla.Env.t()} |
| 63 | + | {:ok, list()} |
| 64 | + | {:error, any()} |
| 65 | + def beyondcorp_v_projects_locations_security_gateways_set_iam_policy( |
| 66 | + connection, |
| 67 | + resource, |
| 68 | + optional_params \\ [], |
| 69 | + opts \\ [] |
| 70 | + ) do |
| 71 | + optional_params_config = %{ |
| 72 | + :"$.xgafv" => :query, |
| 73 | + :access_token => :query, |
| 74 | + :alt => :query, |
| 75 | + :callback => :query, |
| 76 | + :fields => :query, |
| 77 | + :key => :query, |
| 78 | + :oauth_token => :query, |
| 79 | + :prettyPrint => :query, |
| 80 | + :quotaUser => :query, |
| 81 | + :uploadType => :query, |
| 82 | + :upload_protocol => :query, |
| 83 | + :body => :body |
| 84 | + } |
| 85 | + |
| 86 | + request = |
| 87 | + Request.new() |
| 88 | + |> Request.method(:post) |
| 89 | + |> Request.url("/v/{+resource}:setIamPolicy", %{ |
| 90 | + "resource" => URI.encode(resource, &URI.char_unreserved?/1) |
| 91 | + }) |
| 92 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 93 | + |> Request.library_version(@library_version) |
| 94 | + |
| 95 | + connection |
| 96 | + |> Connection.execute(request) |
| 97 | + |> Response.decode(opts ++ [struct: %GoogleApi.BeyondCorp.V1.Model.GoogleIamV1Policy{}]) |
| 98 | + end |
| 99 | +end |
0 commit comments