0.0.20240515 • Published 5 days ago

@maxim_mazurok/gapi.client.cloudchannel-v1 v0.0.20240515

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

TypeScript typings for Cloud Channel API v1

The Cloud Channel API enables Google Cloud partners to have a single unified resale platform and APIs across all of Google Cloud including GCP, Workspace, Maps and Chrome. For detailed description please check documentation.

Installing

Install typings for Cloud Channel API:

npm install @types/gapi.client.cloudchannel-v1 --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://cloudchannel.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.cloudchannel
  }
);
// 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('cloudchannel', 'v1', () => {
  // now we can use:
  // gapi.client.cloudchannel
});

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 = [
    // Manage users on your domain
    'https://www.googleapis.com/auth/apps.order',

    // View usage reports for your G Suite domain
    'https://www.googleapis.com/auth/apps.reports.usage.readonly',
  ],
  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 Cloud Channel API resources:

/*
Confirms the existence of Cloud Identity accounts based on the domain and if the Cloud Identity accounts are owned by the reseller. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * INVALID_VALUE: Invalid domain value in the request. Return value: A list of CloudIdentityCustomerAccount resources for the domain (may be empty) Note: in the v1alpha1 version of the API, a NOT_FOUND error returns if no CloudIdentityCustomerAccount resources match the domain.
*/
await gapi.client.cloudchannel.accounts.checkCloudIdentityAccountsExist({
  parent: 'parent',
});

/*
Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The topic resource doesn't exist. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: A list of service email addresses.
*/
await gapi.client.cloudchannel.accounts.listSubscribers({account: 'account'});

/*
List TransferableOffers of a customer based on Cloud Identity ID or Customer Name in the request. Use this method when a reseller gets the entitlement information of an unowned customer. The reseller should provide the customer's Cloud Identity ID or Customer Name. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The customer provided incorrect reseller information when generating auth token. * The reseller account making the request is different from the reseller account in the query. * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: List of TransferableOffer for the given customer and SKU.
*/
await gapi.client.cloudchannel.accounts.listTransferableOffers({
  parent: 'parent',
});

/*
List TransferableSkus of a customer based on the Cloud Identity ID or Customer Name in the request. Use this method to list the entitlements information of an unowned customer. You should provide the customer's Cloud Identity ID or Customer Name. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The supplied auth token is invalid. * The reseller account making the request is different from the reseller account in the query. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: A list of the customer's TransferableSku.
*/
await gapi.client.cloudchannel.accounts.listTransferableSkus({
  parent: 'parent',
});

/*
Registers a service account with subscriber privileges on the Cloud Pub/Sub topic for this Channel Services account. After you create a subscriber, you get the events through SubscriberEvent Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The topic name with the registered service email address.
*/
await gapi.client.cloudchannel.accounts.register({account: 'account'});

/*
Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. If there are no service accounts left with subscriber privileges, this deletes the topic. You can call ListSubscribers to check for these accounts. Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The topic resource doesn't exist. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The topic name that unregistered the service email address. Returns a success response if the service email address wasn't registered with the topic.
*/
await gapi.client.cloudchannel.accounts.unregister({account: 'account'});

/*
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`.
*/
await gapi.client.cloudchannel.operations.cancel({name: 'name'});

/*
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`.
*/
await gapi.client.cloudchannel.operations.delete({name: 'name'});

/*
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.
*/
await gapi.client.cloudchannel.operations.get({name: 'name'});

/*
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
*/
await gapi.client.cloudchannel.operations.list({name: 'name'});

/*
Lists the Products the reseller is authorized to sell. Possible error codes: * INVALID_ARGUMENT: Required request parameters are missing or invalid.
*/
await gapi.client.cloudchannel.products.list({});
0.0.20240515

5 days ago

0.0.20240514

6 days ago

0.0.20240513

7 days ago

0.0.20240512

8 days ago

0.0.20240508

12 days ago

0.0.20240507

14 days ago

0.0.20240505

15 days ago

0.0.20240501

19 days ago

0.0.20240430

20 days ago

0.0.20240429

21 days ago

0.0.20240427

22 days ago

0.0.20240424

26 days ago

0.0.20240423

27 days ago

0.0.20240422

28 days ago

0.0.20240420

29 days ago

0.0.20240417

