Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-generate library using /synth.py #287

Merged
merged 1 commit into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 54 additions & 28 deletions protos/google/pubsub/v1/pubsub.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google Inc.
// Copyright 2018 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand Down Expand Up @@ -53,8 +54,7 @@ service Publisher {
}

// Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic
// does not exist. The message payload must not be empty; it must contain
// either a non-empty data field, or at least one attribute.
// does not exist.
rpc Publish(PublishRequest) returns (PublishResponse) {
option (google.api.http) = {
post: "/v1/{topic=projects/*/topics/*}:publish"
Expand Down Expand Up @@ -187,8 +187,7 @@ service Subscriber {
};
}

// Pulls messages from the server. Returns an empty list if there are no
// messages available in the backlog. The server may return `UNAVAILABLE` if
// Pulls messages from the server. The server may return `UNAVAILABLE` if
// there are too many concurrent pull requests pending for the given
// subscription.
rpc Pull(PullRequest) returns (PullResponse) {
Expand All @@ -205,7 +204,8 @@ service Subscriber {
// reassign server-side resources, in which case, the client should
// re-establish the stream. Flow control can be achieved by configuring the
// underlying RPC channel.
rpc StreamingPull(stream StreamingPullRequest) returns (stream StreamingPullResponse);
rpc StreamingPull(stream StreamingPullRequest) returns (stream StreamingPullResponse) {
}

// Modifies the `PushConfig` for a specified subscription.
//
Expand Down Expand Up @@ -243,7 +243,7 @@ service Subscriber {
// Creates a snapshot from the requested subscription.<br><br>
// <b>ALPHA:</b> This feature is part of an alpha release. This API might be
// changed in backward-incompatible ways and is not recommended for production
// use. It is not subject to any SLA or deprecation policy.
// use. It is not subject to any SLA or deprecation policy.<br><br>
// If the snapshot already exists, returns `ALREADY_EXISTS`.
// If the requested subscription doesn't exist, returns `NOT_FOUND`.
// If the backlog in the subscription is too old -- and the resulting snapshot
Expand Down Expand Up @@ -321,7 +321,7 @@ message Topic {
// must not start with `"goog"`.
string name = 1;

// User labels.
// See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
map<string, string> labels = 2;

// Policy constraining how messages published to the topic may be stored. It
Expand All @@ -333,10 +333,13 @@ message Topic {
MessageStoragePolicy message_storage_policy = 3;
}

// A message data and its attributes. The message payload must not be empty;
// it must contain either a non-empty data field, or at least one attribute.
// A message that is published by publishers and consumed by subscribers. The
// message must contain either a non-empty data field or at least one attribute.
// See <a href="/pubsub/quotas">Quotas and limits</a> for more information about
// message limits.
message PubsubMessage {
// The message payload.
// The message data field. If this field is empty, the message must contain
// at least one attribute.
bytes data = 1;

// Optional attributes for this message.
Expand Down Expand Up @@ -394,8 +397,8 @@ message PublishResponse {

// Request for the `ListTopics` method.
message ListTopicsRequest {
// The name of the cloud project that topics belong to.
// Format is `projects/{project}`.
// The name of the project in which to list topics.
// Format is `projects/{project-id}`.
string project = 1;

// Maximum number of topics to return.
Expand Down Expand Up @@ -545,8 +548,31 @@ message Subscription {
// use. It is not subject to any SLA or deprecation policy.
google.protobuf.Duration message_retention_duration = 8;

// User labels.
// See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
map<string, string> labels = 9;

// A policy that specifies the conditions for this subscription's expiration.
// A subscription is considered active as long as any connected subscriber is
// successfully consuming messages from the subscription or is issuing
// operations on the subscription. If `expiration_policy` is not set, a
// *default policy* with `ttl` of 31 days will be used. The minimum allowed
// value for `expiration_policy.ttl` is 1 day.
// <b>BETA:</b> This feature is part of a beta release. This API might be
// changed in backward-incompatible ways and is not recommended for production
// use. It is not subject to any SLA or deprecation policy.
ExpirationPolicy expiration_policy = 11;
}

// A policy that specifies the conditions for resource expiration (i.e.,
// automatic resource deletion).
message ExpirationPolicy {
// Specifies the "time-to-live" duration for an associated resource. The
// resource expires if it is not active for a period of `ttl`. The definition
// of "activity" depends on the type of the associated resource. The minimum
// and maximum allowed values for `ttl` depend on the type of the associated
// resource, as well. If `ttl` is not set, the associated resource never
// expires.
google.protobuf.Duration ttl = 1;
}

// Configuration for a push delivery endpoint.
Expand Down Expand Up @@ -607,8 +633,8 @@ message UpdateSubscriptionRequest {

// Request for the `ListSubscriptions` method.
message ListSubscriptionsRequest {
// The name of the cloud project that subscriptions belong to.
// Format is `projects/{project}`.
// The name of the project in which to list subscriptions.
// Format is `projects/{project-id}`.
string project = 1;

// Maximum number of subscriptions to return.
Expand Down Expand Up @@ -662,9 +688,7 @@ message PullRequest {
// If this field set to true, the system will respond immediately even if
// it there are no messages available to return in the `Pull` response.
// Otherwise, the system may wait (for a bounded amount of time) until at
// least one message is available, rather than returning no messages. The
// client may cancel the request if it does not wish to wait any longer for
// the response.
// least one message is available, rather than returning no messages.
bool return_immediately = 2;

// The maximum number of messages returned for this request. The Pub/Sub
Expand All @@ -674,10 +698,10 @@ message PullRequest {

// Response for the `Pull` method.
message PullResponse {
// Received Pub/Sub messages. The Pub/Sub system will return zero messages if
// there are no more available in the backlog. The Pub/Sub system may return
// fewer than the `maxMessages` requested even if there are more messages
// available in the backlog.
// Received Pub/Sub messages. The list will be empty if there are no more
// messages available in the backlog. For JSON, the response can be entirely
// empty. The Pub/Sub system may return fewer than the `maxMessages` requested
// even if there are more messages available in the backlog.
repeated ReceivedMessage received_messages = 1;
}

Expand Down Expand Up @@ -770,7 +794,8 @@ message CreateSnapshotRequest {
// Optional user-provided name for this snapshot.
// If the name is not provided in the request, the server will assign a random
// name for this snapshot on the same project as the subscription.
// Note that for REST API requests, you must specify a name.
// Note that for REST API requests, you must specify a name. See the
// <a href="/pubsub/docs/admin#resource_names">resource name rules</a>.
// Format is `projects/{project}/snapshots/{snap}`.
string name = 1;

Expand All @@ -785,7 +810,7 @@ message CreateSnapshotRequest {
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 2;

// User labels.
// See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
map<string, string> labels = 3;
}

Expand Down Expand Up @@ -825,7 +850,7 @@ message Snapshot {
// snapshot that would expire in less than 1 hour after creation.
google.protobuf.Timestamp expire_time = 3;

// User labels.
// See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
map<string, string> labels = 4;
}

Expand All @@ -844,8 +869,8 @@ message GetSnapshotRequest {
// changed in backward-incompatible ways and is not recommended for production
// use. It is not subject to any SLA or deprecation policy.
message ListSnapshotsRequest {
// The name of the cloud project that snapshots belong to.
// Format is `projects/{project}`.
// The name of the project in which to list snapshots.
// Format is `projects/{project-id}`.
string project = 1;

// Maximum number of snapshots to return.
Expand Down Expand Up @@ -909,6 +934,7 @@ message SeekRequest {
}
}

// Response for the `Seek` method (this response is empty).
message SeekResponse {

}
80 changes: 59 additions & 21 deletions src/v1/doc/google/pubsub/v1/doc_pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const MessageStoragePolicy = {
* must not start with `"goog"`.
*
* @property {Object.<string, string>} labels
* User labels.
* See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
*
* @property {Object} messageStoragePolicy
* Policy constraining how messages published to the topic may be stored. It
Expand All @@ -65,11 +65,14 @@ const Topic = {
};

/**
* A message data and its attributes. The message payload must not be empty;
* it must contain either a non-empty data field, or at least one attribute.
* A message that is published by publishers and consumed by subscribers. The
* message must contain either a non-empty data field or at least one attribute.
* See <a href="/pubsub/quotas">Quotas and limits</a> for more information about
* message limits.
*
* @property {string} data
* The message payload.
* The message data field. If this field is empty, the message must contain
* at least one attribute.
*
* @property {Object.<string, string>} attributes
* Optional attributes for this message.
Expand Down Expand Up @@ -175,8 +178,8 @@ const PublishResponse = {
* Request for the `ListTopics` method.
*
* @property {string} project
* The name of the cloud project that topics belong to.
* Format is `projects/{project}`.
* The name of the project in which to list topics.
* Format is `projects/{project-id}`.
*
* @property {number} pageSize
* Maximum number of topics to return.
Expand Down Expand Up @@ -388,7 +391,20 @@ const DeleteTopicRequest = {
* This object should have the same structure as [Duration]{@link google.protobuf.Duration}
*
* @property {Object.<string, string>} labels
* User labels.
* See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
*
* @property {Object} expirationPolicy
* A policy that specifies the conditions for this subscription's expiration.
* A subscription is considered active as long as any connected subscriber is
* successfully consuming messages from the subscription or is issuing
* operations on the subscription. If `expiration_policy` is not set, a
* *default policy* with `ttl` of 31 days will be used. The minimum allowed
* value for `expiration_policy.ttl` is 1 day.
* <b>BETA:</b> This feature is part of a beta release. This API might be
* changed in backward-incompatible ways and is not recommended for production
* use. It is not subject to any SLA or deprecation policy.
*
* This object should have the same structure as [ExpirationPolicy]{@link google.pubsub.v1.ExpirationPolicy}
*
* @typedef Subscription
* @memberof google.pubsub.v1
Expand All @@ -398,6 +414,28 @@ const Subscription = {
// This is for documentation. Actual contents will be loaded by gRPC.
};

/**
* A policy that specifies the conditions for resource expiration (i.e.,
* automatic resource deletion).
*
* @property {Object} ttl
* Specifies the "time-to-live" duration for an associated resource. The
* resource expires if it is not active for a period of `ttl`. The definition
* of "activity" depends on the type of the associated resource. The minimum
* and maximum allowed values for `ttl` depend on the type of the associated
* resource, as well. If `ttl` is not set, the associated resource never
* expires.
*
* This object should have the same structure as [Duration]{@link google.protobuf.Duration}
*
* @typedef ExpirationPolicy
* @memberof google.pubsub.v1
* @see [google.pubsub.v1.ExpirationPolicy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto}
*/
const ExpirationPolicy = {
// This is for documentation. Actual contents will be loaded by gRPC.
};

/**
* Configuration for a push delivery endpoint.
*
Expand Down Expand Up @@ -496,8 +534,8 @@ const UpdateSubscriptionRequest = {
* Request for the `ListSubscriptions` method.
*
* @property {string} project
* The name of the cloud project that subscriptions belong to.
* Format is `projects/{project}`.
* The name of the project in which to list subscriptions.
* Format is `projects/{project-id}`.
*
* @property {number} pageSize
* Maximum number of subscriptions to return.
Expand Down Expand Up @@ -587,9 +625,7 @@ const ModifyPushConfigRequest = {
* If this field set to true, the system will respond immediately even if
* it there are no messages available to return in the `Pull` response.
* Otherwise, the system may wait (for a bounded amount of time) until at
* least one message is available, rather than returning no messages. The
* client may cancel the request if it does not wish to wait any longer for
* the response.
* least one message is available, rather than returning no messages.
*
* @property {number} maxMessages
* The maximum number of messages returned for this request. The Pub/Sub
Expand All @@ -607,10 +643,10 @@ const PullRequest = {
* Response for the `Pull` method.
*
* @property {Object[]} receivedMessages
* Received Pub/Sub messages. The Pub/Sub system will return zero messages if
* there are no more available in the backlog. The Pub/Sub system may return
* fewer than the `maxMessages` requested even if there are more messages
* available in the backlog.
* Received Pub/Sub messages. The list will be empty if there are no more
* messages available in the backlog. For JSON, the response can be entirely
* empty. The Pub/Sub system may return fewer than the `maxMessages` requested
* even if there are more messages available in the backlog.
*
* This object should have the same structure as [ReceivedMessage]{@link google.pubsub.v1.ReceivedMessage}
*
Expand Down Expand Up @@ -747,7 +783,8 @@ const StreamingPullResponse = {
* Optional user-provided name for this snapshot.
* If the name is not provided in the request, the server will assign a random
* name for this snapshot on the same project as the subscription.
* Note that for REST API requests, you must specify a name.
* Note that for REST API requests, you must specify a name. See the
* <a href="/pubsub/docs/admin#resource_names">resource name rules</a>.
* Format is `projects/{project}/snapshots/{snap}`.
*
* @property {string} subscription
Expand All @@ -762,7 +799,7 @@ const StreamingPullResponse = {
* Format is `projects/{project}/subscriptions/{sub}`.
*
* @property {Object.<string, string>} labels
* User labels.
* See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
*
* @typedef CreateSnapshotRequest
* @memberof google.pubsub.v1
Expand Down Expand Up @@ -824,7 +861,7 @@ const UpdateSnapshotRequest = {
* This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp}
*
* @property {Object.<string, string>} labels
* User labels.
* See <a href="/pubsub/docs/labels"> Creating and managing labels</a>.
*
* @typedef Snapshot
* @memberof google.pubsub.v1
Expand Down Expand Up @@ -859,8 +896,8 @@ const GetSnapshotRequest = {
* use. It is not subject to any SLA or deprecation policy.
*
* @property {string} project
* The name of the cloud project that snapshots belong to.
* Format is `projects/{project}`.
* The name of the project in which to list snapshots.
* Format is `projects/{project-id}`.
*
* @property {number} pageSize
* Maximum number of snapshots to return.
Expand Down Expand Up @@ -957,6 +994,7 @@ const SeekRequest = {
};

/**
* Response for the `Seek` method (this response is empty).
* @typedef SeekResponse
* @memberof google.pubsub.v1
* @see [google.pubsub.v1.SeekResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub.proto}
Expand Down
Loading