Google Cloud Support v2 API - Class CaseServiceClientImpl (1.4.0)

public sealed class CaseServiceClientImpl : CaseServiceClient

Reference documentation and code samples for the Google Cloud Support v2 API class CaseServiceClientImpl.

CaseService client wrapper implementation, for convenient use.

Inheritance

object > CaseServiceClient > CaseServiceClientImpl

Namespace

Google.Cloud.Support.V2

Assembly

Google.Cloud.Support.V2.dll

Remarks

A service to manage Google Cloud support cases.

Constructors

CaseServiceClientImpl(CaseServiceClient, CaseServiceSettings, ILogger)

public CaseServiceClientImpl(CaseService.CaseServiceClient grpcClient, CaseServiceSettings settings, ILogger logger)

Constructs a client wrapper for the CaseService service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient CaseServiceCaseServiceClient

The underlying gRPC client.

settings CaseServiceSettings

The base CaseServiceSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override CaseService.CaseServiceClient GrpcClient { get; }

The underlying gRPC CaseService client

Property Value
Type Description
CaseServiceCaseServiceClient
Overrides

Methods

CloseCase(CloseCaseRequest, CallSettings)

public override Case CloseCase(CloseCaseRequest request, CallSettings callSettings = null)

Close a case.

EXAMPLES:

cURL:

case="projects/some-project/cases/43595344"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$case:close"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().close(
name="projects/some-project/cases/43595344"
)
print(request.execute())
Parameters
Name Description
request CloseCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Case

The RPC response.

Overrides

CloseCaseAsync(CloseCaseRequest, CallSettings)

public override Task<Case> CloseCaseAsync(CloseCaseRequest request, CallSettings callSettings = null)

Close a case.

EXAMPLES:

cURL:

case="projects/some-project/cases/43595344"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$case:close"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().close(
name="projects/some-project/cases/43595344"
)
print(request.execute())
Parameters
Name Description
request CloseCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCase

A Task containing the RPC response.

Overrides

CreateCase(CreateCaseRequest, CallSettings)

public override Case CreateCase(CreateCaseRequest request, CallSettings callSettings = null)

Create a new case and associate it with a parent.

It must have the following fields set: display_name, description, classification, and priority. If you're just testing the API and don't want to route your case to an agent, set testCase=true.

EXAMPLES:

cURL:

parent="projects/some-project"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header 'Content-Type: application/json' \
--data '{
"display_name": "Test case created by me.",
"description": "a random test case, feel free to close",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
"time_zone": "-07:00",
"subscriber_email_addresses": [
"foo@domain.com",
"bar@domain.com"
],
"testCase": true,
"priority": "P3"
}' \
"https://cloudsupport.googleapis.com/v2/$parent/cases"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().create(
parent="projects/some-project",
body={
"displayName": "A Test Case",
"description": "This is a test case.",
"testCase": True,
"priority": "P2",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
},
)
print(request.execute())
Parameters
Name Description
request CreateCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Case

The RPC response.

Overrides

CreateCaseAsync(CreateCaseRequest, CallSettings)

public override Task<Case> CreateCaseAsync(CreateCaseRequest request, CallSettings callSettings = null)

Create a new case and associate it with a parent.

It must have the following fields set: display_name, description, classification, and priority. If you're just testing the API and don't want to route your case to an agent, set testCase=true.

EXAMPLES:

cURL:

parent="projects/some-project"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header 'Content-Type: application/json' \
--data '{
"display_name": "Test case created by me.",
"description": "a random test case, feel free to close",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
"time_zone": "-07:00",
"subscriber_email_addresses": [
"foo@domain.com",
"bar@domain.com"
],
"testCase": true,
"priority": "P3"
}' \
"https://cloudsupport.googleapis.com/v2/$parent/cases"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().create(
parent="projects/some-project",
body={
"displayName": "A Test Case",
"description": "This is a test case.",
"testCase": True,
"priority": "P2",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
},
)
print(request.execute())
Parameters
Name Description
request CreateCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCase

A Task containing the RPC response.

Overrides

EscalateCase(EscalateCaseRequest, CallSettings)

