Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

CloudSupport

import { CloudSupport } from "https://googleapis.deno.dev/v1/cloudsupport:v2.ts";

Manages Google Cloud technical support cases for Customer Care support offerings.

class CloudSupport {
constructor(client?: CredentialsClient, baseUrl?: string);
async caseClassificationsSearch(opts?: CaseClassificationsSearchOptions): Promise<SearchCaseClassificationsResponse>;
async casesAttachmentsList(parent: string, opts?: CasesAttachmentsListOptions): Promise<ListAttachmentsResponse>;
async casesClose(name: string, req: CloseCaseRequest): Promise<Case>;
async casesCommentsCreate(parent: string, req: Comment): Promise<Comment>;
async casesCommentsList(parent: string, opts?: CasesCommentsListOptions): Promise<ListCommentsResponse>;
async casesCreate(parent: string, req: Case): Promise<Case>;
async casesEscalate(name: string, req: EscalateCaseRequest): Promise<Case>;
async casesGet(name: string): Promise<Case>;
async casesList(parent: string, opts?: CasesListOptions): Promise<ListCasesResponse>;
async casesPatch(
name: string,
req: Case,
): Promise<Case>;
async casesSearch(parent: string, opts?: CasesSearchOptions): Promise<SearchCasesResponse>;
async mediaDownload(name: string): Promise<Media>;
async mediaUpload(parent: string, req: CreateAttachmentRequest): Promise<Attachment>;
}

§Constructors

§
new CloudSupport(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§

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: shell curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ 'https://cloudsupport.googleapis.com/v2/caseClassifications:search?query=display_name:"*Compute%20Engine*"' Python: 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())

§
casesAttachmentsList(parent: string, opts?: CasesAttachmentsListOptions): Promise<ListAttachmentsResponse>
[src]

List all the attachments associated with a support case. EXAMPLES: cURL:

"Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$case/attachments" ``` Python:
```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() .attachments()
.list(parent="projects/some-project/cases/43595344") )
print(request.execute()) ```
@param parent

Required. The name of the case for which attachments should be listed.

§
casesClose(name: string, req: CloseCaseRequest): Promise<Case>
[src]

Close a case. EXAMPLES: cURL: shell 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: 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())

@param name

Required. The name of the case to close.

§
casesCommentsCreate(parent: string, req: Comment): Promise<Comment>
[src]

Add a new comment to a case. The comment must have the following fields set: body. EXAMPLES: cURL: shell case="projects/some-project/cases/43591344" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header 'Content-Type: application/json' \ --data '{ "body": "This is a test comment." }' \ "https://cloudsupport.googleapis.com/v2/$case/comments" Python: 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() .comments() .create( parent="projects/some-project/cases/43595344", body={"body": "This is a test comment."}, ) ) print(request.execute())

@param parent

Required. The name of the case to which the comment should be added.

§
casesCommentsList(parent: string, opts?: CasesCommentsListOptions): Promise<ListCommentsResponse>
[src]

List all the comments associated with a case. EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case/comments" Python:

supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport", version=api_version,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
) request = ( supportApiService.cases() .comments()
.list(parent="projects/some-project/cases/43595344") )
print(request.execute()) ```
@param parent

Required. The name of the case for which to list comments.

§
casesCreate(parent: string, req: Case): Promise<Case>
[src]

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: shell 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:

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()) ```
@param parent

Required. The name of the parent under which the case should be created.

§
casesEscalate(name: string, req: EscalateCaseRequest): Promise<Case>
[src]

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: shell 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:

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()) ```
@param name

Required. The name of the case to be escalated.

§
casesGet(name: string): Promise<Case>
[src]

Retrieve a case. EXAMPLES: cURL: shell case="projects/some-project/cases/16033687" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case" Python: 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())

@param name

Required. The full name of a case to be retrieved.

§
casesList(parent: string, opts?: CasesListOptions): Promise<ListCasesResponse>
[src]

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: shell parent="projects/some-project" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$parent/cases" Python:

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()) ```
@param parent

Required. The name of a parent to list cases under.

§
casesPatch(name: string, req: Case, opts?: CasesPatchOptions): Promise<Case>
[src]

Update a case. Only some fields can be updated. EXAMPLES: cURL: shell 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: 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())

@param name

The resource name for the case.

§
casesSearch(parent: string, opts?: CasesSearchOptions): Promise<SearchCasesResponse>
[src]

Search for cases using a query. EXAMPLES: cURL: shell parent="projects/some-project" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$parent/cases:search" Python:

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()) ```
@param parent

The name of the parent resource to search for cases under.

§
mediaDownload(name: string): Promise<Media>
[src]

Download a file attached to a case. Note: HTTP requests must append "?alt=media" to the URL. EXAMPLES: cURL: shell name="projects/some-project/cases/43594844/attachments/0674M00000WijAnZAJ" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$name:download?alt=media" Python: 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.media().download( name="projects/some-project/cases/43595344/attachments/0684M00000Pw6pHQAR" ) request.uri = request.uri.split("?")[0] + "?alt=media" print(request.execute())

@param name

The name of the file attachment to download.

§
mediaUpload(parent: string, req: CreateAttachmentRequest): Promise<Attachment>
[src]

Create a file attachment on a case or Cloud resource. The attachment must have the following fields set: filename. EXAMPLES: cURL: shell echo "This text is in a file I'm uploading using CSAPI." \ > "./example_file.txt" case="projects/some-project/cases/43594844" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --data-binary @"./example_file.txt" \ "https://cloudsupport.googleapis.com/upload/v2beta/$case/attachments?attachment.filename=uploaded_via_curl.txt" Python: 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}", ) file_path = "./example_file.txt" with open(file_path, "w") as file: file.write( "This text is inside a file I'm going to upload using the Cloud Support API.", ) request = supportApiService.media().upload( parent="projects/some-project/cases/43595344", media_body=file_path ) request.uri = request.uri.split("?")[0] + "?attachment.filename=uploaded_via_python.txt" print(request.execute())

@param parent

Required. The name of the case or Cloud resource to which the attachment should be attached.