Packages
google_api_iam
0.26.2
0.45.0
0.44.4
0.44.3
0.44.2
0.44.1
0.44.0
0.43.0
0.42.0
0.41.0
0.40.0
0.39.0
0.38.0
0.37.3
0.37.2
0.37.1
0.37.0
0.36.1
0.36.0
0.35.0
0.34.0
0.33.3
0.33.2
0.33.1
0.33.0
0.32.0
0.31.0
0.30.0
0.29.2
0.29.1
0.29.0
0.28.2
0.28.1
0.28.0
0.27.0
0.26.4
0.26.3
0.26.2
0.26.1
0.26.0
0.25.0
0.24.0
0.23.0
0.22.0
0.21.0
0.20.0
0.19.0
0.18.0
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.1
0.7.0
0.6.0
0.5.0
0.4.0
0.2.0
0.1.0
0.0.1
Identity and Access Management (IAM) API client library.
Current section
Files
Jump to
Current section
Files
lib/google_api/iam/v1/api/projects.ex
# 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.IAM.V1.Api.Projects do
@moduledoc """
API calls for all endpoints tagged `Projects`.
"""
alias GoogleApi.IAM.V1.Connection
alias GoogleApi.Gax.{Request, Response}
@library_version Mix.Project.config() |> Keyword.get(:version, "")
@doc """
Creates a new custom Role.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `parent`. The `parent` parameter's value depends on the target resource for the
request, namely
[`projects`](/iam/reference/rest/v1/projects.roles) or
[`organizations`](/iam/reference/rest/v1/organizations.roles). Each
resource type's `parent` value format is described below:
* [`projects.roles.create()`](/iam/reference/rest/v1/projects.roles/create):
`projects/{PROJECT_ID}`. This method creates project-level
[custom roles](/iam/docs/understanding-custom-roles).
Example request URL:
`https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles`
* [`organizations.roles.create()`](/iam/reference/rest/v1/organizations.roles/create):
`organizations/{ORGANIZATION_ID}`. This method creates organization-level
[custom roles](/iam/docs/understanding-custom-roles). Example request
URL:
`https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles`
Note: Wildcard (*) values are invalid; you must specify a complete project
ID or organization 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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.CreateRoleRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Role{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_roles_create(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.IAM.V1.Model.Role.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_roles_create(connection, projects_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/roles", %{
"projectsId" => URI.encode(projects_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.IAM.V1.Model.Role{}])
end
@doc """
Deletes a custom Role.
When you delete a custom role, the following changes occur immediately:
* You cannot bind a member to the custom role in an IAM
Policy.
* Existing bindings to the custom role are not changed, but they have no
effect.
* By default, the response from ListRoles does not include the custom
role.
You have 7 days to undelete the custom role. After 7 days, the following
changes occur:
* The custom role is permanently deleted and cannot be recovered.
* If an IAM policy contains a binding to the custom role, the binding is
permanently removed.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The `name` parameter's value depends on the target resource for the
request, namely
[`projects`](/iam/reference/rest/v1/projects.roles) or
[`organizations`](/iam/reference/rest/v1/organizations.roles). Each
resource type's `name` value format is described below:
* [`projects.roles.delete()`](/iam/reference/rest/v1/projects.roles/delete):
`projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method deletes only
[custom roles](/iam/docs/understanding-custom-roles) that have been
created at the project level. Example request URL:
`https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
* [`organizations.roles.delete()`](/iam/reference/rest/v1/organizations.roles/delete):
`organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
deletes only [custom roles](/iam/docs/understanding-custom-roles) that
have been created at the organization level. Example request URL:
`https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
Note: Wildcard (*) values are invalid; you must specify a complete project
ID or organization ID.
* `roles_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").
* `:etag` (*type:* `String.t`) - Used to perform a consistent read-modify-write.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Role{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_roles_delete(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Role.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_roles_delete(
connection,
projects_id,
roles_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,
:etag => :query
}
request =
Request.new()
|> Request.method(:delete)
|> Request.url("/v1/projects/{projectsId}/roles/{rolesId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"rolesId" => URI.encode(roles_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.IAM.V1.Model.Role{}])
end
@doc """
Gets the definition of a Role.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The `name` parameter's value depends on the target resource for the
request, namely
[`roles`](/iam/reference/rest/v1/roles),
[`projects`](/iam/reference/rest/v1/projects.roles), or
[`organizations`](/iam/reference/rest/v1/organizations.roles). Each
resource type's `name` value format is described below:
* [`roles.get()`](/iam/reference/rest/v1/roles/get): `roles/{ROLE_NAME}`.
This method returns results from all
[predefined roles](/iam/docs/understanding-roles#predefined_roles) in
Cloud IAM. Example request URL:
`https://iam.googleapis.com/v1/roles/{ROLE_NAME}`
* [`projects.roles.get()`](/iam/reference/rest/v1/projects.roles/get):
`projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method returns only
[custom roles](/iam/docs/understanding-custom-roles) that have been
created at the project level. Example request URL:
`https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
* [`organizations.roles.get()`](/iam/reference/rest/v1/organizations.roles/get):
`organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
returns only [custom roles](/iam/docs/understanding-custom-roles) that
have been created at the organization level. Example request URL:
`https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
Note: Wildcard (*) values are invalid; you must specify a complete project
ID or organization ID.
* `roles_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.IAM.V1.Model.Role{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_roles_get(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.IAM.V1.Model.Role.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_roles_get(connection, projects_id, roles_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("/v1/projects/{projectsId}/roles/{rolesId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"rolesId" => URI.encode(roles_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.IAM.V1.Model.Role{}])
end
@doc """
Lists every predefined Role that IAM supports, or every custom role
that is defined for an organization or project.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `parent`. The `parent` parameter's value depends on the target resource for the
request, namely
[`roles`](/iam/reference/rest/v1/roles),
[`projects`](/iam/reference/rest/v1/projects.roles), or
[`organizations`](/iam/reference/rest/v1/organizations.roles). Each
resource type's `parent` value format is described below:
* [`roles.list()`](/iam/reference/rest/v1/roles/list): An empty string.
This method doesn't require a resource; it simply returns all
[predefined roles](/iam/docs/understanding-roles#predefined_roles) in
Cloud IAM. Example request URL:
`https://iam.googleapis.com/v1/roles`
* [`projects.roles.list()`](/iam/reference/rest/v1/projects.roles/list):
`projects/{PROJECT_ID}`. This method lists all project-level
[custom roles](/iam/docs/understanding-custom-roles).
Example request URL:
`https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles`
* [`organizations.roles.list()`](/iam/reference/rest/v1/organizations.roles/list):
`organizations/{ORGANIZATION_ID}`. This method lists all
organization-level [custom roles](/iam/docs/understanding-custom-roles).
Example request URL:
`https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles`
Note: Wildcard (*) values are invalid; you must specify a complete project
ID or organization 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()`) - Optional limit on the number of roles to include in the response.
* `:pageToken` (*type:* `String.t`) - Optional pagination token returned in an earlier ListRolesResponse.
* `:showDeleted` (*type:* `boolean()`) - Include Roles that have been deleted.
* `:view` (*type:* `String.t`) - Optional view for the returned Role objects. When `FULL` is specified,
the `includedPermissions` field is returned, which includes a list of all
permissions in the role. The default value is `BASIC`, which does not
return the `includedPermissions` field.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ListRolesResponse{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_roles_list(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.IAM.V1.Model.ListRolesResponse.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_roles_list(connection, projects_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,
:pageSize => :query,
:pageToken => :query,
:showDeleted => :query,
:view => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/projects/{projectsId}/roles", %{
"projectsId" => URI.encode(projects_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.IAM.V1.Model.ListRolesResponse{}])
end
@doc """
Updates the definition of a custom Role.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The `name` parameter's value depends on the target resource for the
request, namely
[`projects`](/iam/reference/rest/v1/projects.roles) or
[`organizations`](/iam/reference/rest/v1/organizations.roles). Each
resource type's `name` value format is described below:
* [`projects.roles.patch()`](/iam/reference/rest/v1/projects.roles/patch):
`projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method updates only
[custom roles](/iam/docs/understanding-custom-roles) that have been
created at the project level. Example request URL:
`https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
* [`organizations.roles.patch()`](/iam/reference/rest/v1/organizations.roles/patch):
`organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
updates only [custom roles](/iam/docs/understanding-custom-roles) that
have been created at the organization level. Example request URL:
`https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
Note: Wildcard (*) values are invalid; you must specify a complete project
ID or organization ID.
* `roles_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").
* `:updateMask` (*type:* `String.t`) - A mask describing which fields in the Role have changed.
* `:body` (*type:* `GoogleApi.IAM.V1.Model.Role.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Role{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_roles_patch(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.IAM.V1.Model.Role.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_roles_patch(
connection,
projects_id,
roles_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,
:updateMask => :query,
:body => :body
}
request =
Request.new()
|> Request.method(:patch)
|> Request.url("/v1/projects/{projectsId}/roles/{rolesId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"rolesId" => URI.encode(roles_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.IAM.V1.Model.Role{}])
end
@doc """
Undeletes a custom Role.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The `name` parameter's value depends on the target resource for the
request, namely
[`projects`](/iam/reference/rest/v1/projects.roles) or
[`organizations`](/iam/reference/rest/v1/organizations.roles). Each
resource type's `name` value format is described below:
* [`projects.roles.undelete()`](/iam/reference/rest/v1/projects.roles/undelete):
`projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method undeletes
only [custom roles](/iam/docs/understanding-custom-roles) that have been
created at the project level. Example request URL:
`https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
* [`organizations.roles.undelete()`](/iam/reference/rest/v1/organizations.roles/undelete):
`organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
undeletes only [custom roles](/iam/docs/understanding-custom-roles) that
have been created at the organization level. Example request URL:
`https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
Note: Wildcard (*) values are invalid; you must specify a complete project
ID or organization ID.
* `roles_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.UndeleteRoleRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Role{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_roles_undelete(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Role.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_roles_undelete(
connection,
projects_id,
roles_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/roles/{rolesId}:undelete", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"rolesId" => URI.encode(roles_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.IAM.V1.Model.Role{}])
end
@doc """
Creates a ServiceAccount.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the project associated with the service
accounts, such as `projects/my-project-123`.
* `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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.CreateServiceAccountRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ServiceAccount{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_create(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.IAM.V1.Model.ServiceAccount.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_create(
connection,
projects_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts", %{
"projectsId" => URI.encode(projects_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.IAM.V1.Model.ServiceAccount{}])
end
@doc """
Deletes a ServiceAccount.
**Warning:** After you delete a service account, you might not be able to
undelete it. If you know that you need to re-enable the service account in
the future, use DisableServiceAccount instead.
If you delete a service account, IAM permanently removes the service
account 30 days later. Google Cloud cannot recover the service account
after it is permanently removed, even if you file a support request.
To help avoid unplanned outages, we recommend that you disable the service
account before you delete it. Use DisableServiceAccount to disable the
service account, then wait at least 24 hours and watch for unintended
consequences. If there are no unintended consequences, you can delete the
service account.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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.IAM.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_delete(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_service_accounts_delete(
connection,
projects_id,
service_accounts_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("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.Empty{}])
end
@doc """
Disables a ServiceAccount immediately.
If an application uses the service account to authenticate, that
application can no longer call Google APIs or access Google Cloud
resources. Existing access tokens for the service account are rejected, and
requests for new access tokens will fail.
To re-enable the service account, use EnableServiceAccount. After you
re-enable the service account, its existing access tokens will be accepted,
and you can request new access tokens.
To help avoid unplanned outages, we recommend that you disable the service
account before you delete it. Use this method to disable the service
account, then wait at least 24 hours and watch for unintended consequences.
If there are no unintended consequences, you can delete the service account
with DeleteServiceAccount.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.DisableServiceAccountRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_disable(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_service_accounts_disable(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:disable", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.Empty{}])
end
@doc """
Enables a ServiceAccount that was disabled by
DisableServiceAccount.
If the service account is already enabled, then this method has no effect.
If the service account was disabled by other means—for example, if Google
disabled the service account because it was compromised—you cannot use this
method to enable the service account.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.EnableServiceAccountRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_enable(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_service_accounts_enable(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:enable", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.Empty{}])
end
@doc """
Gets a ServiceAccount.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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.IAM.V1.Model.ServiceAccount{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_get(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.ServiceAccount.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_get(
connection,
projects_id,
service_accounts_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("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.ServiceAccount{}])
end
@doc """
Gets the IAM policy that is attached to a ServiceAccount. This IAM
policy specifies which members have access to the service account.
This method does not tell you whether the service account has been granted
any roles on other resources. To check whether a service account has role
grants on a resource, use the `getIamPolicy` method for that resource. For
example, to view the role grants for a project, call the Resource Manager
API's
[`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy)
method.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `resource`. REQUIRED: The resource for which the policy is being requested.
See the operation documentation for the appropriate value for this field.
* `service_accounts_id` (*type:* `String.t`) - Part of `resource`. 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").
* `:"options.requestedPolicyVersion"` (*type:* `integer()`) - Optional. The policy format version to be returned.
Valid values are 0, 1, and 3. Requests specifying an invalid value will be
rejected.
Requests for policies with any conditional bindings must specify version 3.
Policies without any conditional bindings may specify any valid value or
leave the field unset.
To learn which resources support conditions in their IAM policies, see the
[IAM
documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Policy{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_get_iam_policy(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Policy.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_service_accounts_get_iam_policy(
connection,
projects_id,
service_accounts_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,
:"options.requestedPolicyVersion" => :query
}
request =
Request.new()
|> Request.method(:post)
|> Request.url(
"/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:getIamPolicy",
%{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.Policy{}])
end
@doc """
Lists every ServiceAccount that belongs to a specific project.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the project associated with the service
accounts, such as `projects/my-project-123`.
* `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()`) - Optional limit on the number of service accounts to include in the
response. Further accounts can subsequently be obtained by including the
ListServiceAccountsResponse.next_page_token
in a subsequent request.
* `:pageToken` (*type:* `String.t`) - Optional pagination token returned in an earlier
ListServiceAccountsResponse.next_page_token.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ListServiceAccountsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_list(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.IAM.V1.Model.ListServiceAccountsResponse.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_list(
connection,
projects_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,
:pageSize => :query,
:pageToken => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts", %{
"projectsId" => URI.encode(projects_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.IAM.V1.Model.ListServiceAccountsResponse{}])
end
@doc """
Patches a ServiceAccount.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `serviceAccount.name`. The resource name of the service account.
Use one of the following formats:
* `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
As an alternative, you can use the `-` wildcard character instead of the
project ID:
* `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/-/serviceAccounts/{UNIQUE_ID}`
When possible, avoid using the `-` wildcard character, because it can cause
response messages to contain misleading error codes. For example, if you
try to get the service account
`projects/-/serviceAccounts/fake@example.com`, which does not exist, the
response contains an HTTP `403 Forbidden` error instead of a `404 Not
Found` error.
* `service_accounts_id` (*type:* `String.t`) - Part of `serviceAccount.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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.PatchServiceAccountRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ServiceAccount{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_patch(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.ServiceAccount.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_patch(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:patch)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.ServiceAccount{}])
end
@doc """
Sets the IAM policy that is attached to a ServiceAccount.
Use this method to grant or revoke access to the service account. For
example, you could grant a member the ability to impersonate the service
account.
This method does not enable the service account to access other resources.
To grant roles to a service account on a resource, follow these steps:
1. Call the resource's `getIamPolicy` method to get its current IAM policy.
2. Edit the policy so that it binds the service account to an IAM role for
the resource.
3. Call the resource's `setIamPolicy` method to update its IAM policy.
For detailed instructions, see
[Granting roles to a service account for specific
resources](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts).
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `resource`. REQUIRED: The resource for which the policy is being specified.
See the operation documentation for the appropriate value for this field.
* `service_accounts_id` (*type:* `String.t`) - Part of `resource`. 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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.SetIamPolicyRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.Policy{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_set_iam_policy(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Policy.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_service_accounts_set_iam_policy(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url(
"/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:setIamPolicy",
%{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.Policy{}])
end
@doc """
**Note:** We are in the process of deprecating this method. Use the
[`signBlob`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signBlob)
method in the IAM Service Account Credentials API instead.
Signs a blob using the system-managed private key for a ServiceAccount.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.SignBlobRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.SignBlobResponse{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_sign_blob(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.SignBlobResponse.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_sign_blob(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.SignBlobResponse{}])
end
@doc """
**Note:** We are in the process of deprecating this method. Use the
[`signJwt`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signJwt)
method in the IAM Service Account Credentials API instead.
Signs a JSON Web Token (JWT) using the system-managed private key for a
ServiceAccount.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.SignJwtRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.SignJwtResponse{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_sign_jwt(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.SignJwtResponse.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_sign_jwt(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.SignJwtResponse{}])
end
@doc """
Tests whether the caller has the specified permissions on a
ServiceAccount.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `resource`. REQUIRED: The resource for which the policy detail is being requested.
See the operation documentation for the appropriate value for this field.
* `service_accounts_id` (*type:* `String.t`) - Part of `resource`. 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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.TestIamPermissionsRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.TestIamPermissionsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_test_iam_permissions(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.TestIamPermissionsResponse.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_test_iam_permissions(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url(
"/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:testIamPermissions",
%{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.TestIamPermissionsResponse{}])
end
@doc """
Restores a deleted ServiceAccount.
**Important:** It is not always possible to restore a deleted service
account. Use this method only as a last resort.
After you delete a service account, IAM permanently removes the service
account 30 days later. There is no way to restore a deleted service account
that has been permanently removed.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.UndeleteServiceAccountRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.UndeleteServiceAccountResponse{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_undelete(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.UndeleteServiceAccountResponse.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_undelete(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:undelete", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.UndeleteServiceAccountResponse{}])
end
@doc """
**Note:** We are in the process of deprecating this method. Use
PatchServiceAccount instead.
Updates a ServiceAccount.
You can update only the `display_name` and `description` fields.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The resource name of the service account.
Use one of the following formats:
* `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
As an alternative, you can use the `-` wildcard character instead of the
project ID:
* `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
* `projects/-/serviceAccounts/{UNIQUE_ID}`
When possible, avoid using the `-` wildcard character, because it can cause
response messages to contain misleading error codes. For example, if you
try to get the service account
`projects/-/serviceAccounts/fake@example.com`, which does not exist, the
response contains an HTTP `403 Forbidden` error instead of a `404 Not
Found` error.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.ServiceAccount.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ServiceAccount{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_update(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.ServiceAccount.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_update(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:put)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.ServiceAccount{}])
end
@doc """
Creates a ServiceAccountKey.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.CreateServiceAccountKeyRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ServiceAccountKey{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_keys_create(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.ServiceAccountKey.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_keys_create(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.ServiceAccountKey{}])
end
@doc """
Deletes a ServiceAccountKey.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account key in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`.
* `keys_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.IAM.V1.Model.Empty{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_keys_delete(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword(),
keyword()
) :: {:ok, GoogleApi.IAM.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:error, any()}
def iam_projects_service_accounts_keys_delete(
connection,
projects_id,
service_accounts_id,
keys_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(
"/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}",
%{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_id, &URI.char_unreserved?/1),
"keysId" => URI.encode(keys_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.IAM.V1.Model.Empty{}])
end
@doc """
Gets a ServiceAccountKey.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account key in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_id` (*type:* `String.t`) - Part of `name`. See documentation of `projectsId`.
* `keys_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").
* `:publicKeyType` (*type:* `String.t`) - The output format of the public key requested.
X509_PEM is the default output format.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ServiceAccountKey{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_keys_get(
Tesla.Env.client(),
String.t(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.ServiceAccountKey.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_keys_get(
connection,
projects_id,
service_accounts_id,
keys_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,
:publicKeyType => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url(
"/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}",
%{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_id, &URI.char_unreserved?/1),
"keysId" => URI.encode(keys_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.IAM.V1.Model.ServiceAccountKey{}])
end
@doc """
Lists every ServiceAccountKey for a service account.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. Required. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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").
* `:keyTypes` (*type:* `list(String.t)`) - Filters the types of keys the user wants to include in the list
response. Duplicate key types are not allowed. If no key type
is provided, all keys are returned.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ListServiceAccountKeysResponse{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_keys_list(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.ListServiceAccountKeysResponse.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_keys_list(
connection,
projects_id,
service_accounts_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,
:keyTypes => :query
}
request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys", %{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.ListServiceAccountKeysResponse{}])
end
@doc """
Creates a ServiceAccountKey, using a public key that you provide.
## Parameters
* `connection` (*type:* `GoogleApi.IAM.V1.Connection.t`) - Connection to server
* `projects_id` (*type:* `String.t`) - Part of `name`. The resource name of the service account in the following format:
`projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
the account. The `ACCOUNT` value can be the `email` address or the
`unique_id` of the service account.
* `service_accounts_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").
* `:body` (*type:* `GoogleApi.IAM.V1.Model.UploadServiceAccountKeyRequest.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.IAM.V1.Model.ServiceAccountKey{}}` on success
* `{:error, info}` on failure
"""
@spec iam_projects_service_accounts_keys_upload(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.IAM.V1.Model.ServiceAccountKey.t()}
| {:ok, Tesla.Env.t()}
| {:error, any()}
def iam_projects_service_accounts_keys_upload(
connection,
projects_id,
service_accounts_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,
:body => :body
}
request =
Request.new()
|> Request.method(:post)
|> Request.url(
"/v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys:upload",
%{
"projectsId" => URI.encode(projects_id, &URI.char_unreserved?/1),
"serviceAccountsId" => URI.encode(service_accounts_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.IAM.V1.Model.ServiceAccountKey{}])
end
end