Skip to content

Commit

Permalink
Syncing protocol buffers (#67)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 051b69b321579560a25b03a39639fdcae5411bdb

Co-authored-by: Working Group Two Maintainers <noreply@wgtwo.com>
  • Loading branch information
sjoblomj and Working Group Two Maintainers authored Jan 9, 2025
1 parent 304b962 commit 529f785
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
22 changes: 22 additions & 0 deletions wgtwo/annotations/annotations.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,38 @@ option java_package = "com.wgtwo.api.annotations";
option java_outer_classname = "AnnotationsProto";

extend google.protobuf.MethodOptions {
// Specifies the required access scope for this method.
string scope = 50013;
}

// Enum representing the release status of API methods.
//
// More guidance around release status can be found in the
// [API Lifecycle documentation](https://developer.cisco.com/docs/mobility-services/api-lifecycle/).
enum ReleaseStatus {
// Default status when unspecified.
UNSPECIFIED = 0;

// Indicates a stable method, suitable for production use.
// No breaking changes will be made to this method.
STABLE = 1;

// Indicates a beta method, suitable for initial development and testing.
// Note that breaking changes may occur without notice.
//
// Most new methods will be released as beta, awaiting feedback from developers.
BETA = 2;

// Indicates a deprecated method.
// It is recommended to migrate to newer alternatives if available.
//
// Please consult the
// [Cisco DevNet Mobility Services API documentation](https://docs.mobility.cisco.com/)
// for guidance.
DEPRECATED = 3;
}

extend google.protobuf.MethodOptions {
// The release status of the method.
ReleaseStatus status = 50015;
}
7 changes: 7 additions & 0 deletions wgtwo/annotations/buf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Annotations

The annotations in the `wgtwo` package provide critical metadata for API methods.

They are intended to aid developers in understanding the access scope required to use the API method.

It also provides information about the API method's stability and deprecation status.
17 changes: 17 additions & 0 deletions wgtwo/common/v0/pagination.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

package wgtwo.common.v0;

option go_package = "github.com/working-group-two/wgtwoapis/wgtwo/common/v0";
option java_package = "com.wgtwo.api.v0.common";
option java_outer_classname = "PaginationProto";

message PaginationRequest {
// 1 is reserved for 'parent'
int32 page_size = 2;
string page_token = 3;
}

message PaginationResponse {
string next_page_token = 2;
}
16 changes: 15 additions & 1 deletion wgtwo/consents/v0/consents.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package wgtwo.consents.v0;

import "wgtwo/annotations/annotations.proto";
import "wgtwo/common/v0/errors.proto";
import "wgtwo/common/v0/pagination.proto";
import "wgtwo/common/v0/phonenumber.proto";
import "wgtwo/common/v0/types.proto";

Expand Down Expand Up @@ -46,6 +47,19 @@ service ConsentService {
option (scope) = "subscription.consent:write";
}

rpc ListConsentsForProduct (ListConsentsForProductRequest)
returns (ListConsentsForProductResponse) {
option (scope) = "";
}
}

message ListConsentsForProductRequest {
wgtwo.common.v0.PaginationRequest pagination = 1;
}

message ListConsentsForProductResponse {
repeated Consent consents = 1;
wgtwo.common.v0.PaginationResponse pagination = 2;
}

// Request to get consents for a subscription.
Expand Down Expand Up @@ -115,7 +129,7 @@ message Consent {
// The scopes of the consent.
repeated Scope scopes = 3;
// Whether the consent is revocable.
bool revokable = 4;
bool revocable = 4;
map<string, string> metadata = 5;
}

Expand Down

0 comments on commit 529f785

Please sign in to comment.