public override Case EscalateCase(EscalateCaseRequest request, CallSettings callSettings = null)

Escalate a case, starting the Google Cloud Support escalation management process.

This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that.

EXAMPLES:

cURL:

case="projects/some-project/cases/43595344"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header "Content-Type: application/json" \
--data '{
"escalation": {
"reason": "BUSINESS_IMPACT",
"justification": "This is a test escalation."
}
}' \
"https://cloudsupport.googleapis.com/v2/$case:escalate"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().escalate(
name="projects/some-project/cases/43595344",
body={
"escalation": {
"reason": "BUSINESS_IMPACT",
"justification": "This is a test escalation.",
},
},
)
print(request.execute())
Parameters
Name Description
request EscalateCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Case

The RPC response.

Overrides

EscalateCaseAsync(EscalateCaseRequest, CallSettings)

public override Task<Case> EscalateCaseAsync(EscalateCaseRequest request, CallSettings callSettings = null)

Escalate a case, starting the Google Cloud Support escalation management process.

This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that.

EXAMPLES:

cURL:

case="projects/some-project/cases/43595344"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header "Content-Type: application/json" \
--data '{
"escalation": {
"reason": "BUSINESS_IMPACT",
"justification": "This is a test escalation."
}
}' \
"https://cloudsupport.googleapis.com/v2/$case:escalate"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().escalate(
name="projects/some-project/cases/43595344",
body={
"escalation": {
"reason": "BUSINESS_IMPACT",
"justification": "This is a test escalation.",
},
},
)
print(request.execute())
Parameters
Name Description
request EscalateCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCase

A Task containing the RPC response.

Overrides

GetCase(GetCaseRequest, CallSettings)

public override Case GetCase(GetCaseRequest request, CallSettings callSettings = null)

Retrieve a case.

EXAMPLES:

cURL:

case="projects/some-project/cases/16033687"
curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$case"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)

request = supportApiService.cases().get(
name="projects/some-project/cases/43595344",
)
print(request.execute())
Parameters
Name Description
request GetCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Case

The RPC response.

Overrides

GetCaseAsync(GetCaseRequest, CallSettings)

public override Task<Case> GetCaseAsync(GetCaseRequest request, CallSettings callSettings = null)

Retrieve a case.

EXAMPLES:

cURL:

case="projects/some-project/cases/16033687"
curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$case"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)

request = supportApiService.cases().get(
name="projects/some-project/cases/43595344",
)
print(request.execute())
Parameters
Name Description
request GetCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCase

A Task containing the RPC response.

Overrides

ListCases(ListCasesRequest, CallSettings)

public override PagedEnumerable<ListCasesResponse, Case> ListCases(ListCasesRequest request, CallSettings callSettings = null)

Retrieve all cases under a parent, but not its children.

For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use cases.search.

EXAMPLES:

cURL:

parent="projects/some-project"
curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$parent/cases"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)

request =
supportApiService.cases().list(parent="projects/some-project")
print(request.execute())
Parameters
Name Description
request ListCasesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListCasesResponseCase

A pageable sequence of Case resources.

Overrides

ListCasesAsync(ListCasesRequest, CallSettings)

public override PagedAsyncEnumerable<ListCasesResponse, Case> ListCasesAsync(ListCasesRequest request, CallSettings callSettings = null)

Retrieve all cases under a parent, but not its children.

For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use cases.search.

EXAMPLES:

cURL:

parent="projects/some-project"
curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$parent/cases"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)

request =
supportApiService.cases().list(parent="projects/some-project")
print(request.execute())
Parameters
Name Description
request ListCasesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListCasesResponseCase

A pageable asynchronous sequence of Case resources.

Overrides

SearchCaseClassifications(SearchCaseClassificationsRequest, CallSettings)

public override PagedEnumerable<SearchCaseClassificationsResponse, CaseClassification> SearchCaseClassifications(SearchCaseClassificationsRequest request, CallSettings callSettings = null)

Retrieve valid classifications to use when creating a support case.

Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by " > ". For example, "Technical Issue > Compute > Compute Engine".

Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, case.create requests using the classification will fail.

EXAMPLES:

cURL:

curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
'https://cloudsupport.googleapis.com/v2/caseClassifications:search?query=display_name:"*Compute%20Engine*"'

Python:

import googleapiclient.discovery

supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version="v2",
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=v2",
)
request = supportApiService.caseClassifications().search(
query='display_name:"*Compute Engine*"'
)
print(request.execute())
Parameters
Name Description
request SearchCaseClassificationsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSearchCaseClassificationsResponseCaseClassification

A pageable sequence of CaseClassification resources.

Overrides

SearchCaseClassificationsAsync(SearchCaseClassificationsRequest, CallSettings)

public override PagedAsyncEnumerable<SearchCaseClassificationsResponse, CaseClassification> SearchCaseClassificationsAsync(SearchCaseClassificationsRequest request, CallSettings callSettings = null)

Retrieve valid classifications to use when creating a support case.

Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by " > ". For example, "Technical Issue > Compute > Compute Engine".

Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, case.create requests using the classification will fail.

EXAMPLES:

cURL:

curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
'https://cloudsupport.googleapis.com/v2/caseClassifications:search?query=display_name:"*Compute%20Engine*"'

Python:

import googleapiclient.discovery

supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version="v2",
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=v2",
)
request = supportApiService.caseClassifications().search(
query='display_name:"*Compute Engine*"'
)
print(request.execute())
Parameters
Name Description
request SearchCaseClassificationsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSearchCaseClassificationsResponseCaseClassification

A pageable asynchronous sequence of CaseClassification resources.

Overrides

SearchCases(SearchCasesRequest, CallSettings)

public override PagedEnumerable<SearchCasesResponse, Case> SearchCases(SearchCasesRequest request, CallSettings callSettings = null)

Search for cases using a query.

EXAMPLES:

cURL:

parent="projects/some-project"
curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$parent/cases:search"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().search(
parent="projects/some-project", query="state=OPEN"
)
print(request.execute())
Parameters
Name Description
request SearchCasesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSearchCasesResponseCase

A pageable sequence of Case resources.

Overrides

SearchCasesAsync(SearchCasesRequest, CallSettings)

public override PagedAsyncEnumerable<SearchCasesResponse, Case> SearchCasesAsync(SearchCasesRequest request, CallSettings callSettings = null)

Search for cases using a query.

EXAMPLES:

cURL:

parent="projects/some-project"
curl \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$parent/cases:search"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().search(
parent="projects/some-project", query="state=OPEN"
)
print(request.execute())
Parameters
Name Description
request SearchCasesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSearchCasesResponseCase

A pageable asynchronous sequence of Case resources.

Overrides

UpdateCase(UpdateCaseRequest, CallSettings)

public override Case UpdateCase(UpdateCaseRequest request, CallSettings callSettings = null)

Update a case. Only some fields can be updated.

EXAMPLES:

cURL:

case="projects/some-project/cases/43595344"
curl \
--request PATCH \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header "Content-Type: application/json" \
--data '{
"priority": "P1"
}' \
"https://cloudsupport.googleapis.com/v2/$case?updateMask=priority"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().patch(
name="projects/some-project/cases/43112854",
body={
"displayName": "This is Now a New Title",
"priority": "P2",
},
)
print(request.execute())
Parameters
Name Description
request UpdateCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Case

The RPC response.

Overrides

UpdateCaseAsync(UpdateCaseRequest, CallSettings)

public override Task<Case> UpdateCaseAsync(UpdateCaseRequest request, CallSettings callSettings = null)

Update a case. Only some fields can be updated.

EXAMPLES:

cURL:

case="projects/some-project/cases/43595344"
curl \
--request PATCH \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header "Content-Type: application/json" \
--data '{
"priority": "P1"
}' \
"https://cloudsupport.googleapis.com/v2/$case?updateMask=priority"

Python:

import googleapiclient.discovery

api_version = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
)
request = supportApiService.cases().patch(
name="projects/some-project/cases/43112854",
body={
"displayName": "This is Now a New Title",
"priority": "P2",
},
)
print(request.execute())
Parameters
Name Description
request UpdateCaseRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCase

A Task containing the RPC response.

Overrides