1.0.20220811 • Published 2 years ago

@maxim_mazurok/gapi.client.cloudchannel v1.0.20220811

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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('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',
    ],
    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 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: 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`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
*/
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({  });
1.0.20220618

2 years ago

1.0.20220612

2 years ago

1.0.20220622

2 years ago

1.0.20220625

2 years ago

1.0.20220630

2 years ago

1.0.20220806

2 years ago

1.0.20220803

2 years ago

1.0.20220811

2 years ago

1.0.20220706

2 years ago

1.0.20220708

2 years ago

1.0.20220715

2 years ago

1.0.20220720

2 years ago

1.0.20220728

2 years ago

1.0.20220725

2 years ago

1.0.20220730

2 years ago

1.0.20220506

2 years ago

1.0.20220429

2 years ago

1.0.20220505

2 years ago

1.0.20220511

2 years ago

1.0.20220518

2 years ago

1.0.20220513

2 years ago

1.0.20220522

2 years ago

1.0.20220604

2 years ago

1.0.20220609

2 years ago

1.0.20220415

2 years ago

1.0.20220422

2 years ago

1.0.20220319

2 years ago

1.0.20220324

2 years ago

1.0.20220402

2 years ago

1.0.20220409

2 years ago

1.0.20220407

2 years ago

1.0.20220326

2 years ago

1.0.20220413

2 years ago

1.0.20220303

2 years ago

1.0.20220307

2 years ago

1.0.20220228

2 years ago

1.0.20220312

2 years ago

1.0.20220310

2 years ago

1.0.20220317

2 years ago

1.0.20220218

2 years ago

1.0.20220217

2 years ago

1.0.20220105

2 years ago

1.0.20220224

2 years ago

1.0.20220107

2 years ago

1.0.20220116

2 years ago

1.0.20220112

2 years ago

1.0.20220119

2 years ago

1.0.20220203

2 years ago

1.0.20220122

2 years ago

1.0.20220209

2 years ago

1.0.20220205

2 years ago

1.0.20220129

2 years ago

1.0.20220212

2 years ago

1.0.20211110

3 years ago

1.0.20211116

3 years ago

1.0.20211112

3 years ago

1.0.20211203

2 years ago

1.0.20211202

2 years ago

1.0.20211211

2 years ago

1.0.20211209

2 years ago

1.0.20211105

3 years ago

1.0.20211104

3 years ago

1.0.20211029

3 years ago

1.0.20211022

3 years ago

1.0.20211018

3 years ago

1.0.20211006

3 years ago

1.0.20211001

3 years ago

1.0.20210924

3 years ago

1.0.20210922

3 years ago

1.0.20210918

3 years ago

1.0.20210916

3 years ago

1.0.20210910

3 years ago

1.0.20210909

3 years ago

1.0.20210903

3 years ago

1.0.20210831

3 years ago

1.0.20210901

3 years ago

1.0.20210827

3 years ago

1.0.20210825

3 years ago

1.0.20210822

3 years ago

1.0.20210818

3 years ago

1.0.20210813

3 years ago

1.0.20210812

3 years ago

1.0.20210809

3 years ago

1.0.20210805

3 years ago

1.0.20210731

3 years ago

1.0.20210728

3 years ago

1.0.20210723

3 years ago

1.0.20210721

3 years ago

1.0.20210717

3 years ago

1.0.20210714

3 years ago

1.0.20210709

3 years ago

1.0.20210707

3 years ago

1.0.20210629

3 years ago

1.0.20210625

3 years ago

1.0.20210624

3 years ago

1.0.20210618

3 years ago

1.0.20210616

3 years ago

1.0.20210613

3 years ago

1.0.20210604

3 years ago

1.0.20210602

3 years ago

1.0.20210528

3 years ago

1.0.20210522

3 years ago

1.0.20210514

3 years ago

1.0.20210513

3 years ago

1.0.20210508

3 years ago

1.0.20210506

3 years ago

1.0.20210501

3 years ago

1.0.20210429

3 years ago

1.0.20210423

3 years ago