// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Cloud Commerce Partner Procurement API Client for Deno * ====================================================== * * Partner API for the Cloud Commerce Procurement Service. * * Docs: https://cloud.google.com/marketplace/docs/partners/ * Source: https://googleapis.deno.dev/v1/cloudcommerceprocurement:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Partner API for the Cloud Commerce Procurement Service. */ export class CloudCommerceProcurement { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://cloudcommerceprocurement.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Grants an approval on an Account. * * @param name Required. The resource name of the account, with the format `providers/{providerId}/accounts/{accountId}`. */ async providersAccountsApprove(name: string, req: ApproveAccountRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:approve`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Gets a requested Account resource. * * @param name Required. The name of the account to retrieve. */ async providersAccountsGet(name: string, opts: ProvidersAccountsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeAccount(data); } /** * Lists Accounts that the provider has access to. * * @param parent Required. The parent resource name. */ async providersAccountsList(parent: string, opts: ProvidersAccountsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/accounts`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListAccountsResponse(data); } /** * Rejects an approval on an Account. * * @param name Required. The resource name of the account. */ async providersAccountsReject(name: string, req: RejectAccountRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:reject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Resets an Account and cancels all associated Entitlements. Partner can * only reset accounts they own rather than customer accounts. * * @param name Required. The resource name of the account. */ async providersAccountsReset(name: string, req: ResetAccountRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:reset`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Approves an entitlement that is in the * EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is * invoked by the provider to approve the creation of the entitlement * resource. * * @param name Required. The resource name of the entitlement, with the format `providers/{providerId}/entitlements/{entitlementId}`. */ async providersEntitlementsApprove(name: string, req: ApproveEntitlementRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:approve`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Approves an entitlement plan change that is in the * EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This * method is invoked by the provider to approve the plan change on the * entitlement resource. * * @param name Required. The resource name of the entitlement. */ async providersEntitlementsApprovePlanChange(name: string, req: ApproveEntitlementPlanChangeRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:approvePlanChange`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Gets a requested Entitlement resource. * * @param name Required. The name of the entitlement to retrieve. */ async providersEntitlementsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeEntitlement(data); } /** * Lists Entitlements for which the provider has read access. * * @param parent Required. The parent resource name. */ async providersEntitlementsList(parent: string, opts: ProvidersEntitlementsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/entitlements`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListEntitlementsResponse(data); } /** * Updates an existing Entitlement. * * @param name Required. The name of the entitlement to update. */ async providersEntitlementsPatch(name: string, req: Entitlement, opts: ProvidersEntitlementsPatchOptions = {}): Promise { req = serializeEntitlement(req); opts = serializeProvidersEntitlementsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeEntitlement(data); } /** * Rejects an entitlement that is in the * EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is * invoked by the provider to reject the creation of the entitlement resource. * * @param name Required. The resource name of the entitlement. */ async providersEntitlementsReject(name: string, req: RejectEntitlementRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:reject`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Rejects an entitlement plan change that is in the * EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This * method is invoked by the provider to reject the plan change on the * entitlement resource. * * @param name Required. The resource name of the entitlement. */ async providersEntitlementsRejectPlanChange(name: string, req: RejectEntitlementPlanChangeRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:rejectPlanChange`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Requests suspension of an active Entitlement. This is not yet supported. * * @param name Required. The name of the entitlement to suspend. */ async providersEntitlementsSuspend(name: string, req: SuspendEntitlementRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:suspend`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } } /** * Represents an account that was established by the customer on the service * provider's system. */ export interface Account { /** * Output only. The approvals for this account. These approvals are used to * track actions that are permitted or have been completed by a customer * within the context of the provider. This might include a sign up flow or a * provisioning step, for example, that the provider can admit to having * happened. */ approvals?: Approval[]; /** * Output only. The creation timestamp. */ createTime?: Date; /** * Output only. The custom properties that were collected from the user to * create this account. */ inputProperties?: { [key: string]: any }; /** * Output only. The resource name of the account. Account names have the form * `accounts/{account_id}`. */ name?: string; /** * Output only. The identifier of the service provider that this account was * created against. Each service provider is assigned a unique provider value * when they onboard with Cloud Commerce platform. */ provider?: string; /** * Output only. The reseller parent billing account of the account's * corresponding billing account, applicable only when the corresponding * billing account is a subaccount of a reseller. Included in responses only * for view: ACCOUNT_VIEW_FULL. Format: billingAccounts/{billing_account_id} */ resellerParentBillingAccount?: string; /** * Output only. The state of the account. This is used to decide whether the * customer is in good standing with the provider and is able to make * purchases. An account might not be able to make a purchase if the billing * account is suspended, for example. */ state?: | "ACCOUNT_STATE_UNSPECIFIED" | "ACCOUNT_ACTIVATION_REQUESTED" | "ACCOUNT_ACTIVE"; /** * Output only. The last update timestamp. */ updateTime?: Date; } function serializeAccount(data: any): Account { return { ...data, approvals: data["approvals"] !== undefined ? data["approvals"].map((item: any) => (serializeApproval(item))) : undefined, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeAccount(data: any): Account { return { ...data, approvals: data["approvals"] !== undefined ? data["approvals"].map((item: any) => (deserializeApproval(item))) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * An approval for some action on an account. */ export interface Approval { /** * Output only. The name of the approval. */ name?: string; /** * Output only. An explanation for the state of the approval. */ reason?: string; /** * Output only. The state of the approval. */ state?: | "STATE_UNSPECIFIED" | "PENDING" | "APPROVED" | "REJECTED"; /** * Optional. The last update timestamp of the approval. */ updateTime?: Date; } function serializeApproval(data: any): Approval { return { ...data, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeApproval(data: any): Approval { return { ...data, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for PartnerProcurementService.ApproveAccount. */ export interface ApproveAccountRequest { /** * The name of the approval being approved. If absent and there is only one * approval possible, that approval will be granted. If absent and there are * many approvals possible, the request will fail with a 400 Bad Request. * Optional. */ approvalName?: string; /** * Set of properties that should be associated with the account. Optional. */ properties?: { [key: string]: string }; /** * Free form text string explaining the approval reason. Optional. Max * allowed length: 256 bytes. Longer strings will be truncated. */ reason?: string; } /** * Request message for * [PartnerProcurementService.ApproveEntitlementPlanChange[]. */ export interface ApproveEntitlementPlanChangeRequest { /** * Required. Name of the pending plan that's being approved. */ pendingPlanName?: string; } /** * Request message for [PartnerProcurementService.ApproveEntitlement[]. */ export interface ApproveEntitlementRequest { /** * Optional. The resource name of the entitlement that was migrated, with the * format `providers/{provider_id}/entitlements/{entitlement_id}`. Should only * be sent when resources have been migrated from entitlement_migrated to the * new entitlement. Optional. */ entitlementMigrated?: string; /** * Set of properties that should be associated with the entitlement. * Optional. */ properties?: { [key: string]: string }; } /** * A resource using (consuming) this entitlement. */ export interface Consumer { /** * A project name with format `projects/`. */ project?: string; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * Represents a procured product of a customer. */ export interface Entitlement { /** * Output only. The resource name of the account that this entitlement is * based on, if any. */ account?: string; /** * Output only. The reason the entitlement was cancelled. If this entitlement * wasn't cancelled, this field is empty. Possible values include "unknown", * "expired", "user-cancelled", "account-closed", "billing-disabled" (if the * customer has manually disabled billing to their resources), "user-aborted", * and "migrated" (if the entitlement has migrated across products). Values of * this field are subject to change, and we recommend that you don't build * your technical integration to rely on these fields. */ readonly cancellationReason?: string; /** * Output only. The resources using this entitlement, if applicable. */ consumers?: Consumer[]; /** * Output only. The creation timestamp. */ createTime?: Date; /** * Output only. The entitlement benefit IDs associated with the purchase. */ readonly entitlementBenefitIds?: string[]; /** * Output only. The custom properties that were collected from the user to * create this entitlement. */ inputProperties?: { [key: string]: any }; /** * Provider-supplied message that is displayed to the end user. Currently * this is used to communicate progress and ETA for provisioning. This field * can be updated only when a user is waiting for an action from the provider, * i.e. entitlement state is EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED * or EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL. This field is * cleared automatically when the entitlement state changes. */ messageToUser?: string; /** * Output only. The resource name of the entitlement. Entitlement names have * the form `providers/{provider_id}/entitlements/{entitlement_id}`. */ name?: string; /** * Output only. The end time of the new offer, determined from the offer's * specified end date. If the offer des not have a specified end date then * this field is not set. This field is populated even if the entitlement * isn't active yet. If there's no upcoming offer, the field is empty. * If * the entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, * ENTITLEMENT_ACTIVE, or ENTITLEMENT_PENDING_CANCELLATION, then this field is * empty. * If the entitlement is in the state * ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or * ENTITLEMENT_PENDING_PLAN_CHANGE, and the upcoming offer has a specified end * date, then this field is populated with the expected end time of the * upcoming offer, in the future. Otherwise, this field is empty. * If the * entitlement is in the state ENTITLEMENT_CANCELLED, then this field is * empty. */ readonly newOfferEndTime?: Date; /** * Output only. The timestamp when the new offer becomes effective. This * field is populated even if the entitlement isn't active yet. If there's no * upcoming offer, the field is empty. * If the entitlement is in the state * ENTITLEMENT_ACTIVATION_REQUESTED, this field isn't populated when the * entitlement isn't yet approved. After the entitlement is approved, this * field is populated with the effective time of the upcoming offer. * If the * entitlement is in the state ENTITLEMENT_ACTIVE or * ENTITLEMENT_PENDING_CANCELLATION, this field isn't populated. * If the * entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL, this * field isn't populated, because the entitlement change is waiting on * approval. * If the entitlement is in the state * ENTITLEMENT_PENDING_PLAN_CHANGE, this field is populated with the expected * effective time of the upcoming offer, which is in the future. * If the * entitlement is in the state ENTITLEMENT_CANCELLED, then this field is * empty. */ readonly newOfferStartTime?: Date; /** * Output only. Upon a pending plan change, the name of the offer that the * entitlement is switching to. Only exists if the pending plan change is * moving to an offer. This field isn't populated for entitlements which * aren't active yet. Format: * 'projects/{project}/services/{service}/privateOffers/{offer}' OR * 'projects/{project}/services/{service}/standardOffers/{offer}', depending * on whether the offer is private or public. The {service} in the name is the * listing service of the offer. It could be either the product service that * the offer is referencing, or a generic private offer parent service. We * recommend that you don't build your integration to rely on the meaning of * this {service} part. * If the entitlement is in the state * ENTITLEMENT_ACTIVATION_REQUESTED, ENTITLEMENT_ACTIVE or * ENTITLEMENT_PENDING_CANCELLATION, then this field is empty. * If the * entitlement is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or * ENTITLEMENT_PENDING_PLAN_CHANGE, then this field is populated with the * upcoming offer. * If the entitlement is in the state ENTITLEMENT_CANCELLED, * then this is empty. */ readonly newPendingOffer?: string; /** * Output only. The duration of the new offer, in ISO 8601 duration format. * This field is populated for pending offer changes. It isn't populated for * entitlements which aren't active yet. If the offer has a specified end date * instead of a duration, this field is empty. * If the entitlement is in the * state ENTITLEMENT_ACTIVATION_REQUESTED, ENTITLEMENT_ACTIVE, or * ENTITLEMENT_PENDING_CANCELLATION, this field is empty. * If the entitlement * is in the state ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or * ENTITLEMENT_PENDING_PLAN_CHANGE, and the upcoming offer doesn't have a * specified end date, then this field is populated with the duration of the * upcoming offer. Otherwise, this field is empty. * If the entitlement is in * the state ENTITLEMENT_CANCELLED, then this field is empty. */ readonly newPendingOfferDuration?: string; /** * Output only. The identifier of the pending new plan. Required if the * product has plans and the entitlement has a pending plan change. */ newPendingPlan?: string; /** * Output only. The name of the offer that was procured. Field is empty if * order wasn't made using an offer. Format: * 'projects/{project}/services/{service}/privateOffers/{offer}' OR * 'projects/{project}/services/{service}/standardOffers/{offer}', depending * on whether the offer is private or public. The {service} in the name is the * listing service of the offer. It could be either the product service that * the offer is referencing, or a generic private offer parent service. We * recommend that you don't build your integration to rely on the meaning of * this {service} part. * If the entitlement is in the state * ENTITLEMENT_ACTIVATION_REQUESTED, this field is populated with the upcoming * offer. * If the entitlement is in the state ENTITLEMENT_ACTIVE, * ENTITLEMENT_PENDING_CANCELLATION, ENTITLEMENT_PENDING_PLAN_CHANGE, or * ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL, this field is populated with the * current offer. * If the entitlement is in the state ENTITLEMENT_CANCELLED, * then this field is populated with the latest offer that the order was * associated with. */ readonly offer?: string; /** * Output only. The offer duration of the current offer, in ISO 8601 duration * format. This is empty if the entitlement wasn't made using an offer, or if * the offer has a specified end date instead of a duration. * If the * entitlement is in the state ENTITLEMENT_ACTIVATION_REQUESTED, and the * upcoming offer doesn't have a specified end date, then this field is * populated with the duration of the upcoming offer. Otherwise, this field is * empty. * If the entitlement is in the state ENTITLEMENT_ACTIVE, * ENTITLEMENT_PENDING_CANCELLATION, ENTITLEMENT_PENDING_PLAN_CHANGE, or * ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL, and the current offer doesn't * have a specified end date, then this field contains the duration of the * current offer. Otherwise, this field is empty. * If the entitlement is in * the state ENTITLEMENT_CANCELLED, and the offer doesn't have a specified end * date, then this field is populated with the duration of the latest offer * that the order was associated with. Otherwise, this field is empty. */ readonly offerDuration?: string; /** * Output only. End time for the current term of the Offer associated with * this entitlement. The value of this field can change naturally over time * due to auto-renewal, even if the offer isn't changed. * If the entitlement * is in the state ENTITLEMENT_ACTIVATION_REQUESTED, then: * If the * entitlement isn't approved yet approved, and the offer has a specified end * date, then this field is populated with the expected end time of the * upcoming offer, in the future. Otherwise, this field is empty. * If the * entitlement is approved, then this field is populated with the expected end * time of the upcoming offer, in the future. This means that this field and * the field offer_duration can both exist. * If the entitlement is in the * state ENTITLEMENT_ACTIVE or ENTITLEMENT_PENDING_CANCELLATION, then this * field is populated with the expected end time of the current offer, in the * future. This field's value is set regardless of whether the offer has a * specific end date or a duration. This means that this field and the field * offer_duration can both exist. * If the entitlement is in the state * ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL or * ENTITLEMENT_PENDING_PLAN_CHANGE: * If the entitlement's pricing model is * usage based and the associated offer is a private offer whose term has * ended, then this field reflects the ACTUAL end time of the entitlement's * associated offer (in the past), even though the entitlement associated with * this private offer does not terminate at the end of that private offer's * term. * Otherwise, this is the expected end date of the current offer, in * the future. * If the entitlement is in the state ENTITLEMENT_CANCELLED, * then this field is populated with the end time, in the past, of the latest * offer that the order was associated with. If the entitlement was cancelled * before any offer started, then this field is empty. */ readonly offerEndTime?: Date; /** * Output only. The order ID of this entitlement, without any `orders/` * resource name prefix. */ readonly orderId?: string; /** * Output only. The identifier of the plan that was procured. Required if the * product has plans. */ plan?: string; /** * Output only. The identifier of the entity that was purchased. This may * actually represent a product, quote, or offer. We strongly recommend that * you use the following more explicit fields: productExternalName, * quoteExternalName, or offer. */ product?: string; /** * Output only. The identifier of the product that was procured. */ readonly productExternalName?: string; /** * Output only. The identifier of the service provider that this entitlement * was created against. Each service provider is assigned a unique provider * value when they onboard with Cloud Commerce platform. */ provider?: string; /** * Output only. The identifier of the quote that was used to procure. Empty * if the order is not purchased using a quote. */ readonly quoteExternalName?: string; /** * Output only. The state of the entitlement. */ state?: | "ENTITLEMENT_STATE_UNSPECIFIED" | "ENTITLEMENT_ACTIVATION_REQUESTED" | "ENTITLEMENT_ACTIVE" | "ENTITLEMENT_PENDING_CANCELLATION" | "ENTITLEMENT_CANCELLED" | "ENTITLEMENT_PENDING_PLAN_CHANGE" | "ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL" | "ENTITLEMENT_SUSPENDED"; /** * Output only. End time for the subscription corresponding to this * entitlement. */ readonly subscriptionEndTime?: Date; /** * Output only. The last update timestamp. */ updateTime?: Date; /** * Output only. The consumerId to use when reporting usage through the * Service Control API. See the consumerId field at [Reporting * Metrics](https://cloud.google.com/service-control/reporting-metrics) for * more details. This field is present only if the product has usage-based * billing configured. */ usageReportingId?: string; } function serializeEntitlement(data: any): Entitlement { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeEntitlement(data: any): Entitlement { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, newOfferEndTime: data["newOfferEndTime"] !== undefined ? new Date(data["newOfferEndTime"]) : undefined, newOfferStartTime: data["newOfferStartTime"] !== undefined ? new Date(data["newOfferStartTime"]) : undefined, offerEndTime: data["offerEndTime"] !== undefined ? new Date(data["offerEndTime"]) : undefined, subscriptionEndTime: data["subscriptionEndTime"] !== undefined ? new Date(data["subscriptionEndTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Response message for [PartnerProcurementService.ListAccounts[]. */ export interface ListAccountsResponse { /** * The list of accounts in this response. */ accounts?: Account[]; /** * The token for fetching the next page. */ nextPageToken?: string; } function serializeListAccountsResponse(data: any): ListAccountsResponse { return { ...data, accounts: data["accounts"] !== undefined ? data["accounts"].map((item: any) => (serializeAccount(item))) : undefined, }; } function deserializeListAccountsResponse(data: any): ListAccountsResponse { return { ...data, accounts: data["accounts"] !== undefined ? data["accounts"].map((item: any) => (deserializeAccount(item))) : undefined, }; } /** * Response message for PartnerProcurementService.ListEntitlements. */ export interface ListEntitlementsResponse { /** * The list of entitlements in this response. */ entitlements?: Entitlement[]; /** * The token for fetching the next page. */ nextPageToken?: string; } function serializeListEntitlementsResponse(data: any): ListEntitlementsResponse { return { ...data, entitlements: data["entitlements"] !== undefined ? data["entitlements"].map((item: any) => (serializeEntitlement(item))) : undefined, }; } function deserializeListEntitlementsResponse(data: any): ListEntitlementsResponse { return { ...data, entitlements: data["entitlements"] !== undefined ? data["entitlements"].map((item: any) => (deserializeEntitlement(item))) : undefined, }; } /** * Additional options for CloudCommerceProcurement#providersAccountsGet. */ export interface ProvidersAccountsGetOptions { /** * Optional. What information to include in the response. */ view?: | "ACCOUNT_VIEW_UNSPECIFIED" | "ACCOUNT_VIEW_BASIC" | "ACCOUNT_VIEW_FULL"; } /** * Additional options for CloudCommerceProcurement#providersAccountsList. */ export interface ProvidersAccountsListOptions { /** * The maximum number of entries that are requested. The default page size is * 25 and the maximum page size is 200. */ pageSize?: number; /** * The token for fetching the next page. */ pageToken?: string; } /** * Additional options for CloudCommerceProcurement#providersEntitlementsList. */ export interface ProvidersEntitlementsListOptions { /** * The filter that can be used to limit the list request. The filter is a * query string that can match a selected set of attributes with string * values. For example `account=E-1234-5678-ABCD-EFGH`, * `state=pending_cancellation`, and `plan!=foo-plan`. Supported query * attributes are * `account` * `customer_billing_account` with value in the * format of: `billingAccounts/{id}` * `product_external_name` * * `quote_external_name` * `offer` * `new_pending_offer` * `plan` * * `newPendingPlan` or `new_pending_plan` * `state` * `services` * * `consumers.project` * `change_history.new_offer` Note that the consumers * and change_history.new_offer match works on repeated structures, so * equality (`consumers.project=projects/123456789`) is not supported. Set * membership can be expressed with the `:` operator. For example, * `consumers.project:projects/123456789` finds entitlements with at least one * consumer with project field equal to `projects/123456789`. * `change_history.new_offer` retrieves all entitlements that were once * associated or are currently active with the offer. Also note that the state * name match is case-insensitive and query can omit the prefix * "ENTITLEMENT_". For example, `state=active` is equivalent to * `state=ENTITLEMENT_ACTIVE`. If the query contains some special characters * other than letters, underscore, or digits, the phrase must be quoted with * double quotes. For example, `product="providerId:productId"`, where the * product name needs to be quoted because it contains special character * colon. Queries can be combined with `AND`, `OR`, and `NOT` to form more * complex queries. They can also be grouped to force a desired evaluation * order. For example, `state=active AND (account=E-1234 OR account=5678) AND * NOT (product=foo-product)`. Connective `AND` can be omitted between two * predicates. For example `account=E-1234 state=active` is equivalent to * `account=E-1234 AND state=active`. */ filter?: string; /** * The maximum number of entries that are requested. The default page size is * 200. */ pageSize?: number; /** * The token for fetching the next page. */ pageToken?: string; } /** * Additional options for CloudCommerceProcurement#providersEntitlementsPatch. */ export interface ProvidersEntitlementsPatchOptions { /** * The update mask that applies to the resource. See the [FieldMask * definition] * (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask) * for more details. */ updateMask?: string /* FieldMask */; } function serializeProvidersEntitlementsPatchOptions(data: any): ProvidersEntitlementsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProvidersEntitlementsPatchOptions(data: any): ProvidersEntitlementsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Request message for PartnerProcurementService.RejectAccount. */ export interface RejectAccountRequest { /** * The name of the approval being rejected. If absent and there is only one * approval possible, that approval will be rejected. If absent and there are * many approvals possible, the request will fail with a 400 Bad Request. * Optional. */ approvalName?: string; /** * Free form text string explaining the rejection reason. Max allowed length: * 256 bytes. Longer strings will be truncated. */ reason?: string; } /** * Request message for PartnerProcurementService.RejectEntitlementPlanChange. */ export interface RejectEntitlementPlanChangeRequest { /** * Required. Name of the pending plan that is being rejected. */ pendingPlanName?: string; /** * Free form text string explaining the rejection reason. Max allowed length: * 256 bytes. Longer strings will be truncated. */ reason?: string; } /** * Request message for PartnerProcurementService.RejectEntitlement. */ export interface RejectEntitlementRequest { /** * Free form text string explaining the rejection reason. Max allowed length: * 256 bytes. Longer strings will be truncated. */ reason?: string; } /** * Request message for PartnerProcurementService.ResetAccount. */ export interface ResetAccountRequest { } /** * Request message for ParterProcurementService.SuspendEntitlement. This is not * yet supported. */ export interface SuspendEntitlementRequest { /** * A free-form reason string, explaining the reason for suspension request. */ reason?: string; }