1 month ago

0.0.20240416

1 month ago

0.0.20240414

1 month ago

0.0.20240403

2 months ago

0.0.20240402

2 months ago

0.0.20240401

2 months ago

0.0.20240331

2 months ago

0.0.20240327

2 months ago

0.0.20240326

2 months ago

0.0.20240324

2 months ago

0.0.20240319

2 months ago

0.0.20240318

2 months ago

0.0.20240317

2 months ago

0.0.20240313

2 months ago

0.0.20240310

2 months ago

0.0.20240312

2 months ago

0.0.20240306

2 months ago

0.0.20240305

3 months ago

0.0.20240304

3 months ago

0.0.20240303

3 months ago

0.0.20240228

3 months ago

0.0.20240226

3 months ago

0.0.20240227

3 months ago

0.0.20240225

3 months ago

0.0.20240220

3 months ago

0.0.20240221

3 months ago

0.0.20240219

3 months ago

0.0.20240213

3 months ago

0.0.20240211

3 months ago

0.0.20240207

3 months ago

0.0.20240205

3 months ago

0.0.20240204

4 months ago

0.0.20240130

4 months ago

0.0.20240131

4 months ago

0.0.20240129

4 months ago

0.0.20240128

4 months ago

0.0.20240126

4 months ago

0.0.20240110

4 months ago

0.0.20240109

4 months ago

0.0.20240103

5 months ago

0.0.20240101

5 months ago

0.0.20240102

5 months ago

0.0.20231220

5 months ago

0.0.20231217

5 months ago

0.0.20231213

5 months ago

0.0.20231212

5 months ago

0.0.20231210

5 months ago

0.0.20231205

6 months ago

0.0.20231204

6 months ago

0.0.20231203

6 months ago

0.0.20231128

6 months ago

0.0.20230816

9 months ago

0.0.20231106

7 months ago

0.0.20231105

7 months ago

0.0.20231108

6 months ago

0.0.20231107

6 months ago

0.0.20230812

9 months ago

0.0.20231113

6 months ago

0.0.20231112

6 months ago

0.0.20231115

6 months ago

0.0.20231114

6 months ago

0.0.20230807

10 months ago

0.0.20230808

10 months ago

0.0.20230926

8 months ago

0.0.20230927

8 months ago

0.0.20230806

10 months ago

0.0.20230809

9 months ago

0.0.20230920

8 months ago

0.0.20230924

8 months ago

0.0.20230801

10 months ago

0.0.20231101

7 months ago

0.0.20230717

10 months ago

0.0.20230718

10 months ago

0.0.20230711

10 months ago

0.0.20230712

10 months ago

0.0.20231009

7 months ago

0.0.20231008

7 months ago

0.0.20230710

10 months ago

0.0.20230716

10 months ago

0.0.20231011

7 months ago

0.0.20230708

11 months ago

0.0.20230822

9 months ago

0.0.20230820

9 months ago

0.0.20230704

11 months ago

0.0.20230705

11 months ago

0.0.20230823

9 months ago

0.0.20231001

8 months ago

0.0.20231003

8 months ago

0.0.20231002

8 months ago

0.0.20231004

8 months ago

0.0.20231029

7 months ago

0.0.20230731

10 months ago

0.0.20231031

7 months ago

0.0.20231030

7 months ago

0.0.20230729

10 months ago

0.0.20231017

7 months ago

0.0.20230723

10 months ago

0.0.20230726

10 months ago

0.0.20230724

10 months ago

0.0.20230725

10 months ago

0.0.20231023

7 months ago

0.0.20231022

7 months ago

0.0.20231025

7 months ago

0.0.20231024

7 months ago

0.0.20230627

11 months ago

0.0.20230628

11 months ago

0.0.20230917

8 months ago

0.0.20230918

8 months ago

0.0.20230910

8 months ago

0.0.20230913

8 months ago

0.0.20230911

8 months ago

0.0.20230912

8 months ago

0.0.20230906

9 months ago

0.0.20230904

9 months ago

0.0.20230905

9 months ago

0.0.20230625

11 months ago

0.0.20230626

11 months ago

0.0.20230524

12 months ago

0.0.20230522

12 months ago

0.0.20230523

12 months ago

0.0.20230529

12 months ago

