diff --git a/google/cloud/channel/v1/BUILD.bazel b/google/cloud/channel/v1/BUILD.bazel new file mode 100644 index 00000000..f2f3befb --- /dev/null +++ b/google/cloud/channel/v1/BUILD.bazel @@ -0,0 +1,398 @@ +# This file was automatically generated by BuildFileGenerator +# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel + +# Most of the manual changes to this file will be overwritten. +# It's **only** allowed to change the following rule attribute values: +# - names of *_gapic_assembly_* rules +# - certain parameters of *_gapic_library rules, including but not limited to: +# * extra_protoc_parameters +# * extra_protoc_file_parameters +# The complete list of preserved parameters can be found in the source code. + +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +############################################################################## +# Common +############################################################################## +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") + +proto_library( + name = "channel_proto", + srcs = [ + "channel_partner_links.proto", + "common.proto", + "customers.proto", + "entitlements.proto", + "offers.proto", + "operations.proto", + "products.proto", + "service.proto", + ], + deps = [ + "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:field_behavior_proto", + "//google/api:resource_proto", + "//google/longrunning:operations_proto", + "//google/type:money_proto", + "//google/type:postal_address_proto", + "@com_google_protobuf//:any_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:field_mask_proto", + "@com_google_protobuf//:timestamp_proto", + "@com_google_protobuf//:wrappers_proto", + ], +) + +proto_library_with_info( + name = "channel_proto_with_info", + deps = [ + ":channel_proto", + "//google/cloud:common_resources_proto", + ], +) + +############################################################################## +# Java +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "java_gapic_assembly_gradle_pkg", + "java_gapic_library", + "java_gapic_test", + "java_grpc_library", + "java_proto_library", +) + +java_proto_library( + name = "channel_java_proto", + deps = [":channel_proto"], +) + +java_grpc_library( + name = "channel_java_grpc", + srcs = [":channel_proto"], + deps = [":channel_java_proto"], +) + +java_gapic_library( + name = "channel_java_gapic", + src = ":channel_proto_with_info", + gapic_yaml = "cloudchannel_gapic.yaml", + grpc_service_config = "cloudchannel_grpc_service_config.json", + package = "google.cloud.channel.v1", + service_yaml = "cloudchannel_v1.yaml", + test_deps = [ + ":channel_java_grpc", + ], + deps = [ + ":channel_java_proto", + ], +) + +java_gapic_test( + name = "channel_java_gapic_test_suite", + test_classes = [ + "com.google.cloud.channel.v1.CloudChannelServiceClientTest", + ], + runtime_deps = [":channel_java_gapic_test"], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( + name = "google-cloud-channel-v1-java", + deps = [ + ":channel_java_gapic", + ":channel_java_grpc", + ":channel_java_proto", + ":channel_proto", + ], +) + +############################################################################## +# Go +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "go_gapic_assembly_pkg", + "go_gapic_library", + "go_proto_library", + "go_test", +) + +go_proto_library( + name = "channel_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], + importpath = "google.golang.org/genproto/googleapis/cloud/channel/v1", + protos = [":channel_proto"], + deps = [ + "//google/api:annotations_go_proto", + "//google/longrunning:longrunning_go_proto", + "//google/type:money_go_proto", + "//google/type:postaladdress_go_proto", + ], +) + +go_gapic_library( + name = "channel_go_gapic", + srcs = [":channel_proto_with_info"], + grpc_service_config = "cloudchannel_grpc_service_config.json", + importpath = "cloud.google.com/go/channel/apiv1;channel", + service_yaml = "cloudchannel_v1.yaml", + deps = [ + ":channel_go_proto", + "//google/longrunning:longrunning_go_proto", + "@com_google_cloud_go//longrunning/autogen:go_default_library", + "@com_google_cloud_go//longrunning:go_default_library", + "@io_bazel_rules_go//proto/wkt:any_go_proto", + ], +) + +go_test( + name = "channel_go_gapic_test", + srcs = [":channel_go_gapic_srcjar_test"], + embed = [":channel_go_gapic"], + importpath = "cloud.google.com/go/channel/apiv1", +) + +# Open Source Packages +go_gapic_assembly_pkg( + name = "gapi-cloud-channel-v1-go", + deps = [ + ":channel_go_gapic", + ":channel_go_gapic_srcjar-test.srcjar", + ":channel_go_proto", + ], +) + +############################################################################## +# Python +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "moved_proto_library", + "py_gapic_assembly_pkg", + "py_gapic_library", + "py_grpc_library", + "py_proto_library", +) + +moved_proto_library( + name = "channel_moved_proto", + srcs = [":channel_proto"], + deps = [ + "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:field_behavior_proto", + "//google/api:resource_proto", + "//google/longrunning:operations_proto", + "//google/type:money_proto", + "//google/type:postal_address_proto", + "@com_google_protobuf//:any_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:field_mask_proto", + "@com_google_protobuf//:timestamp_proto", + "@com_google_protobuf//:wrappers_proto", + ], +) + +py_proto_library( + name = "channel_py_proto", + plugin = "@protoc_docs_plugin//:docs_plugin", + deps = [":channel_moved_proto"], +) + +py_grpc_library( + name = "channel_py_grpc", + srcs = [":channel_moved_proto"], + deps = [":channel_py_proto"], +) + +py_gapic_library( + name = "channel_py_gapic", + src = ":channel_proto_with_info", + gapic_yaml = "cloudchannel_gapic.yaml", + grpc_service_config = "cloudchannel_grpc_service_config.json", + package = "google.cloud.channel.v1", + service_yaml = "cloudchannel_v1.yaml", + deps = [ + ":channel_py_grpc", + ":channel_py_proto", + ], +) + +# Open Source Packages +py_gapic_assembly_pkg( + name = "channel-v1-py", + deps = [ + ":channel_py_gapic", + ":channel_py_grpc", + ":channel_py_proto", + ], +) + +############################################################################## +# PHP +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "php_gapic_assembly_pkg", + "php_gapic_library", + "php_grpc_library", + "php_proto_library", +) + +php_proto_library( + name = "channel_php_proto", + deps = [":channel_proto"], +) + +php_grpc_library( + name = "channel_php_grpc", + srcs = [":channel_proto"], + deps = [":channel_php_proto"], +) + +php_gapic_library( + name = "channel_php_gapic", + src = ":channel_proto_with_info", + gapic_yaml = "cloudchannel_gapic.yaml", + grpc_service_config = "cloudchannel_grpc_service_config.json", + package = "google.cloud.channel.v1", + service_yaml = "cloudchannel_v1.yaml", + deps = [ + ":channel_php_grpc", + ":channel_php_proto", + ], +) + +# Open Source Packages +php_gapic_assembly_pkg( + name = "google-cloud-channel-v1-php", + deps = [ + ":channel_php_gapic", + ":channel_php_grpc", + ":channel_php_proto", + ], +) + +############################################################################## +# Node.js +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "nodejs_gapic_assembly_pkg", + "nodejs_gapic_library", +) + +nodejs_gapic_library( + name = "channel_nodejs_gapic", + src = ":channel_proto_with_info", + grpc_service_config = "cloudchannel_grpc_service_config.json", + package = "google.cloud.channel.v1", + service_yaml = "cloudchannel_v1.yaml", + deps = [], +) + +nodejs_gapic_assembly_pkg( + name = "channel-v1-nodejs", + deps = [ + ":channel_nodejs_gapic", + ":channel_proto", + ], +) + +############################################################################## +# Ruby +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_gapic_assembly_pkg", + "ruby_gapic_library", + "ruby_grpc_library", + "ruby_proto_library", +) + +ruby_proto_library( + name = "channel_ruby_proto", + deps = [":channel_proto"], +) + +ruby_grpc_library( + name = "channel_ruby_grpc", + srcs = [":channel_proto"], + deps = [":channel_ruby_proto"], +) + +ruby_gapic_library( + name = "channel_ruby_gapic", + src = ":channel_proto_with_info", + gapic_yaml = "cloudchannel_gapic.yaml", + grpc_service_config = "cloudchannel_grpc_service_config.json", + package = "google.cloud.channel.v1", + service_yaml = "cloudchannel_v1.yaml", + deps = [ + ":channel_ruby_grpc", + ":channel_ruby_proto", + ], +) + +# Open Source Packages +ruby_gapic_assembly_pkg( + name = "google-cloud-channel-v1-ruby", + deps = [ + ":channel_ruby_gapic", + ":channel_ruby_grpc", + ":channel_ruby_proto", + ], +) + +############################################################################## +# C# +############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "csharp_gapic_assembly_pkg", + "csharp_gapic_library", + "csharp_grpc_library", + "csharp_proto_library", +) + +csharp_proto_library( + name = "channel_csharp_proto", + deps = [":channel_proto"], +) + +csharp_grpc_library( + name = "channel_csharp_grpc", + srcs = [":channel_proto"], + deps = [":channel_csharp_proto"], +) + +csharp_gapic_library( + name = "channel_csharp_gapic", + srcs = [":channel_proto_with_info"], + grpc_service_config = "cloudchannel_grpc_service_config.json", + common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json", + deps = [ + ":channel_csharp_grpc", + ":channel_csharp_proto", + ], +) + +# Open Source Packages +csharp_gapic_assembly_pkg( + name = "google-cloud-channel-v1-csharp", + deps = [ + ":channel_csharp_gapic", + ":channel_csharp_grpc", + ":channel_csharp_proto", + ], +) + +############################################################################## +# C++ +############################################################################## +# Put your C++ rules here diff --git a/google/cloud/channel/v1/channel_partner_links.proto b/google/cloud/channel/v1/channel_partner_links.proto new file mode 100644 index 00000000..4072e7a6 --- /dev/null +++ b/google/cloud/channel/v1/channel_partner_links.proto @@ -0,0 +1,76 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "ChannelPartnerLinksProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Entity representing a link between distributors and their indirect +// resellers in an n-tier resale channel. +message ChannelPartnerLink { + // Output only. Resource name for the channel partner link, in the format + // accounts/{account_id}/channelPartnerLinks/{id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Cloud Identity ID of the linked reseller. + string reseller_cloud_identity_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. State of the channel partner link. + ChannelPartnerLinkState link_state = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. URI of the web page where partner accepts the link invitation. + string invite_link_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of when the channel partner link is created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of when the channel partner link is updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Public identifier that a customer must use to generate a transfer token + // to move to this distributor-reseller combination. + string public_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud Identity info of the channel partner (IR). + CloudIdentityInfo channel_partner_cloud_identity_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ChannelPartnerLinkState represents state of a channel partner link. +enum ChannelPartnerLinkState { + // The state is not specified. + CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED = 0; + + // An invitation has been sent to the reseller to create a channel partner + // link. + INVITED = 1; + + // Status when the reseller is active. + ACTIVE = 2; + + // Status when the reseller has been revoked by the distributor. + REVOKED = 3; + + // Status when the reseller is suspended by Google or distributor. + SUSPENDED = 4; +} diff --git a/google/cloud/channel/v1/cloudchannel_gapic.yaml b/google/cloud/channel/v1/cloudchannel_gapic.yaml new file mode 100644 index 00000000..333f45ef --- /dev/null +++ b/google/cloud/channel/v1/cloudchannel_gapic.yaml @@ -0,0 +1,18 @@ +type: com.google.api.codegen.ConfigProto +config_schema_version: 2.0.0 +language_settings: + java: + package_name: com.google.cloud.channel.v1 + python: + package_name: google.cloud.channel_v1.gapic + go: + package_name: cloud.google.com/go/channel/apiv1 + csharp: + package_name: Google.Cloud.Channel.V1 + ruby: + package_name: Google::Cloud::Channel::V1 + php: + package_name: Google\Cloud\Channel\V1 + nodejs: + package_name: channel.v1 + domain_layer_location: google-cloud diff --git a/google/cloud/channel/v1/cloudchannel_grpc_service_config.json b/google/cloud/channel/v1/cloudchannel_grpc_service_config.json new file mode 100644 index 00000000..83172684 --- /dev/null +++ b/google/cloud/channel/v1/cloudchannel_grpc_service_config.json @@ -0,0 +1,29 @@ +{ + "methodConfig": [{ + "name": [{ "service": "google.cloud.channel.v1.CloudChannelService" }], + "timeout": "60s", + "retryPolicy": { + "maxAttempts": 5, + "initialBackoff": "1s", + "maxBackoff": "10s", + "backoffMultiplier": 1.3, + "retryableStatusCodes": ["UNAVAILABLE"] + } + }, + { + "name": [ + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "ProvisionCloudIdentity" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "CreateEntitlement" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "ChangeParameters" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "ChangeRenewalSettings" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "ChangeOffer" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "StartPaidService" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "SuspendEntitlement" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "CancelEntitlement" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "ActivateEntitlement" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "TransferEntitlements" }, + { "service": "google.cloud.channel.v1.CloudChannelService", "method": "TransferEntitlementsToGoogle" } + ], + "timeout": "60s" + }] +} diff --git a/google/cloud/channel/v1/cloudchannel_v1.yaml b/google/cloud/channel/v1/cloudchannel_v1.yaml new file mode 100644 index 00000000..9d2ecd63 --- /dev/null +++ b/google/cloud/channel/v1/cloudchannel_v1.yaml @@ -0,0 +1,34 @@ +type: google.api.Service +config_version: 3 +name: cloudchannel.googleapis.com +title: Cloud Channel API + +apis: +- name: google.cloud.channel.v1.CloudChannelService + +types: +- name: google.cloud.channel.v1.OperationMetadata +- name: google.cloud.channel.v1.TransferEntitlementsResponse + +http: + rules: + - selector: google.longrunning.Operations.CancelOperation + post: '/v1/{name=operations/**}:cancel' + body: '*' + - selector: google.longrunning.Operations.DeleteOperation + delete: '/v1/{name=operations/**}' + - selector: google.longrunning.Operations.GetOperation + get: '/v1/{name=operations/**}' + - selector: google.longrunning.Operations.ListOperations + get: '/v1/{name=operations}' + +authentication: + rules: + - selector: 'google.cloud.channel.v1.CloudChannelService.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/apps.order + - selector: 'google.longrunning.Operations.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/apps.order diff --git a/google/cloud/channel/v1/common.proto b/google/cloud/channel/v1/common.proto new file mode 100644 index 00000000..b75262ea --- /dev/null +++ b/google/cloud/channel/v1/common.proto @@ -0,0 +1,131 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Required Edu Attributes +message EduData { + // Enum to specify the institute type. + enum InstituteType { + // Default value. This state is never returned unless an error occurs. + INSTITUTE_TYPE_UNSPECIFIED = 0; + + // Elementary/ Secondary Schools & Districts + K12 = 1; + + // Higher Education Universities & Colleges + UNIVERSITY = 2; + } + + // Number of students/staff the institute has. + enum InstituteSize { + // Default value. This state is never returned unless an error occurs. + INSTITUTE_SIZE_UNSPECIFIED = 0; + + // 1 - 100 + SIZE_1_100 = 1; + + // 101 - 500 + SIZE_101_500 = 2; + + // 501 - 1,000 + SIZE_501_1000 = 3; + + // 1,001 - 2,000 + SIZE_1001_2000 = 4; + + // 2,001 - 5,000 + SIZE_2001_5000 = 5; + + // 5,001 - 10,000 + SIZE_5001_10000 = 6; + + // 10,001 + + SIZE_10001_OR_MORE = 7; + } + + // Designated institute type of customer. + InstituteType institute_type = 1; + + // Size of the institute. + InstituteSize institute_size = 2; + + // Web address for the edu customer's institution. + string website = 3; +} + +// Cloud Identity information for the Cloud Channel Customer. +message CloudIdentityInfo { + // CustomerType of the customer + enum CustomerType { + // Default value. This state is never returned unless an error occurs. + CUSTOMER_TYPE_UNSPECIFIED = 0; + + // Domain-owning customer which needs domain verification to use services. + DOMAIN = 1; + + // Team customer which needs email verification to use services. + TEAM = 2; + } + + // CustomerType indicates verification type needed for using services. + CustomerType customer_type = 1; + + // Output only. The primary domain name. + string primary_domain = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The alternate email. + string alternate_email = 6; + + // Phone number associated with the Cloud Identity. + string phone_number = 7; + + // Language code. + string language_code = 8; + + // Output only. URI of Customer's Admin console dashboard. + string admin_console_uri = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Edu information about the customer. + EduData edu_data = 22; +} + +// Data type and value of a parameter. +message Value { + // The kind of value. + oneof kind { + // Represents an int64 value. + int64 int64_value = 1; + + // Represents a string value. + string string_value = 2; + + // Represents a double value. + double double_value = 3; + + // Represents an 'Any' proto value. + google.protobuf.Any proto_value = 4; + } +} diff --git a/google/cloud/channel/v1/customers.proto b/google/cloud/channel/v1/customers.proto new file mode 100644 index 00000000..7cfb1835 --- /dev/null +++ b/google/cloud/channel/v1/customers.proto @@ -0,0 +1,113 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/postal_address.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "CustomersProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Entity representing a customer of a reseller or distributor. +message Customer { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Customer" + pattern: "accounts/{account}/customers/{customer}" + }; + + // Output only. Resource name of the customer. + // Format: accounts/{account_id}/customers/{customer_id} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Name of the organization that the customer entity represents. + string org_display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Address of the organization of the customer entity. + // Region and zip codes are required to enforce US laws and embargoes. + // Language code is discarded. Use the Customer-level language code to set the + // customer's language. + google.type.PostalAddress org_postal_address = 3 [(google.api.field_behavior) = REQUIRED]; + + // Primary contact info. + ContactInfo primary_contact_info = 4; + + // Secondary contact email. + // Alternate email and primary contact email are required to have different + // domains if primary contact email is present. + // When creating admin.google.com accounts, users get notified credentials at + // this email. This email address is also used as a recovery email. + string alternate_email = 5; + + // Required. Primary domain used by the customer. + // Domain of primary contact email is required to be same as the provided + // domain. + string domain = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time at which the customer is created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the customer is updated. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Customer's cloud_identity_id. + // Populated only if a Cloud Identity resource exists for this customer. + string cloud_identity_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + string language_code = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Cloud Identity information for the customer. + // Populated only if a Cloud Identity account exists for this customer. + CloudIdentityInfo cloud_identity_info = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud Identity ID of the customer's channel partner. + // Populated only if a channel partner exists for this customer. + string channel_partner_id = 13; +} + +// Contact information for a customer account. +message ContactInfo { + // First name of the contact in the customer account. + string first_name = 1; + + // Last name of the contact in the customer account. + string last_name = 2; + + // Output only. Display name of the contact in the customer account. + // Populated by combining customer first name and last name. + string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Email of the contact in the customer account. + // Email is required for entitlements that need creation of admin.google.com + // accounts. The email will be the username used in credentials to access the + // admin.google.com account. + string email = 5; + + // Optional. Job title of the contact in the customer account. + string title = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Phone number of the contact in the customer account. + string phone = 7; +} diff --git a/google/cloud/channel/v1/entitlements.proto b/google/cloud/channel/v1/entitlements.proto new file mode 100644 index 00000000..b4c19944 --- /dev/null +++ b/google/cloud/channel/v1/entitlements.proto @@ -0,0 +1,247 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/cloud/channel/v1/offers.proto"; +import "google/cloud/channel/v1/products.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "EntitlementsProto"; +option java_package = "com.google.cloud.channel.v1"; + +// An entitlement represents an entity which provides a customer means to start +// using a service. +message Entitlement { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Entitlement" + pattern: "accounts/{account}/customers/{customer}/entitlements/{entitlement}" + }; + + // Indicates the current provisioning state of the entitlement. + enum ProvisioningState { + // Default value. This state is never returned unless an error occurs. + PROVISIONING_STATE_UNSPECIFIED = 0; + + // The entitlement is currently active. + ACTIVE = 1; + + // The entitlement is currently suspended. + SUSPENDED = 5; + } + + // Suspension reason for an entitlement if [provisioning_state][google.cloud.channel.v1.Entitlement.provisioning_state] = SUSPENDED. + enum SuspensionReason { + // Default value. This state is never returned unless an error occurs. + SUSPENSION_REASON_UNSPECIFIED = 0; + + // Entitlement was manually suspended by the Reseller. + RESELLER_INITIATED = 1; + + // Trial ended. + TRIAL_ENDED = 2; + + // Entitlement renewal was canceled. + RENEWAL_WITH_TYPE_CANCEL = 3; + + // Entitlement was automatically suspended on creation for pending ToS + // acceptance on customer. + PENDING_TOS_ACCEPTANCE = 4; + + // Other reasons (internal reasons, abuse, etc.). + OTHER = 100; + } + + // Output only. Resource name of an entitlement in the form: + // + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the entitlement is created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the entitlement is updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The offer resource name for which the entitlement is to be + // created. Takes the form: accounts/{account_id}/offers/{offer_id}. + string offer = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Offer" + } + ]; + + // Commitment settings for a commitment-based Offer. + // Required for commitment based offers. + CommitmentSettings commitment_settings = 12; + + // Output only. Current provisioning state of the entitlement. + ProvisioningState provisioning_state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service provisioning details for the entitlement. + ProvisionedService provisioned_service = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Enumerable of all current suspension reasons for an entitlement. + repeated SuspensionReason suspension_reasons = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This purchase order (PO) information is for resellers to use for their + // company tracking usage. If a purchaseOrderId value is given, it appears in + // the API responses and shows up in the invoice. The property accepts up to + // 80 plain text characters. + string purchase_order_id = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Settings for trial offers. + TrialSettings trial_settings = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Association information to other entitlements. + AssociationInfo association_info = 23; + + // Extended entitlement parameters. When creating an entitlement, valid + // parameters' names and values are defined in the offer's parameter + // definitions. + repeated Parameter parameters = 26; +} + +// Definition for extended entitlement parameters. +message Parameter { + // Name of the parameter. + string name = 1; + + // Value of the parameter. + Value value = 2; + + // Output only. Specifies whether this parameter is allowed to be changed. For example, for + // a Google Workspace Business Starter entitlement in commitment plan, + // num_units is editable when entitlement is active. + bool editable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Association links that an entitlement has to other entitlements. +message AssociationInfo { + // The name of the base entitlement, for which this entitlement is an add-on. + string base_entitlement = 1 [(google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Entitlement" + }]; +} + +// Service provisioned for an entitlement. +message ProvisionedService { + // Output only. Provisioning ID of the entitlement. For Google Workspace, this would be the + // underlying Subscription ID. + string provisioning_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The product pertaining to the provisioning resource as specified in the + // Offer. + string product_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The SKU pertaining to the provisioning resource as specified in the Offer. + string sku_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Commitment settings for commitment-based offers. +message CommitmentSettings { + // Output only. Commitment start timestamp. + google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Commitment end timestamp. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Renewal settings applicable for a commitment-based Offer. + RenewalSettings renewal_settings = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Renewal settings for renewable Offers. +message RenewalSettings { + // If false, the plan will be completed at the end date. + bool enable_renewal = 1; + + // If true and enable_renewal = true, the unit (for example seats or licenses) + // will be set to the number of active units at renewal time. + bool resize_unit_count = 2; + + // Describes how a reseller will be billed. + PaymentPlan payment_plan = 5; + + // Describes how frequently the reseller will be billed, such as + // once per month. + Period payment_cycle = 6; +} + +// Settings for trial offers. +message TrialSettings { + // Determines if the entitlement is in a trial or not: + // + // * `true` - The entitlement is in trial. + // * `false` - The entitlement is not in trial. + bool trial = 1; + + // Date when the trial ends. The value is in milliseconds + // using the UNIX Epoch format. See an example [Epoch + // converter](https://www.epochconverter.com). + google.protobuf.Timestamp end_time = 2; +} + +// TransferableSku represents information a reseller needs to view existing +// provisioned services for a customer that they do not own. +// Read-only. +message TransferableSku { + // Whether a transferable SKU is commitment-based or not. + google.protobuf.BoolValue is_commitment = 6; + + // Commitment end timestamp. + google.protobuf.Timestamp commitment_end_timestamp = 7; + + // Describes the transfer eligibility of a SKU. + TransferEligibility transfer_eligibility = 9; + + // The SKU pertaining to the provisioning resource as specified in the Offer. + Sku sku = 11; +} + +// Specifies transfer eligibility of a SKU. +message TransferEligibility { + // Reason of ineligibility. + enum Reason { + // Reason is not available. + REASON_UNSPECIFIED = 0; + + // Reseller needs to accept TOS before transferring the SKU. + PENDING_TOS_ACCEPTANCE = 1; + + // Reseller not eligible to sell the SKU. + SKU_NOT_ELIGIBLE = 2; + + // SKU subscription is suspended + SKU_SUSPENDED = 3; + } + + // Whether reseller is eligible to transfer the SKU. + bool is_eligible = 1; + + // Localized description if reseller is not eligible to transfer the SKU. + string description = 2; + + // Specified the reason for ineligibility. + Reason ineligibility_reason = 3; +} diff --git a/google/cloud/channel/v1/offers.proto b/google/cloud/channel/v1/offers.proto new file mode 100644 index 00000000..c057a3b7 --- /dev/null +++ b/google/cloud/channel/v1/offers.proto @@ -0,0 +1,325 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/cloud/channel/v1/products.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/money.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "OffersProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Constraints type for Promotional offers. +enum PromotionalOrderType { + // Not used. + PROMOTIONAL_TYPE_UNSPECIFIED = 0; + + // Order used for net new customers, trial conversions and upgrades. + NEW_UPGRADE = 1; + + // All orders for an existing customer transferring to the reseller. + TRANSFER = 2; + + // Orders for an existing customer switching from one promotion to another + // (can be addition/removal of a promotion as well) on the same sku. + PROMOTION_SWITCH = 3; +} + +// Describes how the reseller will be billed. +enum PaymentPlan { + // Not used. + PAYMENT_PLAN_UNSPECIFIED = 0; + + // Commitment. + COMMITMENT = 1; + + // No commitment. + FLEXIBLE = 2; + + // Free. + FREE = 3; + + // Trial. + TRIAL = 4; + + // Price and ordering not available through API. + OFFLINE = 5; +} + +// Specifies when the payment needs to happen. +enum PaymentType { + // Not used. + PAYMENT_TYPE_UNSPECIFIED = 0; + + // Prepay. Amount has to be paid before service is rendered. + PREPAY = 1; + + // Postpay. Reseller is charged at the end of the Payment cycle. + POSTPAY = 2; +} + +// Represents monetizable resource's type. +// A monetizable resource is an entity on which billing happens. For example, +// this could be MINUTES for Google Voice and GB for Google Drive. One SKU can +// map to multiple monetizable resources. +enum ResourceType { + // Not used. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Seat. + SEAT = 1; + + // Monthly active user. + MAU = 2; + + // GB (used for storage SKUs). + GB = 3; + + // Active licensed users(for Voice SKUs). + LICENSED_USER = 4; + + // Voice usage. + MINUTES = 5; + + // For IaaS SKUs like Google Cloud Platform, monetization is based on usage + // accrued on your billing account irrespective of the type of monetizable + // resource. This enum represents an aggregated resource/container for all + // usage SKUs on a billing account. Currently, only applicable to Google Cloud + // Platform. + IAAS_USAGE = 6; + + // For Google Cloud Platform subscriptions like Anthos or SAP. + SUBSCRIPTION = 7; +} + +// Period Type. +enum PeriodType { + // Not used. + PERIOD_TYPE_UNSPECIFIED = 0; + + // Day. + DAY = 1; + + // Month. + MONTH = 2; + + // Year. + YEAR = 3; +} + +// Represents an offer made to resellers for purchase. +// An offer is associated with a [Sku][google.cloud.channel.v1.Sku], has a plan for payment, a price, and +// defines the constraints for buying. +message Offer { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Offer" + pattern: "accounts/{account}/offers/{offer}" + }; + + // Resource Name of the Offer. + // Format: accounts/{account_id}/offers/{offer_id} + string name = 1; + + // Marketing information for the Offer. + MarketingInfo marketing_info = 2; + + // SKU the offer is associated with. + Sku sku = 3; + + // Describes the payment plan for the Offer. + Plan plan = 4; + + // Constraints on transacting the Offer. + Constraints constraints = 5; + + // Price for each monetizable resource type. + repeated PriceByResource price_by_resources = 6; + + // Start of the Offer validity time. + google.protobuf.Timestamp start_time = 7; + + // Output only. End of the Offer validity time. + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Parameters required to use current Offer to purchase. + repeated ParameterDefinition parameter_definitions = 9; +} + +// Parameter's definition. Specifies what parameter is required to use the +// current Offer to purchase. +message ParameterDefinition { + // Data type of the parameter. + enum ParameterType { + // Not used. + PARAMETER_TYPE_UNSPECIFIED = 0; + + // Int64 type. + INT64 = 1; + + // String type. + STRING = 2; + + // Double type. + DOUBLE = 3; + } + + // Name of the parameter. + string name = 1; + + // Data type of the parameter. Minimal value, Maximum value and allowed values + // will use specified data type here. + ParameterType parameter_type = 2; + + // Minimal value of the parameter, if applicable. Inclusive. For example, + // minimal commitment when purchasing Anthos is 0.01. + // Applicable to INT64 and DOUBLE parameter types. + Value min_value = 3; + + // Maximum value of the parameter, if applicable. Inclusive. For example, + // maximum seats when purchasing Google Workspace Business Standard. + // Applicable to INT64 and DOUBLE parameter types. + Value max_value = 4; + + // If not empty, parameter values must be drawn from this list. + // For example, [us-west1, us-west2, ...] + // Applicable to STRING parameter type. + repeated Value allowed_values = 5; + + // If set to true, parameter is optional to purchase this Offer. + bool optional = 6; +} + +// Represents the constraints for buying the Offer. +message Constraints { + // Represents constraints on a customer required for purchasing this Offer + // for that customer. + CustomerConstraints customer_constraints = 1; +} + +// Represents constraints on a customer required for purchasing this Offer for +// that customer. +message CustomerConstraints { + // Allowed geographical regions of the customer. + repeated string allowed_regions = 1; + + // Allowed Customer Type. + repeated CloudIdentityInfo.CustomerType allowed_customer_types = 2; + + // Allowed Promotional Order Type. Present for Promotional offers. + repeated PromotionalOrderType promotional_order_types = 3; +} + +// The payment plan for the Offer, describing how a payment is made. +message Plan { + // Describes how a reseller will be billed. + PaymentPlan payment_plan = 1; + + // Specifies when the payment needs to happen. + PaymentType payment_type = 2; + + // Describes how frequently the reseller will be billed, such as + // once per month. + Period payment_cycle = 3; + + // Present for Offers with a trial period. + // For trial-only Offers, a paid service needs to be started before the trial + // period ends for continued service. + // For Regular Offers with an initial trial period, the regular pricing will + // take effect after the trial period ends, or if paid service is started + // before the end of the trial period. + Period trial_period = 4; +} + +// Represents price by resource type. +message PriceByResource { + // Resource Type. Example: SEAT + ResourceType resource_type = 1; + + // Price of the Offer. Present if there are no price phases. + Price price = 2; + + // Specifies the price by time range. + repeated PricePhase price_phases = 3; +} + +// Represents the price of the Offer. +message Price { + // Base price. + google.type.Money base_price = 1; + + // Discount percentage, represented as decimal. + // For example, a 20% discount will be represent as 0.2. + double discount = 2; + + // Effective Price after applying the discounts. + google.type.Money effective_price = 3; + + // Link to external price list, such as link to Google Voice rate card. + string external_price_uri = 4; +} + +// Specifies the price by the duration of months. +// For example, for the first 6 months, 20% discount. From the seventh month, +// 10% discount. +message PricePhase { + // Defines the phase period type. + PeriodType period_type = 1; + + // Defines first period for the phase. + int32 first_period = 2; + + // Defines first period for the phase. + int32 last_period = 3; + + // Price of the phase. Present if there are no price tiers. + Price price = 4; + + // Price by the resource tiers. + repeated PriceTier price_tiers = 5; +} + +// Defines price at resource tier level. +// For example, an offer with following definition : +// Tier 1: Provide 25% discount for all seats between 1 and 25. +// Tier 2: Provide 10% discount for all seats between 26 and 100. +// Tier 3: Provide flat 15% discount for all seats above 100. +// Each of these tiers is represented as a PriceTier. +message PriceTier { + // First resource for which the tier price applies. + int32 first_resource = 1; + + // Last resource for which the tier price applies. + int32 last_resource = 2; + + // Price of the tier. + Price price = 3; +} + +// Represents period in days/months/years. +message Period { + // Total duration of Period Type defined. + int32 duration = 1; + + // Period Type. + PeriodType period_type = 2; +} diff --git a/google/cloud/channel/v1/operations.proto b/google/cloud/channel/v1/operations.proto new file mode 100644 index 00000000..239d85f0 --- /dev/null +++ b/google/cloud/channel/v1/operations.proto @@ -0,0 +1,69 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "OperationsProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Provides contextual information about a [google.longrunning.Operation][google.longrunning.Operation]. +message OperationMetadata { + // RPCs that return a Long Running Operation. + enum OperationType { + // Default value. This state is never returned unless an error occurs. + OPERATION_TYPE_UNSPECIFIED = 0; + + // Long Running Operation was triggered by CreateEntitlement. + CREATE_ENTITLEMENT = 1; + + // Long Running Operation was triggered by ChangeRenewalSettings. + CHANGE_RENEWAL_SETTINGS = 3; + + // Long Running Operation was triggered by StartPaidService. + START_PAID_SERVICE = 5; + + // Long Running Operation was triggered by ActivateEntitlement. + ACTIVATE_ENTITLEMENT = 7; + + // Long Running Operation was triggered by SuspendEntitlement. + SUSPEND_ENTITLEMENT = 8; + + // Long Running Operation was triggered by CancelEntitlement. + CANCEL_ENTITLEMENT = 9; + + // Long Running Operation was triggered by TransferEntitlements. + TRANSFER_ENTITLEMENTS = 10; + + // Long Running Operation was triggered by TransferEntitlementsToGoogle. + TRANSFER_ENTITLEMENTS_TO_GOOGLE = 11; + + // Long Running Operation was triggered by ChangeOffer. + CHANGE_OFFER = 14; + + // Long Running Operation was triggered by ChangeParameters. + CHANGE_PARAMETERS = 15; + + // Long Running Operation was triggered by ProvisionCloudIdentity. + PROVISION_CLOUD_IDENTITY = 16; + } + + // The RPC that initiated this Long Running Operation. + OperationType operation_type = 1; +} diff --git a/google/cloud/channel/v1/products.proto b/google/cloud/channel/v1/products.proto new file mode 100644 index 00000000..219904ad --- /dev/null +++ b/google/cloud/channel/v1/products.proto @@ -0,0 +1,96 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/resource.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "ProductsProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Type of media used. +enum MediaType { + // Not used. + MEDIA_TYPE_UNSPECIFIED = 0; + + // Type of image. + MEDIA_TYPE_IMAGE = 1; +} + +// Product is the entity that the customer is entitled to use when an order is +// placed. +// Example of products are Google Workspace, Google Voice, etc. +message Product { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Product" + pattern: "products/{product}" + }; + + // Resource Name of the Product. + // Format: products/{product_id} + string name = 1; + + // Marketing information for the product. + MarketingInfo marketing_info = 2; +} + +// Represents a purchasable Stock Keeping Unit (SKU) under a product. +// SKUs represent the different variations of the product. For example, Google +// Workspace Business Standard, Google Workspace Business Plus are SKUs of +// Google Workspace product. +message Sku { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Sku" + pattern: "products/{product}/skus/{sku}" + }; + + // Resource Name of the SKU. + // Format: products/{product_id}/skus/{sku_id} + string name = 1; + + // Marketing information for the SKU. + MarketingInfo marketing_info = 2; + + // Product the SKU is associated with. + Product product = 3; +} + +// Represents a Product/SKU/Offer’s marketing information. +message MarketingInfo { + // Human readable name. + string display_name = 1; + + // Human readable description. Description can contain HTML. + string description = 2; + + // Default logo. + Media default_logo = 3; +} + +// Represents media information. +message Media { + // Title of the media. + string title = 1; + + // URL of the media. + string content = 2; + + // Type of the media. + MediaType type = 3; +} diff --git a/google/cloud/channel/v1/service.proto b/google/cloud/channel/v1/service.proto new file mode 100644 index 00000000..ffb6835b --- /dev/null +++ b/google/cloud/channel/v1/service.proto @@ -0,0 +1,1674 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// 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"; + +package google.cloud.channel.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/channel_partner_links.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/cloud/channel/v1/customers.proto"; +import "google/cloud/channel/v1/entitlements.proto"; +import "google/cloud/channel/v1/offers.proto"; +import "google/cloud/channel/v1/products.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.channel.v1"; + +// CloudChannelService enables Google cloud resellers and distributors to manage +// their customers, channel partners, entitlements and reports. +// +// Using this service: +// 1. Resellers or distributors can manage a customer entity. +// 2. Distributors can register an authorized reseller in their channel and then +// enable delegated admin access for the reseller. +// 3. Resellers or distributors can manage entitlements for their customers. +// +// The service primarily exposes the following resources: +// - [Customer][google.cloud.channel.v1.Customer]s: A Customer represents an entity managed by a reseller or +// distributor. A customer typically represents an enterprise. In an n-tier +// resale channel hierarchy, customers are generally represented as leaf nodes. +// Customers primarily have an Entitlement sub-resource discussed below. +// +// - [Entitlement][google.cloud.channel.v1.Entitlement]s: An Entitlement represents an entity which provides a +// customer means to start using a service. Entitlements are created or updated +// as a result of a successful fulfillment. +// +// - [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s: A ChannelPartnerLink is an entity that identifies +// links between distributors and their indirect resellers in a channel. +service CloudChannelService { + option (google.api.default_host) = "cloudchannel.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/apps.order"; + + // List downstream [Customer][google.cloud.channel.v1.Customer]s. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the reseller account making the request and the + // reseller account being queried for, are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // + // Return Value: + //
List of [Customer][google.cloud.channel.v1.Customer]s pertaining to the reseller or empty list if + // there are none. + rpc ListCustomers(ListCustomersRequest) returns (ListCustomersResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/customers" + }; + } + + // Returns a requested [Customer][google.cloud.channel.v1.Customer] resource. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the reseller account making the request and the + // reseller account being queried for, are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: If the customer resource doesn't exist. Usually + // the result of an invalid name parameter. + // + // Return Value: + //
[Customer][google.cloud.channel.v1.Customer] resource if found, error otherwise. + rpc GetCustomer(GetCustomerRequest) returns (Customer) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/customers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Confirms the existence of Cloud Identity accounts, based on the domain and + // whether the Cloud Identity accounts are owned by the reseller. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the reseller account making the request and the + // reseller account being queried for, are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * INVALID_VALUE: Invalid domain value in the request. + // * NOT_FOUND: If there is no [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] customer + // for the domain specified in the request. + // + // Return Value: + //
List of [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] resources if any exist for + // the domain, otherwise an error is returned. + rpc CheckCloudIdentityAccountsExist(CheckCloudIdentityAccountsExistRequest) returns (CheckCloudIdentityAccountsExistResponse) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}:checkCloudIdentityAccountsExist" + body: "*" + }; + } + + // Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor + // account. + // + // Possible Error Codes: + // + // + // Return Value: + //
If successful, the newly created [Customer][google.cloud.channel.v1.Customer] resource, otherwise + // returns an error. + rpc CreateCustomer(CreateCustomerRequest) returns (Customer) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}/customers" + body: "customer" + }; + option (google.api.method_signature) = "parent,customer"; + } + + // Updates an existing [Customer][google.cloud.channel.v1.Customer] resource belonging to the reseller or + // distributor. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the reseller account making the request and the + // reseller account being queried for, are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name + // specified in the request. + // + // Return Value: + //
If successful, the updated [Customer][google.cloud.channel.v1.Customer] resource, otherwise returns + // an error. + rpc UpdateCustomer(UpdateCustomerRequest) returns (Customer) { + option (google.api.http) = { + patch: "/v1/{customer.name=accounts/*/customers/*}" + body: "customer" + }; + option (google.api.method_signature) = "customer,update_mask"; + } + + // Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request does not own + // this customer. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * FAILED_PRECONDITION: If the customer has existing entitlements. + // * NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name + // specified in the request. + rpc DeleteCustomer(DeleteCustomerRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accounts/*/customers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the request. + // + // Return Value: + //
List of [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to the customer, or empty list if + // there are none. + rpc ListEntitlements(ListEntitlementsRequest) returns (ListEntitlementsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*/customers/*}/entitlements" + }; + } + + // List [TransferableSku][google.cloud.channel.v1.TransferableSku]s of a customer based on Cloud Identity ID or + // Customer Name in the request. + // + // This method is used when a reseller lists the entitlements + // information of a customer that is not owned. The reseller should provide + // the customer's Cloud Identity ID or Customer Name. + // + // Possible Error Codes: + // + // + // Return Value: + //
List of [TransferableSku][google.cloud.channel.v1.TransferableSku] for the given customer. + rpc ListTransferableSkus(ListTransferableSkusRequest) returns (ListTransferableSkusResponse) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}:listTransferableSkus" + body: "*" + }; + } + + // List [TransferableOffer][google.cloud.channel.v1.TransferableOffer]s of a customer based on Cloud Identity ID or + // Customer Name in the request. + // + // This method is used when a reseller gets the entitlement + // information of a customer that is not owned. The reseller should provide + // the customer's Cloud Identity ID or Customer Name. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED, due to one of the following reasons: (a) If the + // customer doesn't belong to the reseller and no auth token or invalid auth + // token is supplied. (b) If the reseller account making the request and the + // reseller account being queried for are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // + // Return Value: + // List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. + rpc ListTransferableOffers(ListTransferableOffersRequest) returns (ListTransferableOffersResponse) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}:listTransferableOffers" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: If the entitlement is not found for the customer. + // + // Return Value: + //
If found, the requested [Entitlement][google.cloud.channel.v1.Entitlement] resource, otherwise returns + // an error. + rpc GetEntitlement(GetEntitlementRequest) returns (Entitlement) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/customers/*/entitlements/*}" + }; + } + + // Creates entitlement for a customer. + // + // Possible Error Codes: + // + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc CreateEntitlement(CreateEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/customers/*}/entitlements" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Change parameters of the entitlement + // + // An entitlement parameters update is a long-running operation and results in + // updates to the entitlement as a result of fulfillment. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. For example, if the number of seats being changed to is greater + // than the allowed number of max seats for the resource. Or decreasing seats + // for a commitment based plan. + // * NOT_FOUND: Entitlement resource not found. + // * INTERNAL: Any non-user error related to a technical issue + // in the backend. In this case, contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // In this case, contact Cloud Channel support. + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ChangeParameters(ChangeParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeParameters" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Updates the renewal settings for an existing customer entitlement. + // + // An entitlement update is a long-running operation and results in updates to + // the entitlement as a result of fulfillment. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: Entitlement resource not found. + // * NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a + // commitment plan. Can't enable or disable renewal for non-commitment plans. + // * INTERNAL: Any non user error related to a technical issue in the + // backend. In this case, contact cloud channel support. + // * UNKNOWN: Any non user error related to a technical issue in the backend. + // In this case, contact cloud channel support. + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ChangeRenewalSettings(ChangeRenewalSettingsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeRenewalSettings" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Updates the Offer for an existing customer entitlement. + // + // An entitlement update is a long-running operation and results in updates to + // the entitlement as a result of fulfillment. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: Offer or Entitlement resource not found. + // * INTERNAL: Any non-user error related to a technical issue in the backend. + // In this case, contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // In this case, contact Cloud Channel support. + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ChangeOffer(ChangeOfferRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeOffer" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Starts paid service for a trial entitlement. + // + // Starts paid service for a trial entitlement immediately. This method is + // only applicable if a plan has already been set up for a trial entitlement + // but has some trial days remaining. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: Entitlement resource not found. + // * FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for + // entitlement on trial plans. + // * INTERNAL: Any non-user error related to a technical issue in the backend. + // In this case, contact cloud channel support. + // * UNKNOWN: Any non-user error related to a technical issue + // in the backend. In this case, contact cloud channel support. + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc StartPaidService(StartPaidServiceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:startPaidService" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Suspends a previously fulfilled entitlement. + // An entitlement suspension is a long-running operation. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: Entitlement resource not found. + // * NOT_ACTIVE: Entitlement is not active. + // * INTERNAL: Any non-user error related to a technical issue in the backend. + // In this case, contact cloud channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // In this case, contact cloud channel support. + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc SuspendEntitlement(SuspendEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:suspend" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Cancels a previously fulfilled entitlement. + // An entitlement cancellation is a long-running operation. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller or + // if the reseller account making the request and reseller account being + // queried for are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: Entitlement resource not found. + // * DELETION_TYPE_NOT_ALLOWED: Cancel isn't allowed for top + // level SKUs. Cancel is only allowed for add-ons. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. In this case, contact cloud channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // In this case, contact cloud channel support. + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The response will contain + // google.protobuf.Empty on success. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc CancelEntitlement(CancelEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:cancel" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Activates a previously suspended entitlement. Entitlement must be in a + // suspended state for it to be activated. Entitlements suspended for pending + // ToS acceptance can't be activated via this method. An entitlement + // activation is a long-running operation and can result in updates to + // the state of the customer entitlement. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller or + // if the reseller account making the request and reseller account being + // queried for are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: Entitlement resource not found. + // * SUSPENSION_NOT_RESELLER_INITIATED: Can't activate an + // entitlement that is pending TOS acceptance. Only reseller initiated + // suspensions can be activated. + // * NOT_SUSPENDED: Can't activate entitlements that are already in ACTIVE + // state. Can only activate suspended entitlements. + // * INTERNAL: Any non-user error related to a technical issue + // in the backend. In this case, contact cloud channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // In this case, contact cloud channel support. + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ActivateEntitlement(ActivateEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:activate" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Transfers customer entitlements to new reseller. + // + // Possible Error Codes: + // + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc TransferEntitlements(TransferEntitlementsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/customers/*}:transferEntitlements" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "TransferEntitlementsResponse" + metadata_type: "OperationMetadata" + }; + } + + // Transfers customer entitlements from current reseller to Google. + // + // Possible Error Codes: + // + // + // Return Value: + //
Long Running Operation ID. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The response will contain + // google.protobuf.Empty on success. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc TransferEntitlementsToGoogle(TransferEntitlementsToGoogleRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/customers/*}:transferEntitlementsToGoogle" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s belonging to a distributor. + // To call this method, you must be a distributor. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the reseller account making the request and the + // reseller account being queried for are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // + // Return Value: + //
If successful, returns the list of [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resources + // for the distributor account, otherwise returns an error. + rpc ListChannelPartnerLinks(ListChannelPartnerLinksRequest) returns (ListChannelPartnerLinksResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/channelPartnerLinks" + }; + } + + // Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + // To call this method, you must be a distributor. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the reseller account making the request and the + // reseller account being queried for, are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * NOT_FOUND: ChannelPartnerLink resource not found. Results + // due invalid channel partner link name. + // + // Return Value: + //
[ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource if found, otherwise returns an error. + rpc GetChannelPartnerLink(GetChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/channelPartnerLinks/*}" + }; + } + + // Initiates a channel partner link between a distributor and a reseller or + // between resellers in an n-tier reseller channel. + // To accept the invite, the invited partner should follow the invite_link_uri + // provided in the response. If the link creation is accepted, a valid link is + // set up between the two involved parties. + // To call this method, you must be a distributor. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the reseller account making the request and the + // reseller account being queried for, are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + // * ALREADY_EXISTS: If the ChannelPartnerLink sent in the request already + // exists. + // * NOT_FOUND: If no Cloud Identity customer exists for domain provided. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. In this case, contact cloud channel support. + // * UNKNOWN: Any non-user error related to a technical issue in + // the backend. In this case, contact cloud channel support. + // + // Return Value: + //
Newly created [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource if successful, + // otherwise error is returned. + rpc CreateChannelPartnerLink(CreateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}/channelPartnerLinks" + body: "channel_partner_link" + }; + } + + // Updates a channel partner link. A distributor calls this method to change a + // link's status. For example, suspend a partner link. + // To call this method, you must be a distributor. + // + // Possible Error Codes: + // + // + // Return Value: + //
If successful, the updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource, otherwise + // returns an error. + rpc UpdateChannelPartnerLink(UpdateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + option (google.api.http) = { + patch: "/v1/{name=accounts/*/channelPartnerLinks/*}" + body: "*" + }; + } + + // Lists the Products the reseller is authorized to sell. + // + // Possible Error Codes: + // + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { + option (google.api.http) = { + get: "/v1/products" + }; + } + + // Lists the Purchasable SKUs for following use cases: + // (a) SKUs that can be newly purchased for a customer + // (b) SKUs that can be upgraded/downgraded to, for an entitlement. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + rpc ListPurchasableSkus(ListPurchasableSkusRequest) returns (ListPurchasableSkusResponse) { + option (google.api.http) = { + get: "/v1/{customer=accounts/*/customers/*}:listPurchasableSkus" + }; + } + + // Lists the Purchasable Offers for the following use cases: + // (a) Offers that can be newly purchased for a customer + // (b) Offers that can be changed to, for an entitlement. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the customer doesn't belong to the reseller + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. + rpc ListPurchasableOffers(ListPurchasableOffersRequest) returns (ListPurchasableOffersResponse) { + option (google.api.http) = { + get: "/v1/{customer=accounts/*/customers/*}:listPurchasableOffers" + }; + } +} + +// Request message for [CloudChannelService.CheckCloudIdentityAccountsExist][google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist]. +message CheckCloudIdentityAccountsExistRequest { + // Required. The resource name of the reseller account. + // The parent takes the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Domain for which the Cloud Identity account customer is fetched. + string domain = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Entity representing a Cloud Identity account which may or may not be +// associated with a Channel Services API partner. +message CloudIdentityCustomerAccount { + // True if a Cloud Identity account exists for a specific domain. + bool existing = 1; + + // True if the Cloud Identity account is associated with a customer + // belonging to the Channel Services partner making the API call. + bool owned = 2; + + // Name of the customer that owns the Cloud Identity account. This field is + // populated ONLY if owned = true. + // The customer_name takes the format: + // accounts/{account_id}/customers/{customer_id} + string customer_name = 3; + + // Cloud Identity ID of the customer. This field is populated ONLY if + // existing = true. + string customer_cloud_identity_id = 4; +} + +// Response message for +// [CloudChannelService.CheckCloudIdentityAccountsExist][google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist]. +message CheckCloudIdentityAccountsExistResponse { + // The Cloud Identity accounts associated with the domain. + repeated CloudIdentityCustomerAccount cloud_identity_accounts = 1; +} + +// Request message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] +message ListCustomersRequest { + // Required. The resource name of the reseller account from which to list customers. + // The parent takes the format: accounts/{account_id}. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of customers to return. The service may return fewer + // than this value. If unspecified, at most 10 customers will be returned. The + // maximum value is 50; values about 50 will be coerced to 50. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results, if other than the first one. + // Typically obtained via + // [ListCustomersResponse.next_page_token][google.cloud.channel.v1.ListCustomersResponse.next_page_token] of the previous + // [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers]. +message ListCustomersResponse { + // The customers belonging to the reseller or distributor. + repeated Customer customers = 1; + + // A token to retrieve the next page of results. + // Pass to [ListCustomersRequest.page_token][google.cloud.channel.v1.ListCustomersRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.GetCustomer][google.cloud.channel.v1.CloudChannelService.GetCustomer]. +message GetCustomerRequest { + // Required. The resource name of the customer to retrieve. + // The name takes the format: accounts/{account_id}/customers/{customer_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; +} + +// Request message for [CloudChannelService.CreateCustomer][google.cloud.channel.v1.CloudChannelService.CreateCustomer] +message CreateCustomerRequest { + // Required. The resource name of reseller account in which to create the customer. + // The parent takes the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The customer to create. + Customer customer = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.UpdateCustomer][google.cloud.channel.v1.CloudChannelService.UpdateCustomer]. +message UpdateCustomerRequest { + // Required. New contents of the customer. + Customer customer = 2 [(google.api.field_behavior) = REQUIRED]; + + // The update mask that applies to the resource. + // Optional. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for [CloudChannelService.DeleteCustomer][google.cloud.channel.v1.CloudChannelService.DeleteCustomer]. +message DeleteCustomerRequest { + // Required. The resource name of the customer to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; +} + +// Request message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] +message ListEntitlementsRequest { + // Required. The resource name of the reseller's customer account for which to list + // entitlements. + // The parent takes the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, at most 50 entitlements will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results, if other than the first one. + // Typically obtained via + // [ListEntitlementsResponse.next_page_token][google.cloud.channel.v1.ListEntitlementsResponse.next_page_token] of the previous + // [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements]. +message ListEntitlementsResponse { + // The entitlements belonging to the reseller's customer. + repeated Entitlement entitlements = 1; + + // A token to List next page of results. + // Pass to [ListEntitlementsRequest.page_token][google.cloud.channel.v1.ListEntitlementsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus] +message ListTransferableSkusRequest { + // Specifies the identity of transferred customer. + // Either a cloud_identity_id of the customer OR the customer name is + // required to look up transferable SKUs. + oneof transferred_customer_identity { + // Customer's Cloud Identity ID + string cloud_identity_id = 4; + + // A reseller is required to create a customer and use the resource name of + // the created customer here. + // The customer_name takes the format: + // accounts/{account_id}/customers/{customer_id} + string customer_name = 7; + } + + // Required. The resource name of the reseller's account. + // The parent takes the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Requested page size. Server might return fewer results than requested. + // If unspecified, at most 100 SKUs will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + // Optional. + int32 page_size = 2; + + // A token identifying a page of results, if other than the first one. + // Typically obtained via + // [ListTransferableSkusResponse.next_page_token][google.cloud.channel.v1.ListTransferableSkusResponse.next_page_token] of the previous + // [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus] call. + // Optional. + string page_token = 3; + + // This token is generated by the Super Admin of the resold customer to + // authorize a reseller to access their Cloud Identity and purchase + // entitlements on their behalf. This token can be omitted once the + // authorization is generated. See https://support.google.com/a/answer/7643790 + // for more details. + string auth_token = 5; + + // The BCP-47 language code, such as "en-US". If specified, the + // response will be localized to the corresponding language code. Default is + // "en-US". + // Optional. + string language_code = 6; +} + +// Response message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus]. +message ListTransferableSkusResponse { + // Information about existing SKUs for a customer that would need to be + // transferred. + repeated TransferableSku transferable_skus = 1; + + // A token to retrieve the next page of results. + // Pass to [ListTransferableSkusRequest.page_token][google.cloud.channel.v1.ListTransferableSkusRequest.page_token] to obtain + // that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers] +message ListTransferableOffersRequest { + // Specifies the identity of transferred customer. + // Either a cloud_identity_id of the customer OR the customer name is + // required to look up transferrable Offers. + oneof transferred_customer_identity { + // Customer's Cloud Identity ID + string cloud_identity_id = 4; + + // A reseller should create a customer and use the resource name of + // the created customer here. + string customer_name = 5; + } + + // Required. The resource name of the reseller's account. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Requested page size. Server might return fewer results than requested. + // If unspecified, at most 100 Offers will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A token identifying a page of results, if other than the first one. + // Typically obtained via + // [ListTransferableOffersResponse.next_page_token][google.cloud.channel.v1.ListTransferableOffersResponse.next_page_token] of the previous + // [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers] call. + string page_token = 3; + + // Required. SKU for which the Offers are being looked up. + string sku = 6 [(google.api.field_behavior) = REQUIRED]; + + // The BCP-47 language code, such as "en-US". If specified, the + // response will be localized to the corresponding language code. Default is + // "en-US". + string language_code = 7; +} + +// Response message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers]. +message ListTransferableOffersResponse { + // Information about Offers for a customer that can be used for + // transfer. + repeated TransferableOffer transferable_offers = 1; + + // A token to retrieve the next page of results. + // Pass to [ListTransferableOffersRequest.page_token][google.cloud.channel.v1.ListTransferableOffersRequest.page_token] to obtain + // that page. + string next_page_token = 2; +} + +// TransferableOffer represents an Offer that can be used in Transfer. +// Read-only. +message TransferableOffer { + // Offer with parameter constraints updated to allow the Transfer. + Offer offer = 1; +} + +// Request message for [CloudChannelService.GetEntitlement][google.cloud.channel.v1.CloudChannelService.GetEntitlement]. +message GetEntitlementRequest { + // Required. The resource name of the entitlement to retrieve. + // The name takes the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Entitlement" + } + ]; +} + +// Request message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] +message ListChannelPartnerLinksRequest { + // Required. The resource name of the reseller account for listing channel partner + // links. + // The parent takes the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, server will pick a default size (25). + // The maximum value is 200, values above 200 will be coerced to 200. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results, if other than the first one. + // Typically obtained via + // [ListChannelPartnerLinksResponse.next_page_token][google.cloud.channel.v1.ListChannelPartnerLinksResponse.next_page_token] of the previous + // [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks]. +message ListChannelPartnerLinksResponse { + // The Channel partner links for a reseller. + repeated ChannelPartnerLink channel_partner_links = 1; + + // A token to retrieve the next page of results. + // Pass to [ListChannelPartnerLinksRequest.page_token][google.cloud.channel.v1.ListChannelPartnerLinksRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.GetChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLink]. +message GetChannelPartnerLinkRequest { + // Required. The resource name of the channel partner link to retrieve. + // The name takes the format: accounts/{account_id}/channelPartnerLinks/{id} + // where {id} is the Cloud Identity ID of the partner. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.CreateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink] +message CreateChannelPartnerLinkRequest { + // Required. The resource name of reseller's account for which to create a channel + // partner link. + // The parent takes the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The channel partner link to create. + // Either channel_partner_link.reseller_cloud_identity_id or domain can be + // used to create a link. + ChannelPartnerLink channel_partner_link = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The invited partner's domain. Either domain or + // channel_partner_link.reseller_cloud_identity_id can be used to create a + // link. + string domain = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.UpdateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink] +message UpdateChannelPartnerLinkRequest { + // Required. The resource name of the channel partner link to cancel. + // The name takes the format: accounts/{account_id}/channelPartnerLinks/{id} + // where {id} is the Cloud Identity ID of the partner. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The channel partner link to update. Only field + // channel_partner_link.link_state is allowed to be updated. + ChannelPartnerLink channel_partner_link = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask that applies to the resource. + // The only allowable value for update mask is + // channel_partner_link.link_state. + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.CreateEntitlement][google.cloud.channel.v1.CloudChannelService.CreateEntitlement] +message CreateEntitlementRequest { + // Required. The resource name of reseller's customer account in which to create the + // entitlement. + // The parent takes the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Required. The entitlement to create. + Entitlement entitlement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +message TransferEntitlementsRequest { + // Required. The resource name of reseller's customer account where the entitlements + // transfer to. + // The parent takes the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new entitlements to be created or transferred. + repeated Entitlement entitlements = 2 [(google.api.field_behavior) = REQUIRED]; + + // This token is generated by the Super Admin of the resold customer to + // authorize a reseller to access their Cloud Identity and purchase + // entitlements on their behalf. This token can be omitted once the + // authorization is generated. See https://support.google.com/a/answer/7643790 + // for more details. + string auth_token = 4; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +// This will be put into the response field of google.longrunning.Operation. +message TransferEntitlementsResponse { + // The entitlements that have been transferred. + repeated Entitlement entitlements = 1; +} + +// Request message for [CloudChannelService.TransferEntitlementsToGoogle][google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogle]. +message TransferEntitlementsToGoogleRequest { + // Required. The resource name of reseller's customer account where the entitlements + // transfer from. + // The parent takes the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The entitlements to be transferred to Google. + repeated Entitlement entitlements = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ChangeParametersRequest][]. +message ChangeParametersRequest { + // Required. The name of the entitlement to update. + // The name takes the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Entitlement parameters to update. Only editable parameters are allowed to + // be changed. + repeated Parameter parameters = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be + // a valid [UUID](https://tools.ietf.org/html/rfc4122) with the exception that + // zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Purchase order ID provided by the reseller. + string purchase_order_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ChangeRenewalSettings][google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings]. +message ChangeRenewalSettingsRequest { + // Required. The name of the entitlement to update. + // The name takes the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. New renewal settings. + RenewalSettings renewal_settings = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. +message ChangeOfferRequest { + // Required. The name of the entitlement to update. + // Format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. New Offer. + // Format: accounts/{account_id}/offers/{offer_id}. + string offer = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Offer" + } + ]; + + // Optional. Parameters needed to purchase the Offer. + repeated Parameter parameters = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Purchase order id provided by the reseller. + string purchase_order_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.StartPaidService][google.cloud.channel.v1.CloudChannelService.StartPaidService]. +message StartPaidServiceRequest { + // Required. The name of the entitlement for which paid service is being started. + // The name takes the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.CancelEntitlement][google.cloud.channel.v1.CloudChannelService.CancelEntitlement]. +message CancelEntitlementRequest { + // Required. The resource name of the entitlement to cancel. + // The name takes the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.SuspendEntitlement][google.cloud.channel.v1.CloudChannelService.SuspendEntitlement]. +message SuspendEntitlementRequest { + // Required. The resource name of the entitlement to suspend. + // The name takes the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ActivateEntitlement][google.cloud.channel.v1.CloudChannelService.ActivateEntitlement]. +message ActivateEntitlementRequest { + // Required. The resource name of the entitlement to activate. + // The name takes the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional identifier in the external system that partners can use to + // correlate a Channel Services purchase transaction for the entitlement. + string external_correlation_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server will know to ignore the + // request if it has already been completed. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same + // request ID, the server can check if the original operation with the same + // request ID was received, and if so, will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListProducts. +message ListProductsRequest { + // Required. The resource name of the reseller account. + // Format: accounts/{account_id}. + string account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, at most 100 Products will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results, if other than the first one. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US". If specified, the + // response will be localized to the corresponding language code. Default is + // "en-US". + string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListProducts. +message ListProductsResponse { + // List of Products requested. + repeated Product products = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// Request message for ListPurchasableSkus. +message ListPurchasableSkusRequest { + // List SKUs for CreateEntitlement purchase for the customer. + message CreateEntitlementPurchase { + // Required. List SKUs belonging to this Product. + // Format: products/{product_id}. + // Supports products/- to retrieve SKUs for all products. + string product = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // List SKUs for ChangeOffer purchase for upgrade/downgrade of an + // entitlement. + message ChangeOfferPurchase { + // Change Type enum. + enum ChangeType { + // Not used. + CHANGE_TYPE_UNSPECIFIED = 0; + + // Upgrade. + UPGRADE = 1; + + // Downgrade. + DOWNGRADE = 2; + } + + // Required. Resource name of the entitlement. + // Format: + // + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string entitlement = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Change Type for the entitlement. + ChangeType change_type = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Purchase option for the request. Defines the purchase for which the SKUs + // are being listed. + oneof purchase_option { + // List SKUs for CreateEntitlement purchase. + CreateEntitlementPurchase create_entitlement_purchase = 2; + + // List SKUs for ChangeOffer purchase with a new SKU. + ChangeOfferPurchase change_offer_purchase = 3; + } + + // Required. The resource name of the customer for which to list SKUs. + // Format: accounts/{account_id}/customers/{customer_id}. + string customer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, at most 100 SKUs will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results, if other than the first one. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US". If specified, the + // response will be localized to the corresponding language code. Default is + // "en-US". + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPurchasableSkus. +message ListPurchasableSkusResponse { + // The list of SKUs requested. + repeated PurchasableSku purchasable_skus = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// SKU that can be used for a puchase. This is used in ListPurchasableSku API +// response. +message PurchasableSku { + // SKU + Sku sku = 1; +} + +// Request message for ListPurchasableOffers. +message ListPurchasableOffersRequest { + // List Offers for CreateEntitlement purchase. + message CreateEntitlementPurchase { + // Required. SKU that the result should be restricted to. + // Format: products/{product_id}/skus/{sku_id}. + string sku = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // List Offers for ChangeOffer purchase. + message ChangeOfferPurchase { + // Required. Resource name of the entitlement. + // Format: + // + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string entitlement = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Resource name of the SKU that is being changed to. Should be provided if + // upgrading or downgrading an entitlement. Format: + // products/{product_id}/skus/{sku_id} + string new_sku = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Purchase option for the request. Defines the purchase for which the Offers + // are being listed. + oneof purchase_option { + // List Offers for CreateEntitlement purchase. + CreateEntitlementPurchase create_entitlement_purchase = 2; + + // List Offers for ChangeOffer purchase. + ChangeOfferPurchase change_offer_purchase = 3; + } + + // Required. The resource name of the customer for which to list Offers. + // Format: accounts/{account_id}/customers/{customer_id}. + string customer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, at most 100 Offers will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results, if other than the first one. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US". If specified, the + // response will be localized to the corresponding language code. Default is + // "en-US". + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPurchasableOffers. +message ListPurchasableOffersResponse { + // The list of Offers requested. + repeated PurchasableOffer purchasable_offers = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// Offer that can be puchased for a customer. This is used in +// ListPurchasableOffer API response. +message PurchasableOffer { + // Offer. + Offer offer = 1; +}