googleapis
Version:
Google APIs Client Library for Node.js
1,064 lines • 73 kB
TypeScript
/// <reference types="node" />
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace pubsublite_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Pub/Sub Lite API
*
*
*
* @example
* ```js
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
* ```
*/
export class Pubsublite {
context: APIRequestContext;
admin: Resource$Admin;
cursor: Resource$Cursor;
topicStats: Resource$Topicstats;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* The throughput capacity configuration for each partition.
*/
export interface Schema$Capacity {
/**
* Publish throughput capacity per partition in MiB/s. Must be \>= 4 and <= 16.
*/
publishMibPerSec?: number | null;
/**
* Subscribe throughput capacity per partition in MiB/s. Must be \>= 4 and <= 32.
*/
subscribeMibPerSec?: number | null;
}
/**
* Compute the current head cursor for a partition.
*/
export interface Schema$ComputeHeadCursorRequest {
/**
* Required. The partition for which we should compute the head cursor.
*/
partition?: string | null;
}
/**
* Response containing the head cursor for the requested topic and partition.
*/
export interface Schema$ComputeHeadCursorResponse {
/**
* The head cursor.
*/
headCursor?: Schema$Cursor;
}
/**
* Compute statistics about a range of messages in a given topic and partition.
*/
export interface Schema$ComputeMessageStatsRequest {
/**
* The exclusive end of the range. The range is empty if end_cursor <= start_cursor. Specifying a start_cursor before the first message and an end_cursor after the last message will retrieve all messages.
*/
endCursor?: Schema$Cursor;
/**
* Required. The partition for which we should compute message stats.
*/
partition?: string | null;
/**
* The inclusive start of the range.
*/
startCursor?: Schema$Cursor;
}
/**
* Response containing stats for messages in the requested topic and partition.
*/
export interface Schema$ComputeMessageStatsResponse {
/**
* The number of quota bytes accounted to these messages.
*/
messageBytes?: string | null;
/**
* The count of messages.
*/
messageCount?: string | null;
/**
* The minimum event timestamp across these messages. For the purposes of this computation, if a message does not have an event time, we use the publish time. The timestamp will be unset if there are no messages.
*/
minimumEventTime?: string | null;
/**
* The minimum publish timestamp across these messages. Note that publish timestamps within a partition are not guaranteed to be non-decreasing. The timestamp will be unset if there are no messages.
*/
minimumPublishTime?: string | null;
}
/**
* A cursor that describes the position of a message within a topic partition.
*/
export interface Schema$Cursor {
/**
* The offset of a message within a topic partition. Must be greater than or equal 0.
*/
offset?: string | null;
}
/**
* The settings for a subscription's message delivery.
*/
export interface Schema$DeliveryConfig {
/**
* The DeliveryRequirement for this subscription.
*/
deliveryRequirement?: string | null;
}
/**
* 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); \} The JSON representation for `Empty` is empty JSON object `{\}`.
*/
export interface Schema$Empty {
}
/**
* Response for ListPartitionCursors
*/
export interface Schema$ListPartitionCursorsResponse {
/**
* A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
*/
nextPageToken?: string | null;
/**
* The partition cursors from this request.
*/
partitionCursors?: Schema$PartitionCursor[];
}
/**
* Response for ListSubscriptions.
*/
export interface Schema$ListSubscriptionsResponse {
/**
* A token that can be sent as `page_token` to retrieve the next page of results. If this field is omitted, there are no more results.
*/
nextPageToken?: string | null;
/**
* The list of subscriptions in the requested parent. The order of the subscriptions is unspecified.
*/
subscriptions?: Schema$Subscription[];
}
/**
* Response for ListTopics.
*/
export interface Schema$ListTopicsResponse {
/**
* A token that can be sent as `page_token` to retrieve the next page of results. If this field is omitted, there are no more results.
*/
nextPageToken?: string | null;
/**
* The list of topic in the requested parent. The order of the topics is unspecified.
*/
topics?: Schema$Topic[];
}
/**
* Response for ListTopicSubscriptions.
*/
export interface Schema$ListTopicSubscriptionsResponse {
/**
* A token that can be sent as `page_token` to retrieve the next page of results. If this field is omitted, there are no more results.
*/
nextPageToken?: string | null;
/**
* The names of subscriptions attached to the topic. The order of the subscriptions is unspecified.
*/
subscriptions?: string[] | null;
}
/**
* The settings for a topic's partitions.
*/
export interface Schema$PartitionConfig {
/**
* The capacity configuration.
*/
capacity?: Schema$Capacity;
/**
* The number of partitions in the topic. Must be at least 1. Once a topic has been created the number of partitions can be increased but not decreased. Message ordering is not guaranteed across a topic resize. For more information see https://cloud.google.com/pubsub/lite/docs/topics#scaling_capacity
*/
count?: string | null;
/**
* DEPRECATED: Use capacity instead which can express a superset of configurations. Every partition in the topic is allocated throughput equivalent to `scale` times the standard partition throughput (4 MiB/s). This is also reflected in the cost of this topic; a topic with `scale` of 2 and count of 10 is charged for 20 partitions. This value must be in the range [1,4].
*/
scale?: number | null;
}
/**
* A pair of a Cursor and the partition it is for.
*/
export interface Schema$PartitionCursor {
/**
* The value of the cursor.
*/
cursor?: Schema$Cursor;
/**
* The partition this is for.
*/
partition?: string | null;
}
/**
* The settings for a topic's message retention.
*/
export interface Schema$RetentionConfig {
/**
* How long a published message is retained. If unset, messages will be retained as long as the bytes retained for each partition is below `per_partition_bytes`.
*/
period?: string | null;
/**
* The provisioned storage, in bytes, per partition. If the number of bytes stored in any of the topic's partitions grows beyond this value, older messages will be dropped to make room for newer ones, regardless of the value of `period`.
*/
perPartitionBytes?: string | null;
}
/**
* Metadata about a subscription resource.
*/
export interface Schema$Subscription {
/**
* The settings for this subscription's message delivery.
*/
deliveryConfig?: Schema$DeliveryConfig;
/**
* The name of the subscription. Structured like: projects/{project_number\}/locations/{location\}/subscriptions/{subscription_id\}
*/
name?: string | null;
/**
* The name of the topic this subscription is attached to. Structured like: projects/{project_number\}/locations/{location\}/topics/{topic_id\}
*/
topic?: string | null;
}
/**
* Metadata about a topic resource.
*/
export interface Schema$Topic {
/**
* The name of the topic. Structured like: projects/{project_number\}/locations/{location\}/topics/{topic_id\}
*/
name?: string | null;
/**
* The settings for this topic's partitions.
*/
partitionConfig?: Schema$PartitionConfig;
/**
* The settings for this topic's message retention.
*/
retentionConfig?: Schema$RetentionConfig;
}
/**
* Response for GetTopicPartitions.
*/
export interface Schema$TopicPartitions {
/**
* The number of partitions in the topic.
*/
partitionCount?: string | null;
}
export class Resource$Admin {
context: APIRequestContext;
projects: Resource$Admin$Projects;
constructor(context: APIRequestContext);
}
export class Resource$Admin$Projects {
context: APIRequestContext;
locations: Resource$Admin$Projects$Locations;
constructor(context: APIRequestContext);
}
export class Resource$Admin$Projects$Locations {
context: APIRequestContext;
subscriptions: Resource$Admin$Projects$Locations$Subscriptions;
topics: Resource$Admin$Projects$Locations$Topics;
constructor(context: APIRequestContext);
}
export class Resource$Admin$Projects$Locations$Subscriptions {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Creates a new subscription.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.subscriptions.create({
* // Required. The parent location in which to create the subscription. Structured like `projects/{project_number\}/locations/{location\}`.
* parent: 'projects/my-project/locations/my-location',
* // If true, the newly created subscription will only receive messages published after the subscription was created. Otherwise, the entire message backlog will be received on the subscription. Defaults to false.
* skipBacklog: 'placeholder-value',
* // Required. The ID to use for the subscription, which will become the final component of the subscription's name. This value is structured like: `my-sub-name`.
* subscriptionId: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "deliveryConfig": {},
* // "name": "my_name",
* // "topic": "my_topic"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "deliveryConfig": {},
* // "name": "my_name",
* // "topic": "my_topic"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Create, options: StreamMethodOptions): GaxiosPromise<Readable>;
create(params?: Params$Resource$Admin$Projects$Locations$Subscriptions$Create, options?: MethodOptions): GaxiosPromise<Schema$Subscription>;
create(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Create, options: MethodOptions | BodyResponseCallback<Schema$Subscription>, callback: BodyResponseCallback<Schema$Subscription>): void;
create(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Create, callback: BodyResponseCallback<Schema$Subscription>): void;
create(callback: BodyResponseCallback<Schema$Subscription>): void;
/**
* Deletes the specified subscription.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.subscriptions.delete({
* // Required. The name of the subscription to delete.
* name:
* 'projects/my-project/locations/my-location/subscriptions/my-subscription',
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
delete(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
delete(params?: Params$Resource$Admin$Projects$Locations$Subscriptions$Delete, options?: MethodOptions): GaxiosPromise<Schema$Empty>;
delete(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
delete(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
delete(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
delete(callback: BodyResponseCallback<Schema$Empty>): void;
/**
* Returns the subscription configuration.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.subscriptions.get({
* // Required. The name of the subscription whose configuration to return.
* name:
* 'projects/my-project/locations/my-location/subscriptions/my-subscription',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "deliveryConfig": {},
* // "name": "my_name",
* // "topic": "my_topic"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
get(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
get(params?: Params$Resource$Admin$Projects$Locations$Subscriptions$Get, options?: MethodOptions): GaxiosPromise<Schema$Subscription>;
get(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
get(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Get, options: MethodOptions | BodyResponseCallback<Schema$Subscription>, callback: BodyResponseCallback<Schema$Subscription>): void;
get(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Get, callback: BodyResponseCallback<Schema$Subscription>): void;
get(callback: BodyResponseCallback<Schema$Subscription>): void;
/**
* Returns the list of subscriptions for the given project.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.subscriptions.list({
* // The maximum number of subscriptions to return. The service may return fewer than this value. If unset or zero, all subscriptions for the parent will be returned.
* pageSize: 'placeholder-value',
* // A page token, received from a previous `ListSubscriptions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptions` must match the call that provided the page token.
* pageToken: 'placeholder-value',
* // Required. The parent whose subscriptions are to be listed. Structured like `projects/{project_number\}/locations/{location\}`.
* parent: 'projects/my-project/locations/my-location',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "nextPageToken": "my_nextPageToken",
* // "subscriptions": []
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
list(params: Params$Resource$Admin$Projects$Locations$Subscriptions$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
list(params?: Params$Resource$Admin$Projects$Locations$Subscriptions$List, options?: MethodOptions): GaxiosPromise<Schema$ListSubscriptionsResponse>;
list(params: Params$Resource$Admin$Projects$Locations$Subscriptions$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
list(params: Params$Resource$Admin$Projects$Locations$Subscriptions$List, options: MethodOptions | BodyResponseCallback<Schema$ListSubscriptionsResponse>, callback: BodyResponseCallback<Schema$ListSubscriptionsResponse>): void;
list(params: Params$Resource$Admin$Projects$Locations$Subscriptions$List, callback: BodyResponseCallback<Schema$ListSubscriptionsResponse>): void;
list(callback: BodyResponseCallback<Schema$ListSubscriptionsResponse>): void;
/**
* Updates properties of the specified subscription.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.subscriptions.patch({
* // The name of the subscription. Structured like: projects/{project_number\}/locations/{location\}/subscriptions/{subscription_id\}
* name:
* 'projects/my-project/locations/my-location/subscriptions/my-subscription',
* // Required. A mask specifying the subscription fields to change.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "deliveryConfig": {},
* // "name": "my_name",
* // "topic": "my_topic"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "deliveryConfig": {},
* // "name": "my_name",
* // "topic": "my_topic"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
patch(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Patch, options: StreamMethodOptions): GaxiosPromise<Readable>;
patch(params?: Params$Resource$Admin$Projects$Locations$Subscriptions$Patch, options?: MethodOptions): GaxiosPromise<Schema$Subscription>;
patch(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
patch(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Patch, options: MethodOptions | BodyResponseCallback<Schema$Subscription>, callback: BodyResponseCallback<Schema$Subscription>): void;
patch(params: Params$Resource$Admin$Projects$Locations$Subscriptions$Patch, callback: BodyResponseCallback<Schema$Subscription>): void;
patch(callback: BodyResponseCallback<Schema$Subscription>): void;
}
export interface Params$Resource$Admin$Projects$Locations$Subscriptions$Create extends StandardParameters {
/**
* Required. The parent location in which to create the subscription. Structured like `projects/{project_number\}/locations/{location\}`.
*/
parent?: string;
/**
* If true, the newly created subscription will only receive messages published after the subscription was created. Otherwise, the entire message backlog will be received on the subscription. Defaults to false.
*/
skipBacklog?: boolean;
/**
* Required. The ID to use for the subscription, which will become the final component of the subscription's name. This value is structured like: `my-sub-name`.
*/
subscriptionId?: string;
/**
* Request body metadata
*/
requestBody?: Schema$Subscription;
}
export interface Params$Resource$Admin$Projects$Locations$Subscriptions$Delete extends StandardParameters {
/**
* Required. The name of the subscription to delete.
*/
name?: string;
}
export interface Params$Resource$Admin$Projects$Locations$Subscriptions$Get extends StandardParameters {
/**
* Required. The name of the subscription whose configuration to return.
*/
name?: string;
}
export interface Params$Resource$Admin$Projects$Locations$Subscriptions$List extends StandardParameters {
/**
* The maximum number of subscriptions to return. The service may return fewer than this value. If unset or zero, all subscriptions for the parent will be returned.
*/
pageSize?: number;
/**
* A page token, received from a previous `ListSubscriptions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSubscriptions` must match the call that provided the page token.
*/
pageToken?: string;
/**
* Required. The parent whose subscriptions are to be listed. Structured like `projects/{project_number\}/locations/{location\}`.
*/
parent?: string;
}
export interface Params$Resource$Admin$Projects$Locations$Subscriptions$Patch extends StandardParameters {
/**
* The name of the subscription. Structured like: projects/{project_number\}/locations/{location\}/subscriptions/{subscription_id\}
*/
name?: string;
/**
* Required. A mask specifying the subscription fields to change.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$Subscription;
}
export class Resource$Admin$Projects$Locations$Topics {
context: APIRequestContext;
subscriptions: Resource$Admin$Projects$Locations$Topics$Subscriptions;
constructor(context: APIRequestContext);
/**
* Creates a new topic.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.topics.create({
* // Required. The parent location in which to create the topic. Structured like `projects/{project_number\}/locations/{location\}`.
* parent: 'projects/my-project/locations/my-location',
* // Required. The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: `my-topic-name`.
* topicId: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "name": "my_name",
* // "partitionConfig": {},
* // "retentionConfig": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "name": "my_name",
* // "partitionConfig": {},
* // "retentionConfig": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Admin$Projects$Locations$Topics$Create, options: StreamMethodOptions): GaxiosPromise<Readable>;
create(params?: Params$Resource$Admin$Projects$Locations$Topics$Create, options?: MethodOptions): GaxiosPromise<Schema$Topic>;
create(params: Params$Resource$Admin$Projects$Locations$Topics$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Admin$Projects$Locations$Topics$Create, options: MethodOptions | BodyResponseCallback<Schema$Topic>, callback: BodyResponseCallback<Schema$Topic>): void;
create(params: Params$Resource$Admin$Projects$Locations$Topics$Create, callback: BodyResponseCallback<Schema$Topic>): void;
create(callback: BodyResponseCallback<Schema$Topic>): void;
/**
* Deletes the specified topic.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.topics.delete({
* // Required. The name of the topic to delete.
* name: 'projects/my-project/locations/my-location/topics/my-topic',
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
delete(params: Params$Resource$Admin$Projects$Locations$Topics$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
delete(params?: Params$Resource$Admin$Projects$Locations$Topics$Delete, options?: MethodOptions): GaxiosPromise<Schema$Empty>;
delete(params: Params$Resource$Admin$Projects$Locations$Topics$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
delete(params: Params$Resource$Admin$Projects$Locations$Topics$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
delete(params: Params$Resource$Admin$Projects$Locations$Topics$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
delete(callback: BodyResponseCallback<Schema$Empty>): void;
/**
* Returns the topic configuration.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.topics.get({
* // Required. The name of the topic whose configuration to return.
* name: 'projects/my-project/locations/my-location/topics/my-topic',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "name": "my_name",
* // "partitionConfig": {},
* // "retentionConfig": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
get(params: Params$Resource$Admin$Projects$Locations$Topics$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
get(params?: Params$Resource$Admin$Projects$Locations$Topics$Get, options?: MethodOptions): GaxiosPromise<Schema$Topic>;
get(params: Params$Resource$Admin$Projects$Locations$Topics$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
get(params: Params$Resource$Admin$Projects$Locations$Topics$Get, options: MethodOptions | BodyResponseCallback<Schema$Topic>, callback: BodyResponseCallback<Schema$Topic>): void;
get(params: Params$Resource$Admin$Projects$Locations$Topics$Get, callback: BodyResponseCallback<Schema$Topic>): void;
get(callback: BodyResponseCallback<Schema$Topic>): void;
/**
* Returns the partition information for the requested topic.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.topics.getPartitions({
* // Required. The topic whose partition information to return.
* name: 'projects/my-project/locations/my-location/topics/my-topic',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "partitionCount": "my_partitionCount"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
getPartitions(params: Params$Resource$Admin$Projects$Locations$Topics$Getpartitions, options: StreamMethodOptions): GaxiosPromise<Readable>;
getPartitions(params?: Params$Resource$Admin$Projects$Locations$Topics$Getpartitions, options?: MethodOptions): GaxiosPromise<Schema$TopicPartitions>;
getPartitions(params: Params$Resource$Admin$Projects$Locations$Topics$Getpartitions, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
getPartitions(params: Params$Resource$Admin$Projects$Locations$Topics$Getpartitions, options: MethodOptions | BodyResponseCallback<Schema$TopicPartitions>, callback: BodyResponseCallback<Schema$TopicPartitions>): void;
getPartitions(params: Params$Resource$Admin$Projects$Locations$Topics$Getpartitions, callback: BodyResponseCallback<Schema$TopicPartitions>): void;
getPartitions(callback: BodyResponseCallback<Schema$TopicPartitions>): void;
/**
* Returns the list of topics for the given project.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.topics.list({
* // The maximum number of topics to return. The service may return fewer than this value. If unset or zero, all topics for the parent will be returned.
* pageSize: 'placeholder-value',
* // A page token, received from a previous `ListTopics` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListTopics` must match the call that provided the page token.
* pageToken: 'placeholder-value',
* // Required. The parent whose topics are to be listed. Structured like `projects/{project_number\}/locations/{location\}`.
* parent: 'projects/my-project/locations/my-location',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "nextPageToken": "my_nextPageToken",
* // "topics": []
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
list(params: Params$Resource$Admin$Projects$Locations$Topics$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
list(params?: Params$Resource$Admin$Projects$Locations$Topics$List, options?: MethodOptions): GaxiosPromise<Schema$ListTopicsResponse>;
list(params: Params$Resource$Admin$Projects$Locations$Topics$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
list(params: Params$Resource$Admin$Projects$Locations$Topics$List, options: MethodOptions | BodyResponseCallback<Schema$ListTopicsResponse>, callback: BodyResponseCallback<Schema$ListTopicsResponse>): void;
list(params: Params$Resource$Admin$Projects$Locations$Topics$List, callback: BodyResponseCallback<Schema$ListTopicsResponse>): void;
list(callback: BodyResponseCallback<Schema$ListTopicsResponse>): void;
/**
* Updates properties of the specified topic.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/pubsublite.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const pubsublite = google.pubsublite('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await pubsublite.admin.projects.locations.topics.patch({
* // The name of the topic. Structured like: projects/{project_number\}/locations/{location\}/topics/{topic_id\}
* name: 'projects/my-project/locations/my-location/topics/my-topic',
* // Required. A mask specifying the topic fields to change.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "name": "my_name",
* // "partitionConfig": {},
* // "retentionConfig": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "name": "my_name",
* // "partitionConfig": {},
* // "retentionConfig": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for reque