Googly.CloudVision.Operations (googly_cloud_vision v0.1.0)

Copy Markdown View Source

Endpoints for the Operations resource.

Summary

Functions

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.

Functions

cancel(name, opts \\ [])

@spec cancel(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.Empty.t()} | {:error, term()}

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.

Parameters

  • name (type: String.t()) - The name of the operation resource to be cancelled.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (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.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.CloudVision.Model.CancelOperationRequest.t()) -

Returns

  • {:ok, %Googly.CloudVision.Model.Empty{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

delete(name, opts \\ [])

@spec delete(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.Empty.t()} | {:error, term()}

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters

  • name (type: String.t()) - The name of the operation resource to be deleted.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (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.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.

Returns

  • {:ok, %Googly.CloudVision.Model.Empty{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

get(name, opts \\ [])

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

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters

  • name (type: String.t()) - The name of the operation resource.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (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.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.

Returns

  • {:ok, %Googly.CloudVision.Model.Operation{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

list(name, opts \\ [])

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

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.

Parameters

  • name (type: String.t()) - The name of the operation's parent resource.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • 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.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (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.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • filter (type: String.t()) - The standard list filter.
    • page_size (type: integer()) - The standard list page size.
    • page_token (type: String.t()) - The standard list page token.
    • return_partial_success (type: boolean()) - When set to true, operations that are reachable are returned as normal, and those that are unreachable are returned in the ListOperationsResponse.unreachable field. This can only be true when reading across collections. For example, when parent is set to "projects/example/locations/-". This field is not supported by default and will result in an UNIMPLEMENTED error if set unless explicitly documented otherwise in service or product specific documentation.

Returns

  • {:ok, %Googly.CloudVision.Model.ListOperationsResponse{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure