Skip to content

Commit

Permalink
feat: re-generated to pick up changes from googleapis (#1014)
Browse files Browse the repository at this point in the history
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* Add DetachSubscription RPC

PiperOrigin-RevId: 313276022

Source-Author: Google APIs <[email protected]>
Source-Date: Tue May 26 15:11:32 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: f5f268f5293e60143ac742a4eeb7dd6306ebf505
Source-Link: googleapis/googleapis@f5f268f

* Use correct resource type for DetachSubscriptionRequest

PiperOrigin-RevId: 313488995

Source-Author: Google APIs <[email protected]>
Source-Date: Wed May 27 16:45:32 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: eafa840ceec23b44a5c21670288107c661252711
Source-Link: googleapis/googleapis@eafa840

Co-authored-by: Megan Potter <[email protected]>
  • Loading branch information
yoshi-automation and feywind authored Jun 2, 2020
1 parent 85f17a1 commit 1ad3552
Show file tree
Hide file tree
Showing 8 changed files with 835 additions and 7 deletions.
31 changes: 29 additions & 2 deletions protos/google/pubsub/v1/pubsub.proto
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ service Publisher {
option (google.api.method_signature) = "project";
}

// Lists the names of the subscriptions on this topic.
// Lists the names of the attached subscriptions on this topic.
rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest)
returns (ListTopicSubscriptionsResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -122,6 +122,17 @@ service Publisher {
};
option (google.api.method_signature) = "topic";
}

// Detaches a subscription from this topic. All messages retained in the
// subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
// will return FAILED_PRECONDITION. If the subscription is a push
// subscription, pushes to the endpoint will stop.
rpc DetachSubscription(DetachSubscriptionRequest)
returns (DetachSubscriptionResponse) {
option (google.api.http) = {
post: "/v1/{subscription=projects/*/subscriptions/*}:detach"
};
}
}

message MessageStoragePolicy {
Expand Down Expand Up @@ -300,7 +311,7 @@ message ListTopicSubscriptionsRequest {

// Response for the `ListTopicSubscriptions` method.
message ListTopicSubscriptionsResponse {
// The names of the subscriptions that match the request.
// The names of subscriptions attached to the topic specified in the request.
repeated string subscriptions = 1 [(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}];
Expand Down Expand Up @@ -350,6 +361,22 @@ message DeleteTopicRequest {
];
}

// Request for the DetachSubscription method.
message DetachSubscriptionRequest {
// Required. The subscription to detach.
// Format is `projects/{project}/subscriptions/{subscription}`.
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
}

// Response for the DetachSubscription method.
// Reserved for future use.
message DetachSubscriptionResponse {}

// The service that an application uses to manipulate subscriptions and to
// consume messages from a subscription via the `Pull` method or by
// establishing a bi-directional stream using the `StreamingPull` method.
Expand Down
195 changes: 195 additions & 0 deletions protos/protos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,20 @@ export namespace google {
* @returns Promise
*/
public deleteTopic(request: google.pubsub.v1.IDeleteTopicRequest): Promise<google.protobuf.Empty>;

/**
* Calls DetachSubscription.
* @param request DetachSubscriptionRequest message or plain object
* @param callback Node-style callback called with the error, if any, and DetachSubscriptionResponse
*/
public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest, callback: google.pubsub.v1.Publisher.DetachSubscriptionCallback): void;

/**
* Calls DetachSubscription.
* @param request DetachSubscriptionRequest message or plain object
* @returns Promise
*/
public detachSubscription(request: google.pubsub.v1.IDetachSubscriptionRequest): Promise<google.pubsub.v1.DetachSubscriptionResponse>;
}

namespace Publisher {
Expand Down Expand Up @@ -213,6 +227,13 @@ export namespace google {
* @param [response] Empty
*/
type DeleteTopicCallback = (error: (Error|null), response?: google.protobuf.Empty) => void;

/**
* Callback as used by {@link google.pubsub.v1.Publisher#detachSubscription}.
* @param error Error, if any
* @param [response] DetachSubscriptionResponse
*/
type DetachSubscriptionCallback = (error: (Error|null), response?: google.pubsub.v1.DetachSubscriptionResponse) => void;
}

/** Properties of a MessageStoragePolicy. */
Expand Down Expand Up @@ -1583,6 +1604,180 @@ export namespace google {
public toJSON(): { [k: string]: any };
}

/** Properties of a DetachSubscriptionRequest. */
interface IDetachSubscriptionRequest {

/** DetachSubscriptionRequest subscription */
subscription?: (string|null);
}

/** Represents a DetachSubscriptionRequest. */
class DetachSubscriptionRequest implements IDetachSubscriptionRequest {

/**
* Constructs a new DetachSubscriptionRequest.
* @param [properties] Properties to set
*/
constructor(properties?: google.pubsub.v1.IDetachSubscriptionRequest);

/** DetachSubscriptionRequest subscription. */
public subscription: string;

/**
* Creates a new DetachSubscriptionRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns DetachSubscriptionRequest instance
*/
public static create(properties?: google.pubsub.v1.IDetachSubscriptionRequest): google.pubsub.v1.DetachSubscriptionRequest;

/**
* Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages.
* @param message DetachSubscriptionRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages.
* @param message DetachSubscriptionRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionRequest, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a DetachSubscriptionRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns DetachSubscriptionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DetachSubscriptionRequest;

/**
* Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns DetachSubscriptionRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DetachSubscriptionRequest;

/**
* Verifies a DetachSubscriptionRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates a DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns DetachSubscriptionRequest
*/
public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionRequest;

/**
* Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified.
* @param message DetachSubscriptionRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.pubsub.v1.DetachSubscriptionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this DetachSubscriptionRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}

/** Properties of a DetachSubscriptionResponse. */
interface IDetachSubscriptionResponse {
}

/** Represents a DetachSubscriptionResponse. */
class DetachSubscriptionResponse implements IDetachSubscriptionResponse {

/**
* Constructs a new DetachSubscriptionResponse.
* @param [properties] Properties to set
*/
constructor(properties?: google.pubsub.v1.IDetachSubscriptionResponse);

/**
* Creates a new DetachSubscriptionResponse instance using the specified properties.
* @param [properties] Properties to set
* @returns DetachSubscriptionResponse instance
*/
public static create(properties?: google.pubsub.v1.IDetachSubscriptionResponse): google.pubsub.v1.DetachSubscriptionResponse;

/**
* Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages.
* @param message DetachSubscriptionResponse message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages.
* @param message DetachSubscriptionResponse message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.pubsub.v1.IDetachSubscriptionResponse, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a DetachSubscriptionResponse message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns DetachSubscriptionResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.DetachSubscriptionResponse;

/**
* Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns DetachSubscriptionResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.DetachSubscriptionResponse;

/**
* Verifies a DetachSubscriptionResponse message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates a DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns DetachSubscriptionResponse
*/
public static fromObject(object: { [k: string]: any }): google.pubsub.v1.DetachSubscriptionResponse;

/**
* Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified.
* @param message DetachSubscriptionResponse
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.pubsub.v1.DetachSubscriptionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this DetachSubscriptionResponse to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}

/** Represents a Subscriber */
class Subscriber extends $protobuf.rpc.Service {

Expand Down
Loading

0 comments on commit 1ad3552

Please sign in to comment.