Googly.CloudStorage.Projects.HmacKeys (googly_cloud_storage v0.1.0)

Copy Markdown View Source

Endpoints for the Projects.HmacKeys resource.

Summary

Functions

Creates a new HMAC key for the specified service account.

Retrieves an HMAC key's metadata

Retrieves a list of HMAC keys matching the criteria.

Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.

Functions

create(project_id, service_account_email, opts \\ [])

@spec create(String.t(), String.t(), keyword()) ::
  {:ok, Googly.CloudStorage.Model.HmacKey.t()} | {:error, term()}

Creates a new HMAC key for the specified service account.

Parameters

  • project_id (type: String.t()) - Project ID owning the service account.
  • service_account_email (type: String.t()) - Email address of the service account.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • alt (type: String.t()) - Data format for the response.
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • upload_type (type: String.t()) - Upload protocol for media (e.g. "media", "multipart", "resumable").
    • user_ip (type: String.t()) - Deprecated. Please use quotaUser instead.
    • user_project (type: String.t()) - The project to be billed for this request.

Returns

  • {:ok, %Googly.CloudStorage.Model.HmacKey{}} on success
  • {:error, %Googly.CloudStorage.Error{}} on failure

delete(project_id, access_id, opts \\ [])

@spec delete(String.t(), String.t(), keyword()) ::
  {:ok, Req.Response.t()} | {:error, term()}

Deletes an HMAC key.

Parameters

  • project_id (type: String.t()) - Project ID owning the requested key
  • access_id (type: String.t()) - Name of the HMAC key to be deleted.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • alt (type: String.t()) - Data format for the response.
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • upload_type (type: String.t()) - Upload protocol for media (e.g. "media", "multipart", "resumable").
    • user_ip (type: String.t()) - Deprecated. Please use quotaUser instead.
    • user_project (type: String.t()) - The project to be billed for this request.

Returns

  • {:ok, Req.Response.t()} on success
  • {:error, %Googly.CloudStorage.Error{}} on failure

get(project_id, access_id, opts \\ [])

@spec get(String.t(), String.t(), keyword()) ::
  {:ok, Googly.CloudStorage.Model.HmacKeyMetadata.t()} | {:error, term()}

Retrieves an HMAC key's metadata

Parameters

  • project_id (type: String.t()) - Project ID owning the service account of the requested key.
  • access_id (type: String.t()) - Name of the HMAC key.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • alt (type: String.t()) - Data format for the response.
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • upload_type (type: String.t()) - Upload protocol for media (e.g. "media", "multipart", "resumable").
    • user_ip (type: String.t()) - Deprecated. Please use quotaUser instead.
    • user_project (type: String.t()) - The project to be billed for this request.

Returns

  • {:ok, %Googly.CloudStorage.Model.HmacKeyMetadata{}} on success
  • {:error, %Googly.CloudStorage.Error{}} on failure

list(project_id, opts \\ [])

@spec list(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudStorage.Model.HmacKeysMetadata.t()} | {:error, term()}

Retrieves a list of HMAC keys matching the criteria.

Parameters

  • project_id (type: String.t()) - Name of the project in which to look for HMAC keys.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • alt (type: String.t()) - Data format for the response.
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • upload_type (type: String.t()) - Upload protocol for media (e.g. "media", "multipart", "resumable").
    • user_ip (type: String.t()) - Deprecated. Please use quotaUser instead.
    • max_results (type: integer()) - Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.
    • page_token (type: String.t()) - A previously-returned page token representing part of the larger set of results to view.
    • service_account_email (type: String.t()) - If present, only keys for the given service account are returned.
    • show_deleted_keys (type: boolean()) - Whether or not to show keys in the DELETED state.
    • user_project (type: String.t()) - The project to be billed for this request.

Returns

  • {:ok, %Googly.CloudStorage.Model.HmacKeysMetadata{}} on success
  • {:error, %Googly.CloudStorage.Error{}} on failure

update(project_id, access_id, opts \\ [])

@spec update(String.t(), String.t(), keyword()) ::
  {:ok, Googly.CloudStorage.Model.HmacKeyMetadata.t()} | {:error, term()}

Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.

Parameters

  • project_id (type: String.t()) - Project ID owning the service account of the updated key.
  • access_id (type: String.t()) - Name of the HMAC key being updated.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • alt (type: String.t()) - Data format for the response.
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • upload_type (type: String.t()) - Upload protocol for media (e.g. "media", "multipart", "resumable").
    • user_ip (type: String.t()) - Deprecated. Please use quotaUser instead.
    • user_project (type: String.t()) - The project to be billed for this request.
    • body (type: Googly.CloudStorage.Model.HmacKeyMetadata.t()) -

Returns

  • {:ok, %Googly.CloudStorage.Model.HmacKeyMetadata{}} on success
  • {:error, %Googly.CloudStorage.Error{}} on failure