Google Cloud Support V2 API - Class Google::Cloud::Support::V2::CaseService::Client (v0.2.0)

Reference documentation and code samples for the Google Cloud Support V2 API class Google::Cloud::Support::V2::CaseService::Client.

Client for the CaseService service.

A service to manage Google Cloud support cases.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the CaseService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all CaseService clients
::Google::Cloud::Support::V2::CaseService::Client.configure do |config|
  config.timeout = 10.0
end

#close_case

def close_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
def close_case(name: nil) -> ::Google::Cloud::Support::V2::Case

Close the specified case.

Overloads
def close_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to close_case via a request object, either of type Google::Cloud::Support::V2::CloseCaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::CloseCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def close_case(name: nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to close_case via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The fully qualified name of the case resource to be closed.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::CloseCaseRequest.new

# Call the close_case method.
result = client.close_case request

# The returned object is of type Google::Cloud::Support::V2::Case.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the CaseService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_case

def create_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
def create_case(parent: nil, case: nil) -> ::Google::Cloud::Support::V2::Case

Create a new case and associate it with the given Google Cloud Resource. The case object must have the following fields set: display_name, description, classification, and priority.

Overloads
def create_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to create_case via a request object, either of type Google::Cloud::Support::V2::CreateCaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::CreateCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_case(parent: nil, case: nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to create_case via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The name of the Google Cloud Resource under which the case should be created.
  • case (::Google::Cloud::Support::V2::Case, ::Hash) — Required. The case to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::CreateCaseRequest.new

# Call the create_case method.
result = client.create_case request

# The returned object is of type Google::Cloud::Support::V2::Case.
p result

#escalate_case

def escalate_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
def escalate_case(name: nil, escalation: nil) -> ::Google::Cloud::Support::V2::Case

Escalate a case. Escalating a case will initiate the Google Cloud Support escalation management process.

This operation is only available to certain Customer Care tiers. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which tiers are able to perform escalations.

Overloads
def escalate_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to escalate_case via a request object, either of type EscalateCaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::EscalateCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def escalate_case(name: nil, escalation: nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to escalate_case via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The fully qualified name of the Case resource to be escalated.
  • escalation (::Google::Cloud::Support::V2::Escalation, ::Hash) — The escalation object to be sent with the escalation request.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::EscalateCaseRequest.new

# Call the escalate_case method.
result = client.escalate_case request

# The returned object is of type Google::Cloud::Support::V2::Case.
p result

#get_case

def get_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
def get_case(name: nil) -> ::Google::Cloud::Support::V2::Case

Retrieve the specified case.

Overloads
def get_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to get_case via a request object, either of type GetCaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::GetCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_case(name: nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to get_case via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The fully qualified name of a case to be retrieved.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::GetCaseRequest.new

# Call the get_case method.
result = client.get_case request

# The returned object is of type Google::Cloud::Support::V2::Case.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new CaseService client object.

Yields
  • (config) — Configure the CaseService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Support::V2::CaseService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Support::V2::CaseService::Client.new do |config|
  config.timeout = 10.0
end

#list_cases

def list_cases(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>
def list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>

Retrieve all cases under the specified parent.

Note: Listing cases under an Organization returns only the cases directly parented by that organization. To retrieve all cases under an organization, including cases parented by projects under that organization, use cases.search.

Overloads
def list_cases(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>
Pass arguments to list_cases via a request object, either of type ListCasesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::ListCasesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_cases(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>
Pass arguments to list_cases via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The fully qualified name of parent resource to list cases under.
  • filter (::String) —

    An expression written in filter language. If non-empty, the query returns the cases that match the filter. Else, the query doesn't filter the cases.

    Filter expressions use the following fields with the operators equals (=) and AND:

    • state: The accepted values are OPEN or CLOSED.
    • priority: The accepted values are P0, P1, P2, P3, or P4. You can specify multiple values for priority using the OR operator. For example, priority=P1 OR priority=P2.
    • creator.email: The email address of the case creator.

    Examples:

    • state=CLOSED
    • state=OPEN AND creator.email="tester@example.com"
    • state=OPEN AND (priority=P0 OR priority=P1)
  • page_size (::Integer) — The maximum number of cases fetched with each request. Defaults to 10.
  • page_token (::String) — A token identifying the page of results to return. If unspecified, the first page is retrieved.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::ListCasesRequest.new

# Call the list_cases method.
result = client.list_cases request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Support::V2::Case.
  p item
end

#search_case_classifications

def search_case_classifications(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>
def search_case_classifications(query: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>

Retrieve valid classifications to be used when creating a support case. The classications are hierarchical, with each classification containing all levels of the hierarchy, separated by " > ". For example "Technical Issue > Compute > Compute Engine".

Overloads
def search_case_classifications(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>
Pass arguments to search_case_classifications via a request object, either of type SearchCaseClassificationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::SearchCaseClassificationsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def search_case_classifications(query: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::CaseClassification>
Pass arguments to search_case_classifications via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • query (::String) — An expression written in the Google Cloud filter language. If non-empty, then only cases whose fields match the filter are returned. If empty, then no messages are filtered out.
  • page_size (::Integer) — The maximum number of cases fetched with each request.
  • page_token (::String) — A token identifying the page of results to return. If unspecified, the first page is retrieved.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::SearchCaseClassificationsRequest.new

# Call the search_case_classifications method.
result = client.search_case_classifications request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Support::V2::CaseClassification.
  p item
end

#search_cases

def search_cases(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>
def search_cases(parent: nil, query: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>

Search cases using the specified query.

Overloads
def search_cases(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>
Pass arguments to search_cases via a request object, either of type SearchCasesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::SearchCasesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def search_cases(parent: nil, query: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Case>
Pass arguments to search_cases via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — The fully qualified name of parent resource to search cases under.
  • query (::String) —

    An expression written in filter language.

    A query uses the following fields with the operators equals (=) and AND:

    • organization: An organization name in the form organizations/<organization_id>.
    • project: A project name in the form projects/<project_id>.
    • state: The accepted values are OPEN or CLOSED.
    • priority: The accepted values are P0, P1, P2, P3, or P4. You can specify multiple values for priority using the OR operator. For example, priority=P1 OR priority=P2.
    • creator.email: The email address of the case creator.
    • billingAccount: A billing account in the form billingAccounts/<billing_account_id>

    You must specify either organization or project.

    To search across displayName, description, and comments, use a global restriction with no keyword or operator. For example, "my search".

    To search only cases updated after a certain date, use update_time restricted with that particular date, time, and timezone in ISO datetime format. For example, update_time>"2020-01-01T00:00:00-05:00". update_time only supports the greater than operator (>).

    Examples:

    • organization="organizations/123456789"
    • project="projects/my-project-id"
    • project="projects/123456789"
    • billing_account="billingAccounts/123456-A0B0C0-CUZ789"
    • organization="organizations/123456789" AND state=CLOSED
    • project="projects/my-project-id" AND creator.email="tester@example.com"
    • project="projects/my-project-id" AND (priority=P0 OR priority=P1)
  • page_size (::Integer) — The maximum number of cases fetched with each request. The default page size is 10.
  • page_token (::String) — A token identifying the page of results to return. If unspecified, the first page is retrieved.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::SearchCasesRequest.new

# Call the search_cases method.
result = client.search_cases request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Support::V2::Case.
  p item
end

#update_case

def update_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
def update_case(case: nil, update_mask: nil) -> ::Google::Cloud::Support::V2::Case

Update the specified case. Only a subset of fields can be updated.

Overloads
def update_case(request, options = nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to update_case via a request object, either of type UpdateCaseRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Support::V2::UpdateCaseRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_case(case: nil, update_mask: nil) -> ::Google::Cloud::Support::V2::Case
Pass arguments to update_case via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • case (::Google::Cloud::Support::V2::Case, ::Hash) — Required. The case object to update.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — A list of attributes of the case object that should be updated as part of this request. Supported values are priority, display_name, and subscriber_email_addresses. If no fields are specified, all supported fields are updated.

    WARNING: If you do not provide a field mask, then you might accidentally clear some fields. For example, if you leave the field mask empty and do not provide a value for subscriber_email_addresses, then subscriber_email_addresses is updated to empty.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/support/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2::CaseService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2::UpdateCaseRequest.new

# Call the update_case method.
result = client.update_case request

# The returned object is of type Google::Cloud::Support::V2::Case.
p result