@google-shopping/quota 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ import * as v1beta from './v1beta';
2
+ declare const QuotaServiceClient: typeof v1beta.QuotaServiceClient;
3
+ type QuotaServiceClient = v1beta.QuotaServiceClient;
4
+ export { v1beta, QuotaServiceClient };
5
+ declare const _default: {
6
+ v1beta: typeof v1beta;
7
+ QuotaServiceClient: typeof v1beta.QuotaServiceClient;
8
+ };
9
+ export default _default;
10
+ import * as protos from '../protos/protos';
11
+ export { protos };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Copyright 2024 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // ** This file is automatically generated by synthtool. **
17
+ // ** https://github.com/googleapis/synthtool **
18
+ // ** All changes to this file may be overwritten. **
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.protos = exports.QuotaServiceClient = exports.v1beta = void 0;
21
+ const v1beta = require("./v1beta");
22
+ exports.v1beta = v1beta;
23
+ const QuotaServiceClient = v1beta.QuotaServiceClient;
24
+ exports.QuotaServiceClient = QuotaServiceClient;
25
+ exports.default = { v1beta, QuotaServiceClient };
26
+ const protos = require("../protos/protos");
27
+ exports.protos = protos;
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,2DAA2D;AAC3D,gDAAgD;AAChD,qDAAqD;;;AAErD,mCAAmC;AAK3B,wBAAM;AAHd,MAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAGrC,gDAAkB;AAClC,kBAAe,EAAC,MAAM,EAAE,kBAAkB,EAAC,CAAC;AAC5C,2CAA2C;AACnC,wBAAM"}
@@ -0,0 +1 @@
1
+ export { QuotaServiceClient } from './quota_service_client';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // Copyright 2024 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // ** This file is automatically generated by gapic-generator-typescript. **
17
+ // ** https://github.com/googleapis/gapic-generator-typescript **
18
+ // ** All changes to this file may be overwritten. **
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.QuotaServiceClient = void 0;
21
+ var quota_service_client_1 = require("./quota_service_client");
22
+ Object.defineProperty(exports, "QuotaServiceClient", { enumerable: true, get: function () { return quota_service_client_1.QuotaServiceClient; } });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1beta/index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,4EAA4E;AAC5E,iEAAiE;AACjE,qDAAqD;;;AAErD,+DAA0D;AAAlD,0HAAA,kBAAkB,OAAA"}
@@ -0,0 +1,251 @@
1
+ /// <reference types="node" />
2
+ import type * as gax from 'google-gax';
3
+ import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
4
+ import { Transform } from 'stream';
5
+ import * as protos from '../../protos/protos';
6
+ /**
7
+ * Service to get method call quota information per Merchant API method.
8
+ * @class
9
+ * @memberof v1beta
10
+ */
11
+ export declare class QuotaServiceClient {
12
+ private _terminated;
13
+ private _opts;
14
+ private _providedCustomServicePath;
15
+ private _gaxModule;
16
+ private _gaxGrpc;
17
+ private _protos;
18
+ private _defaults;
19
+ private _universeDomain;
20
+ private _servicePath;
21
+ auth: gax.GoogleAuth;
22
+ descriptors: Descriptors;
23
+ warn: (code: string, message: string, warnType?: string) => void;
24
+ innerApiCalls: {
25
+ [name: string]: Function;
26
+ };
27
+ pathTemplates: {
28
+ [name: string]: gax.PathTemplate;
29
+ };
30
+ quotaServiceStub?: Promise<{
31
+ [name: string]: Function;
32
+ }>;
33
+ /**
34
+ * Construct an instance of QuotaServiceClient.
35
+ *
36
+ * @param {object} [options] - The configuration object.
37
+ * The options accepted by the constructor are described in detail
38
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
39
+ * The common options are:
40
+ * @param {object} [options.credentials] - Credentials object.
41
+ * @param {string} [options.credentials.client_email]
42
+ * @param {string} [options.credentials.private_key]
43
+ * @param {string} [options.email] - Account email address. Required when
44
+ * using a .pem or .p12 keyFilename.
45
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
46
+ * .p12 key downloaded from the Google Developers Console. If you provide
47
+ * a path to a JSON file, the projectId option below is not necessary.
48
+ * NOTE: .pem and .p12 require you to specify options.email as well.
49
+ * @param {number} [options.port] - The port on which to connect to
50
+ * the remote host.
51
+ * @param {string} [options.projectId] - The project ID from the Google
52
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
53
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
54
+ * app is running in an environment which supports
55
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
56
+ * your project ID will be detected automatically.
57
+ * @param {string} [options.apiEndpoint] - The domain name of the
58
+ * API remote host.
59
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
60
+ * Follows the structure of {@link gapicConfig}.
61
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
62
+ * For more information, please check the
63
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
64
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
65
+ * need to avoid loading the default gRPC version and want to use the fallback
66
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
67
+ * ```
68
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
69
+ * const client = new QuotaServiceClient({fallback: true}, gax);
70
+ * ```
71
+ */
72
+ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
73
+ /**
74
+ * Initialize the client.
75
+ * Performs asynchronous operations (such as authentication) and prepares the client.
76
+ * This function will be called automatically when any class method is called for the
77
+ * first time, but if you need to initialize it before calling an actual method,
78
+ * feel free to call initialize() directly.
79
+ *
80
+ * You can await on this method if you want to make sure the client is initialized.
81
+ *
82
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
83
+ */
84
+ initialize(): Promise<{
85
+ [name: string]: Function;
86
+ }>;
87
+ /**
88
+ * The DNS address for this API service.
89
+ * @deprecated Use the apiEndpoint method of the client instance.
90
+ * @returns {string} The DNS address for this service.
91
+ */
92
+ static get servicePath(): string;
93
+ /**
94
+ * The DNS address for this API service - same as servicePath.
95
+ * @deprecated Use the apiEndpoint method of the client instance.
96
+ * @returns {string} The DNS address for this service.
97
+ */
98
+ static get apiEndpoint(): string;
99
+ /**
100
+ * The DNS address for this API service.
101
+ * @returns {string} The DNS address for this service.
102
+ */
103
+ get apiEndpoint(): string;
104
+ get universeDomain(): string;
105
+ /**
106
+ * The port for this API service.
107
+ * @returns {number} The default port for this service.
108
+ */
109
+ static get port(): number;
110
+ /**
111
+ * The scopes needed to make gRPC calls for every method defined
112
+ * in this service.
113
+ * @returns {string[]} List of default scopes.
114
+ */
115
+ static get scopes(): string[];
116
+ getProjectId(): Promise<string>;
117
+ getProjectId(callback: Callback<string, undefined, undefined>): void;
118
+ /**
119
+ * Lists the daily call quota and usage per group for your Merchant
120
+ * Center account.
121
+ *
122
+ * @param {Object} request
123
+ * The request object that will be sent.
124
+ * @param {string} request.parent
125
+ * Required. The merchant account who owns the collection of method quotas
126
+ * Format: accounts/{account}
127
+ * @param {number} [request.pageSize]
128
+ * Optional. The maximum number of quotas to return in the response, used
129
+ * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
130
+ * @param {string} [request.pageToken]
131
+ * Optional. Token (if provided) to retrieve the subsequent page. All other
132
+ * parameters must match the original call that provided the page token.
133
+ * @param {object} [options]
134
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
135
+ * @returns {Promise} - The promise which resolves to an array.
136
+ * The first element of the array is Array of {@link protos.google.shopping.merchant.quota.v1beta.QuotaGroup|QuotaGroup}.
137
+ * The client library will perform auto-pagination by default: it will call the API as many
138
+ * times as needed and will merge results from all the pages into this array.
139
+ * Note that it can affect your quota.
140
+ * We recommend using `listQuotaGroupsAsync()`
141
+ * method described below for async iteration which you can stop as needed.
142
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
143
+ * for more details and examples.
144
+ */
145
+ listQuotaGroups(request?: protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest, options?: CallOptions): Promise<[
146
+ protos.google.shopping.merchant.quota.v1beta.IQuotaGroup[],
147
+ protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest | null,
148
+ protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsResponse
149
+ ]>;
150
+ listQuotaGroups(request: protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest, options: CallOptions, callback: PaginationCallback<protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest, protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsResponse | null | undefined, protos.google.shopping.merchant.quota.v1beta.IQuotaGroup>): void;
151
+ listQuotaGroups(request: protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest, callback: PaginationCallback<protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest, protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsResponse | null | undefined, protos.google.shopping.merchant.quota.v1beta.IQuotaGroup>): void;
152
+ /**
153
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
154
+ * @param {Object} request
155
+ * The request object that will be sent.
156
+ * @param {string} request.parent
157
+ * Required. The merchant account who owns the collection of method quotas
158
+ * Format: accounts/{account}
159
+ * @param {number} [request.pageSize]
160
+ * Optional. The maximum number of quotas to return in the response, used
161
+ * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
162
+ * @param {string} [request.pageToken]
163
+ * Optional. Token (if provided) to retrieve the subsequent page. All other
164
+ * parameters must match the original call that provided the page token.
165
+ * @param {object} [options]
166
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
167
+ * @returns {Stream}
168
+ * An object stream which emits an object representing {@link protos.google.shopping.merchant.quota.v1beta.QuotaGroup|QuotaGroup} on 'data' event.
169
+ * The client library will perform auto-pagination by default: it will call the API as many
170
+ * times as needed. Note that it can affect your quota.
171
+ * We recommend using `listQuotaGroupsAsync()`
172
+ * method described below for async iteration which you can stop as needed.
173
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
174
+ * for more details and examples.
175
+ */
176
+ listQuotaGroupsStream(request?: protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest, options?: CallOptions): Transform;
177
+ /**
178
+ * Equivalent to `listQuotaGroups`, but returns an iterable object.
179
+ *
180
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
181
+ * @param {Object} request
182
+ * The request object that will be sent.
183
+ * @param {string} request.parent
184
+ * Required. The merchant account who owns the collection of method quotas
185
+ * Format: accounts/{account}
186
+ * @param {number} [request.pageSize]
187
+ * Optional. The maximum number of quotas to return in the response, used
188
+ * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
189
+ * @param {string} [request.pageToken]
190
+ * Optional. Token (if provided) to retrieve the subsequent page. All other
191
+ * parameters must match the original call that provided the page token.
192
+ * @param {object} [options]
193
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
194
+ * @returns {Object}
195
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
196
+ * When you iterate the returned iterable, each element will be an object representing
197
+ * {@link protos.google.shopping.merchant.quota.v1beta.QuotaGroup|QuotaGroup}. The API will be called under the hood as needed, once per the page,
198
+ * so you can stop the iteration when you don't need more results.
199
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
200
+ * for more details and examples.
201
+ * @example <caption>include:samples/generated/v1beta/quota_service.list_quota_groups.js</caption>
202
+ * region_tag:merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_async
203
+ */
204
+ listQuotaGroupsAsync(request?: protos.google.shopping.merchant.quota.v1beta.IListQuotaGroupsRequest, options?: CallOptions): AsyncIterable<protos.google.shopping.merchant.quota.v1beta.IQuotaGroup>;
205
+ /**
206
+ * Return a fully-qualified account resource name string.
207
+ *
208
+ * @param {string} account
209
+ * @returns {string} Resource name string.
210
+ */
211
+ accountPath(account: string): string;
212
+ /**
213
+ * Parse the account from Account resource.
214
+ *
215
+ * @param {string} accountName
216
+ * A fully-qualified path representing Account resource.
217
+ * @returns {string} A string representing the account.
218
+ */
219
+ matchAccountFromAccountName(accountName: string): string | number;
220
+ /**
221
+ * Return a fully-qualified quotaGroup resource name string.
222
+ *
223
+ * @param {string} account
224
+ * @param {string} group
225
+ * @returns {string} Resource name string.
226
+ */
227
+ quotaGroupPath(account: string, group: string): string;
228
+ /**
229
+ * Parse the account from QuotaGroup resource.
230
+ *
231
+ * @param {string} quotaGroupName
232
+ * A fully-qualified path representing QuotaGroup resource.
233
+ * @returns {string} A string representing the account.
234
+ */
235
+ matchAccountFromQuotaGroupName(quotaGroupName: string): string | number;
236
+ /**
237
+ * Parse the group from QuotaGroup resource.
238
+ *
239
+ * @param {string} quotaGroupName
240
+ * A fully-qualified path representing QuotaGroup resource.
241
+ * @returns {string} A string representing the group.
242
+ */
243
+ matchGroupFromQuotaGroupName(quotaGroupName: string): string | number;
244
+ /**
245
+ * Terminate the gRPC channel and close the client.
246
+ *
247
+ * The client will no longer be usable and all future behavior is undefined.
248
+ * @returns {Promise} A promise that resolves when the client is closed.
249
+ */
250
+ close(): Promise<void>;
251
+ }