From 529f785b32c219592a678c951026ce2d93ad28b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sj=C3=B6blom?= Date: Thu, 9 Jan 2025 18:49:19 +0100 Subject: [PATCH] Syncing protocol buffers (#67) GitOrigin-RevId: 051b69b321579560a25b03a39639fdcae5411bdb Co-authored-by: Working Group Two Maintainers --- wgtwo/annotations/annotations.proto | 22 ++++++++++++++++++++++ wgtwo/annotations/buf.md | 7 +++++++ wgtwo/common/v0/pagination.proto | 17 +++++++++++++++++ wgtwo/consents/v0/consents.proto | 16 +++++++++++++++- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 wgtwo/annotations/buf.md create mode 100644 wgtwo/common/v0/pagination.proto diff --git a/wgtwo/annotations/annotations.proto b/wgtwo/annotations/annotations.proto index 0bd7c3b..499e420 100644 --- a/wgtwo/annotations/annotations.proto +++ b/wgtwo/annotations/annotations.proto @@ -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; } diff --git a/wgtwo/annotations/buf.md b/wgtwo/annotations/buf.md new file mode 100644 index 0000000..9a7cec6 --- /dev/null +++ b/wgtwo/annotations/buf.md @@ -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. diff --git a/wgtwo/common/v0/pagination.proto b/wgtwo/common/v0/pagination.proto new file mode 100644 index 0000000..294bee2 --- /dev/null +++ b/wgtwo/common/v0/pagination.proto @@ -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; +} diff --git a/wgtwo/consents/v0/consents.proto b/wgtwo/consents/v0/consents.proto index 9b664bb..b2cc1e2 100644 --- a/wgtwo/consents/v0/consents.proto +++ b/wgtwo/consents/v0/consents.proto @@ -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"; @@ -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. @@ -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 metadata = 5; }