0.0.20241101 • Published 9 months ago

@maxim_mazurok/gapi.client.cloudsupport-v2beta v0.0.20241101

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

TypeScript typings for Google Cloud Support API v2beta

Manages Google Cloud technical support cases for Customer Care support offerings. For detailed description please check documentation.

Installing

Install typings for Google Cloud Support API:

npm install @types/gapi.client.cloudsupport-v2beta --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://cloudsupport.googleapis.com/$discovery/rest?version=v2beta',
  () => {
    // now we can use:
    // gapi.client.cloudsupport
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('cloudsupport', 'v2beta', () => {
  // now we can use:
  // gapi.client.cloudsupport
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
    'https://www.googleapis.com/auth/cloud-platform',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Google Cloud Support API resources:

/*
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: ```bash 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()) ```
*/
await gapi.client.cloudsupport.caseClassifications.search({});

/*
Close a case. EXAMPLES: cURL: ```bash 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()) ```
*/
await gapi.client.cloudsupport.cases.close({name: 'name'});

/*
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: ```bash 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: ```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()) ```
*/
await gapi.client.cloudsupport.cases.create({parent: 'parent'});

/*
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: ```bash 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: ```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()) ```
*/
await gapi.client.cloudsupport.cases.escalate({name: 'name'});

/*
Retrieve a case. EXAMPLES: cURL: ```bash 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()) ```
*/
await gapi.client.cloudsupport.cases.get({name: 'name'});

/*
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: ```bash parent="projects/some-project" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$parent/cases" ``` 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().list(parent="projects/some-project") print(request.execute()) ```
*/
await gapi.client.cloudsupport.cases.list({parent: 'parent'});

/*
Update a case. Only some fields can be updated. EXAMPLES: cURL: ```bash 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()) ```
*/
await gapi.client.cloudsupport.cases.patch({name: 'name'});

/*
Search for cases using a query. EXAMPLES: cURL: ```bash parent="projects/some-project" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$parent/cases:search" ``` 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().search( parent="projects/some-project", query="state=OPEN" ) print(request.execute()) ```
*/
await gapi.client.cloudsupport.cases.search({});

/*
Show items in the feed of this case, including case emails, attachments, and comments.
*/
await gapi.client.cloudsupport.cases.showFeed({parent: 'parent'});

/*
Download a file attached to a case. Note: HTTP requests must append "?alt=media" to the URL. EXAMPLES: cURL: ```bash 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()) ```
*/
await gapi.client.cloudsupport.media.download({name: 'name'});

/*
Create a file attachment on a case or Cloud resource. The attachment must have the following fields set: `filename`. EXAMPLES: cURL: ```bash 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()) ```
*/
await gapi.client.cloudsupport.media.upload({parent: 'parent'});
0.0.20241101

9 months ago

0.0.20241030

9 months ago

0.0.20241029

9 months ago

0.0.20241028

9 months ago

0.0.20241022

9 months ago

0.0.20241021

9 months ago

0.0.20241020

9 months ago

0.0.20241014

10 months ago

0.0.20241001

10 months ago

0.0.20241008

10 months ago

0.0.20241007

10 months ago

0.0.20241009

10 months ago

0.0.20240918

11 months ago

0.0.20240916

11 months ago

0.0.20240922

10 months ago

0.0.20240923

10 months ago

0.0.20240909

11 months ago

0.0.20240905

11 months ago

0.0.20240910

11 months ago

0.0.20240911

11 months ago

0.0.20240904

11 months ago

0.0.20240902

11 months ago

0.0.20240827

11 months ago

0.0.20240828

11 months ago

0.0.20240826

11 months ago

0.0.20240602

1 year ago

0.0.20240603

1 year ago

0.0.20240604

1 year ago

0.0.20240721

1 year ago

0.0.20240617

1 year ago

0.0.20240619

1 year ago

0.0.20240616

1 year ago

0.0.20240731

1 year ago

0.0.20240610

1 year ago

0.0.20240611

1 year ago

0.0.20240630

1 year ago

0.0.20240624

1 year ago

0.0.20240623

1 year ago

0.0.20240529

1 year ago

0.0.20240527

1 year ago

0.0.20240528

1 year ago

0.0.20240521

1 year ago

0.0.20240522

1 year ago

0.0.20240809

12 months ago

0.0.20240804

12 months ago

0.0.20240805

12 months ago

0.0.20240807

12 months ago

0.0.20240802

12 months ago

0.0.20240819

12 months ago

0.0.20240818

12 months ago

0.0.20240812

12 months ago

0.0.20240814

12 months ago

0.0.20240709

1 year ago

0.0.20240707

1 year ago

0.0.20240708

1 year ago

0.0.20240701

1 year ago

0.0.20240702

1 year ago

0.0.20240825

11 months ago

0.0.20240821

11 months ago

0.0.20240719

1 year ago

0.0.20240713

1 year ago

0.0.20240710

1 year ago

0.0.20240520

1 year ago

0.0.20240519

1 year ago

0.0.20240514

1 year ago

0.0.20240515

1 year ago

0.0.20240513

1 year ago

0.0.20240512

1 year ago

0.0.20240508

1 year ago

0.0.20240505

1 year ago

0.0.20240501

1 year ago

0.0.20240430

1 year ago

0.0.20240429

1 year ago

0.0.20240428

1 year ago

0.0.20240424

1 year ago

0.0.20240423

1 year ago

0.0.20240422

1 year ago

0.0.20240421

1 year ago

0.0.20240416

1 year ago

0.0.20240413

1 year ago

0.0.20240403

1 year ago

0.0.20240331

1 year ago

0.0.20240327

1 year ago

0.0.20240322

1 year ago

0.0.20240320

1 year ago

0.0.20240318

1 year ago

0.0.20240317

1 year ago

0.0.20240313

1 year ago

0.0.20240310

1 year ago

0.0.20240312

1 year ago

0.0.20240306

1 year ago

0.0.20240305

1 year ago

0.0.20240304

1 year ago

0.0.20240303

1 year ago

0.0.20240228

1 year ago

0.0.20240227

1 year ago

0.0.20240225

1 year ago

0.0.20240221

1 year ago

0.0.20240220

1 year ago

0.0.20240219

1 year ago

0.0.20240214

1 year ago

0.0.20240213

1 year ago

0.0.20240212

1 year ago

0.0.20240211

1 year ago

0.0.20240207

1 year ago

0.0.20240206

1 year ago

0.0.20240205

1 year ago

0.0.20240204

1 year ago

0.0.20240131

2 years ago

0.0.20240130

2 years ago

0.0.20240129

2 years ago

0.0.20240123

2 years ago

0.0.20240122

2 years ago

0.0.20240120

2 years ago

0.0.20240116

2 years ago

0.0.20240111

2 years ago

0.0.20240107

2 years ago

0.0.20231220

2 years ago

0.0.20231219

2 years ago

0.0.20231217

2 years ago

0.0.20231213

2 years ago

0.0.20231212

2 years ago

0.0.20231211

2 years ago

0.0.20231207

2 years ago

0.0.20231204

2 years ago

0.0.20231203

2 years ago

0.0.20230818

2 years ago

0.0.20230816

2 years ago

0.0.20231106

2 years ago

0.0.20231105

2 years ago

0.0.20230814

2 years ago

0.0.20230815

2 years ago

0.0.20231113

2 years ago

0.0.20231115

2 years ago

0.0.20230807

2 years ago

0.0.20230808

2 years ago

0.0.20230926

2 years ago

0.0.20230927

2 years ago

0.0.20230806

2 years ago

0.0.20230809

2 years ago

0.0.20230920

2 years ago

0.0.20230925

2 years ago

0.0.20230801

2 years ago

0.0.20230923

2 years ago

0.0.20231101

2 years ago

0.0.20230719

2 years ago

0.0.20230717

2 years ago

0.0.20230718

2 years ago

0.0.20231128

2 years ago

0.0.20230711

2 years ago

0.0.20230712

2 years ago

0.0.20231009

2 years ago

0.0.20230710

2 years ago

0.0.20230716

2 years ago

0.0.20231011

2 years ago

0.0.20231015

2 years ago

0.0.20230708

2 years ago

0.0.20230822

2 years ago

0.0.20230704

2 years ago

0.0.20230705

2 years ago

0.0.20230823

2 years ago

0.0.20231001

2 years ago

0.0.20231003

2 years ago

0.0.20231002

2 years ago

0.0.20231029

2 years ago

0.0.20230731

2 years ago

0.0.20231031

2 years ago

0.0.20231030

2 years ago

0.0.20231018

2 years ago

0.0.20231017

2 years ago

0.0.20230723

2 years ago

0.0.20230726

2 years ago

0.0.20230724

2 years ago

0.0.20230725

2 years ago

0.0.20231023

2 years ago

0.0.20231022

2 years ago

0.0.20231024

2 years ago

0.0.20230730

2 years ago

0.0.20230917

2 years ago

0.0.20230919

2 years ago

0.0.20230910

2 years ago

0.0.20230913

2 years ago

0.0.20230911

2 years ago

0.0.20230912

2 years ago

0.0.20230907

2 years ago

0.0.20230904

2 years ago

0.0.20230905

2 years ago

0.0.20230627

2 years ago

0.0.20230628

2 years ago

0.0.20230626

2 years ago

0.0.20230524

2 years ago

0.0.20230522

2 years ago

0.0.20230612

2 years ago

0.0.20230613

2 years ago

0.0.20230611

2 years ago

0.0.20230614

2 years ago

0.0.20230620

2 years ago

0.0.20230607

2 years ago

0.0.20230605

2 years ago

0.0.20230606

2 years ago

0.0.20230514

2 years ago

0.0.20230515

2 years ago

0.0.20230516

2 years ago

0.0.20230521

2 years ago

0.0.20230508

2 years ago

0.0.20230509

2 years ago

0.0.20230502

2 years ago

0.0.20230503

2 years ago

0.0.20230501

2 years ago

0.0.20230507

2 years ago

0.0.20230510

2 years ago

0.0.20230412

2 years ago

0.0.20230418

2 years ago

0.0.20230419

2 years ago

0.0.20230326

2 years ago

0.0.20230404

2 years ago

0.0.20230402

2 years ago

0.0.20230329

2 years ago

0.0.20230330

2 years ago

0.0.20230314

2 years ago

0.0.20230319

2 years ago

0.0.20230321

2 years ago

0.0.20230425

2 years ago

0.0.20230304

2 years ago

0.0.20230227

2 years ago

0.0.20230302

2 years ago

0.0.20230308

2 years ago

0.0.20230309

2 years ago

0.0.20230307

2 years ago

0.0.20230216

2 years ago

0.0.20230214

2 years ago

0.0.20230215

2 years ago

0.0.20230220

2 years ago

0.0.20230223

2 years ago

0.0.20230224

2 years ago

0.0.20230221

2 years ago

0.0.20230206

2 years ago

0.0.20230129

3 years ago

0.0.20230209

2 years ago

0.0.20230208

2 years ago

0.0.20230131

3 years ago

0.0.20230212

2 years ago

0.0.20230201

3 years ago

0.0.20230202

2 years ago

0.0.20221115

3 years ago

0.0.20221114

3 years ago

0.0.20221112

3 years ago

0.0.20230102

3 years ago

0.0.20221109

3 years ago

0.0.20230103

3 years ago

0.0.20221108

3 years ago

0.0.20221107

3 years ago

0.0.20221106

3 years ago

0.0.20230117

3 years ago

0.0.20221213

3 years ago

0.0.20230116

3 years ago

0.0.20230119

3 years ago

0.0.20230121

3 years ago

0.0.20221209

3 years ago

0.0.20230124

3 years ago

0.0.20221129

3 years ago

0.0.20230110

3 years ago

0.0.20221031

3 years ago

0.0.20221017

3 years ago

0.0.20221029

3 years ago

0.0.20221006

3 years ago

0.0.20221026

3 years ago

0.0.20221102

3 years ago

0.0.20221025

3 years ago

0.0.20221101

3 years ago

0.0.20221024

3 years ago

0.0.20221023

3 years ago

0.0.20221001

3 years ago

0.0.20221021

3 years ago

0.0.20220929

3 years ago

0.0.20221019

3 years ago

0.0.20221018

3 years ago

0.0.20220830

3 years ago

0.0.20220916

3 years ago

0.0.20220829

3 years ago

0.0.20220907

3 years ago

0.0.20220919

3 years ago

0.0.20220920

3 years ago

0.0.20220921

3 years ago

0.0.20220910

3 years ago

0.0.20220822

3 years ago

0.0.20220824

3 years ago

0.0.20220913

3 years ago

0.0.20220825

3 years ago

0.0.20220914

3 years ago

0.0.20220904

3 years ago

0.0.20220812

3 years ago

0.0.20220806

3 years ago