0.0.20230531

12 months ago

0.0.20230530

12 months ago

0.0.20230429

1 year ago

0.0.20230619

11 months ago

0.0.20230612

11 months ago

0.0.20230613

11 months ago

0.0.20230611

11 months ago

0.0.20230614

11 months ago

0.0.20230620

11 months ago

0.0.20230607

12 months ago

0.0.20230605

12 months ago

0.0.20230606

12 months ago

0.0.20230603

12 months ago

0.0.20230514

1 year ago

0.0.20230517

1 year ago

0.0.20230515

1 year ago

0.0.20230516

1 year ago

0.0.20230521

12 months ago

0.0.20230508

1 year ago

0.0.20230509

1 year ago

0.0.20230502

1 year ago

0.0.20230503

1 year ago

0.0.20230621

11 months ago

0.0.20230501

1 year ago

0.0.20230507

1 year ago

0.0.20230510

1 year ago

0.0.20230415

1 year ago

0.0.20230412

1 year ago

0.0.20230418

1 year ago

0.0.20230419

1 year ago

0.0.20230417

1 year ago

0.0.20230301

1 year ago

0.0.20230403

1 year ago

0.0.20230404

1 year ago

0.0.20230402

1 year ago

0.0.20230408

1 year ago

0.0.20230405

1 year ago

0.0.20230410

1 year ago

0.0.20230315

1 year ago

0.0.20230313

1 year ago

0.0.20230314

1 year ago

0.0.20230319

1 year ago

0.0.20230322

1 year ago

0.0.20230320

1 year ago

0.0.20230321

1 year ago

0.0.20230304

1 year ago

0.0.20230426

1 year ago

0.0.20230424

1 year ago

0.0.20230308

1 year ago

0.0.20230309

1 year ago

0.0.20230306

1 year ago

0.0.20230326

1 year ago

0.0.20230327

1 year ago

0.0.20230328

1 year ago

0.0.20230329

1 year ago

0.0.20230228

1 year ago

0.0.20230226

1 year ago

0.0.20230214

1 year ago

0.0.20230215

1 year ago

0.0.20230220

1 year ago

0.0.20230221

1 year ago

0.0.20230222

1 year ago

0.0.20230205

1 year ago

0.0.20230206

1 year ago

0.0.20230129

1 year ago

0.0.20230207

1 year ago

0.0.20230208

1 year ago

0.0.20230131

1 year ago

0.0.20230130

1 year ago

0.0.20230212

1 year ago

0.0.20230213

1 year ago

0.0.20230201

1 year ago

0.0.20221115

2 years ago

0.0.20221114

2 years ago

0.0.20221112

2 years ago

0.0.20230102

1 year ago

0.0.20221109

2 years ago

0.0.20230103

1 year ago

0.0.20221108

2 years ago

0.0.20221107

2 years ago

0.0.20221106

2 years ago

0.0.20221221

1 year ago

0.0.20221220

1 year ago

0.0.20221219

1 year ago

0.0.20230117

1 year ago

0.0.20230118

1 year ago

0.0.20230116

1 year ago

0.0.20221212

1 year ago

0.0.20221210

1 year ago

0.0.20230124

1 year ago

0.0.20221207

1 year ago

0.0.20230122

1 year ago

0.0.20221206

1 year ago

0.0.20221129

1 year ago

0.0.20230123

1 year ago

0.0.20221204

1 year ago

0.0.20230107

1 year ago

0.0.20230104

1 year ago

0.0.20230110

1 year ago

0.0.20230111

1 year ago

0.0.20221031

2 years ago

0.0.20221027

2 years ago

0.0.20221016

2 years ago

0.0.20221005

2 years ago

0.0.20221101

2 years ago

0.0.20221023

2 years ago

0.0.20221001

2 years ago

0.0.20221019

2 years ago

0.0.20220926

2 years ago

0.0.20220916

2 years ago

0.0.20220907

2 years ago

0.0.20220819

2 years ago

0.0.20220831

2 years ago

0.0.20220921

2 years ago

0.0.20220910

2 years ago

0.0.20220824

2 years ago

0.0.20220914

2 years ago

0.0.20220826

2 years ago

0.0.20220815

2 years ago

0.0.20220812

2 years ago

0.0.20220811

2 years ago