diff --git a/google/shopping/merchant/quota/v1beta/BUILD.bazel b/google/shopping/merchant/quota/v1beta/BUILD.bazel new file mode 100644 index 0000000000000..4c2e573d8a54a --- /dev/null +++ b/google/shopping/merchant/quota/v1beta/BUILD.bazel @@ -0,0 +1,382 @@ +# This file was automatically generated by BuildFileGenerator +# https://github.com/googleapis/rules_gapic/tree/master/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. + +# buildifier: disable=load-on-top + +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +############################################################################## +# Common +############################################################################## +# buildifier: disable=same-origin-load +load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info") +load("@rules_proto//proto:defs.bzl", "proto_library") + +proto_library( + name = "quota_proto", + srcs = [ + "quota.proto", + ], + deps = [ + "//google/api:annotations_proto", + "//google/api:client_proto", + "//google/api:field_behavior_proto", + "//google/api:resource_proto", + ], +) + +proto_library_with_info( + name = "quota_proto_with_info", + deps = [ + ":quota_proto", + "//google/cloud:common_resources_proto", + ], +) + +############################################################################## +# Java +############################################################################## +# buildifier: disable=same-origin-load +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 = "quota_java_proto", + deps = [":quota_proto"], +) + +java_grpc_library( + name = "quota_java_grpc", + srcs = [":quota_proto"], + deps = [":quota_java_proto"], +) + +java_gapic_library( + name = "quota_java_gapic", + srcs = [":quota_proto_with_info"], + gapic_yaml = None, + grpc_service_config = "quota_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "merchantapi_v1beta.yaml", + test_deps = [ + ":quota_java_grpc", + ], + transport = "grpc+rest", + deps = [ + ":quota_java_proto", + "//google/api:api_java_proto", + ], +) + +java_gapic_test( + name = "quota_java_gapic_test_suite", + test_classes = [ + "com.google.shopping.merchant.quota.v1beta.QuotaServiceClientHttpJsonTest", + "com.google.shopping.merchant.quota.v1beta.QuotaServiceClientTest", + ], + runtime_deps = [":quota_java_gapic_test"], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( + name = "google-cloud-merchant-quota-v1beta-java", + include_samples = True, + transport = "grpc+rest", + deps = [ + ":quota_java_gapic", + ":quota_java_grpc", + ":quota_java_proto", + ":quota_proto", + ], +) + +############################################################################## +# Go +############################################################################## +# buildifier: disable=same-origin-load +load( + "@com_google_googleapis_imports//:imports.bzl", + "go_gapic_assembly_pkg", + "go_gapic_library", + "go_proto_library", +) + +go_proto_library( + name = "quota_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], + importpath = "cloud.google.com/go/shopping/merchant/quota/apiv1beta/quotapb", + protos = [":quota_proto"], + deps = [ + "//google/api:annotations_go_proto", + ], +) + +go_gapic_library( + name = "quota_go_gapic", + srcs = [":quota_proto_with_info"], + grpc_service_config = "quota_grpc_service_config.json", + importpath = "google.golang.org/google/shopping/merchant/quota/v1beta;quotapb", + metadata = True, + release_level = "beta", + rest_numeric_enums = True, + service_yaml = "merchantapi_v1beta.yaml", + transport = "grpc+rest", + deps = [ + ":quota_go_proto", + ], +) + +# Open Source Packages +go_gapic_assembly_pkg( + name = "gapi-cloud-merchant-quota-v1beta-go", + deps = [ + ":quota_go_gapic", + ":quota_go_gapic_srcjar-metadata.srcjar", + ":quota_go_gapic_srcjar-snippets.srcjar", + ":quota_go_gapic_srcjar-test.srcjar", + ":quota_go_proto", + ], +) + +############################################################################## +# Python +############################################################################## +# buildifier: disable=same-origin-load +load( + "@com_google_googleapis_imports//:imports.bzl", + "py_gapic_assembly_pkg", + "py_gapic_library", + "py_test", +) + +py_gapic_library( + name = "quota_py_gapic", + srcs = [":quota_proto"], + grpc_service_config = "quota_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "merchantapi_v1beta.yaml", + transport = "grpc+rest", + deps = [ + ], +) + +py_test( + name = "quota_py_gapic_test", + srcs = [ + "quota_py_gapic_pytest.py", + "quota_py_gapic_test.py", + ], + legacy_create_init = False, + deps = [":quota_py_gapic"], +) + +# Open Source Packages +py_gapic_assembly_pkg( + name = "merchant-quota-v1beta-py", + deps = [ + ":quota_py_gapic", + ], +) + +############################################################################## +# PHP +############################################################################## +# buildifier: disable=same-origin-load +load( + "@com_google_googleapis_imports//:imports.bzl", + "php_gapic_assembly_pkg", + "php_gapic_library", + "php_proto_library", +) + +php_proto_library( + name = "quota_php_proto", + deps = [":quota_proto"], +) + +php_gapic_library( + name = "quota_php_gapic", + srcs = [":quota_proto_with_info"], + grpc_service_config = "quota_grpc_service_config.json", + migration_mode = "NEW_SURFACE_ONLY", + rest_numeric_enums = True, + service_yaml = "merchantapi_v1beta.yaml", + transport = "grpc+rest", + deps = [ + ":quota_php_proto", + ], +) + +# Open Source Packages +php_gapic_assembly_pkg( + name = "google-cloud-merchant-quota-v1beta-php", + deps = [ + ":quota_php_gapic", + ":quota_php_proto", + ], +) + +############################################################################## +# Node.js +############################################################################## +# buildifier: disable=same-origin-load +load( + "@com_google_googleapis_imports//:imports.bzl", + "nodejs_gapic_assembly_pkg", + "nodejs_gapic_library", +) + +nodejs_gapic_library( + name = "quota_nodejs_gapic", + package_name = "@google-cloud/quota", + src = ":quota_proto_with_info", + extra_protoc_parameters = ["metadata"], + grpc_service_config = "quota_grpc_service_config.json", + package = "google.shopping.merchant.quota.v1beta", + rest_numeric_enums = True, + service_yaml = "merchantapi_v1beta.yaml", + transport = "grpc+rest", + deps = [], +) + +nodejs_gapic_assembly_pkg( + name = "merchant-quota-v1beta-nodejs", + deps = [ + ":quota_nodejs_gapic", + ":quota_proto", + ], +) + +############################################################################## +# Ruby +############################################################################## +# buildifier: disable=same-origin-load +load( + "@com_google_googleapis_imports//:imports.bzl", + "ruby_cloud_gapic_library", + "ruby_gapic_assembly_pkg", + "ruby_grpc_library", + "ruby_proto_library", +) + +ruby_proto_library( + name = "quota_ruby_proto", + deps = [":quota_proto"], +) + +ruby_grpc_library( + name = "quota_ruby_grpc", + srcs = [":quota_proto"], + deps = [":quota_ruby_proto"], +) + +ruby_cloud_gapic_library( + name = "quota_ruby_gapic", + srcs = [":quota_proto_with_info"], + extra_protoc_parameters = [ + "ruby-cloud-gem-name=google-cloud-merchant-quota-v1beta", + ], + grpc_service_config = "quota_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "merchantapi_v1beta.yaml", + transport = "grpc+rest", + deps = [ + ":quota_ruby_grpc", + ":quota_ruby_proto", + ], +) + +# Open Source Packages +ruby_gapic_assembly_pkg( + name = "google-cloud-merchant-quota-v1beta-ruby", + deps = [ + ":quota_ruby_gapic", + ":quota_ruby_grpc", + ":quota_ruby_proto", + ], +) + +############################################################################## +# C# +############################################################################## +# buildifier: disable=same-origin-load +load( + "@com_google_googleapis_imports//:imports.bzl", + "csharp_gapic_assembly_pkg", + "csharp_gapic_library", + "csharp_grpc_library", + "csharp_proto_library", +) + +csharp_proto_library( + name = "quota_csharp_proto", + extra_opts = [], + deps = [":quota_proto"], +) + +csharp_grpc_library( + name = "quota_csharp_grpc", + srcs = [":quota_proto"], + deps = [":quota_csharp_proto"], +) + +csharp_gapic_library( + name = "quota_csharp_gapic", + srcs = [":quota_proto_with_info"], + common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json", + grpc_service_config = "quota_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "merchantapi_v1beta.yaml", + transport = "grpc+rest", + deps = [ + ":quota_csharp_grpc", + ":quota_csharp_proto", + ], +) + +# Open Source Packages +csharp_gapic_assembly_pkg( + name = "google-cloud-merchant-quota-v1beta-csharp", + deps = [ + ":quota_csharp_gapic", + ":quota_csharp_grpc", + ":quota_csharp_proto", + ], +) + +############################################################################## +# C++ +############################################################################## +# buildifier: disable=same-origin-load +load( + "@com_google_googleapis_imports//:imports.bzl", + "cc_grpc_library", + "cc_proto_library", +) + +cc_proto_library( + name = "quota_cc_proto", + deps = [":quota_proto"], +) + +cc_grpc_library( + name = "quota_cc_grpc", + srcs = [":quota_proto"], + grpc_only = True, + deps = [":quota_cc_proto"], +) diff --git a/google/shopping/merchant/quota/v1beta/merchantapi_v1beta.yaml b/google/shopping/merchant/quota/v1beta/merchantapi_v1beta.yaml new file mode 100644 index 0000000000000..cb23bac783ceb --- /dev/null +++ b/google/shopping/merchant/quota/v1beta/merchantapi_v1beta.yaml @@ -0,0 +1,146 @@ +type: google.api.Service +config_version: 3 +name: merchantapi.googleapis.com +title: Merchant API + +apis: +- name: google.shopping.merchant.quota.v1beta.QuotaService + +documentation: + summary: Programmatically manage your Merchant Center accounts. + +authentication: + rules: + - selector: google.shopping.merchant.quota.v1beta.QuotaService.ListQuotaGroups + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/content + +publishing: + new_issue_uri: https://issuetracker.google.com/issues/new?component=171084&template=555201 + documentation_uri: https://developers.google.com/merchant/api + api_short_name: merchantapi + github_label: 'api: merchantapi' + doc_tag_prefix: merchantapi + organization: SHOPPING + library_settings: + - version: google.shopping.merchant.inventories.v1beta + launch_stage: BETA + java_settings: + common: + destinations: + - PACKAGE_MANAGER + php_settings: + common: + destinations: + - PACKAGE_MANAGER + python_settings: + common: + destinations: + - PACKAGE_MANAGER + node_settings: + common: + destinations: + - PACKAGE_MANAGER + dotnet_settings: + common: + destinations: + - PACKAGE_MANAGER + ruby_settings: + common: + destinations: + - PACKAGE_MANAGER + go_settings: + common: + destinations: + - PACKAGE_MANAGER + - version: google.shopping.merchant.reports.v1beta + launch_stage: BETA + java_settings: + common: + destinations: + - PACKAGE_MANAGER + php_settings: + common: + destinations: + - PACKAGE_MANAGER + python_settings: + common: + destinations: + - PACKAGE_MANAGER + node_settings: + common: + destinations: + - PACKAGE_MANAGER + dotnet_settings: + common: + destinations: + - PACKAGE_MANAGER + ruby_settings: + common: + destinations: + - PACKAGE_MANAGER + go_settings: + common: + destinations: + - PACKAGE_MANAGER + - version: google.shopping.merchant.conversions.v1beta + launch_stage: BETA + java_settings: + common: + destinations: + - PACKAGE_MANAGER + php_settings: + common: + destinations: + - PACKAGE_MANAGER + python_settings: + common: + destinations: + - PACKAGE_MANAGER + node_settings: + common: + destinations: + - PACKAGE_MANAGER + dotnet_settings: + common: + destinations: + - PACKAGE_MANAGER + ruby_settings: + common: + destinations: + - PACKAGE_MANAGER + go_settings: + common: + destinations: + - PACKAGE_MANAGER + - version: google.shopping.merchant.quota.v1beta + launch_stage: BETA + java_settings: + common: + destinations: + - PACKAGE_MANAGER + php_settings: + common: + destinations: + - PACKAGE_MANAGER + python_settings: + common: + destinations: + - PACKAGE_MANAGER + node_settings: + common: + destinations: + - PACKAGE_MANAGER + dotnet_settings: + common: + destinations: + - PACKAGE_MANAGER + ruby_settings: + common: + destinations: + - PACKAGE_MANAGER + go_settings: + common: + destinations: + - PACKAGE_MANAGER diff --git a/google/shopping/merchant/quota/v1beta/quota.proto b/google/shopping/merchant/quota/v1beta/quota.proto new file mode 100644 index 0000000000000..015a833674c43 --- /dev/null +++ b/google/shopping/merchant/quota/v1beta/quota.proto @@ -0,0 +1,128 @@ +// Copyright 2023 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.shopping.merchant.quota.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/quota/apiv1beta/quotapb;quotapb"; +option java_multiple_files = true; +option java_outer_classname = "QuotaProto"; +option java_package = "com.google.shopping.merchant.quota.v1beta"; +option (google.api.resource_definition) = { + type: "merchantapi.googleapis.com/Account" + pattern: "accounts/{account}" +}; + +// Service to get method call quota information per Merchant API method. +service QuotaService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Lists the daily call quota and usage per group for your Merchant + // Center account. + rpc ListQuotaGroups(ListQuotaGroupsRequest) + returns (ListQuotaGroupsResponse) { + option (google.api.http) = { + get: "/quota/v1beta/{parent=accounts/*}/quotas" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The group information for methods in the Merchant API. The quota is shared +// between all methods in the group. Even if none of the methods within the +// group have usage the information for the group is returned. +message QuotaGroup { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/QuotaGroup" + pattern: "accounts/{account}/groups/{group}" + plural: "quotaGroups" + singular: "quotaGroup" + }; + + // Identifier. The resource name of the quota group. + // Format: accounts/{account}/quotas/{group} + // Note: There is no guarantee on the format of {group} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The current quota usage, meaning the number of calls already + // made on a given day to the methods in the group. The daily quota limits + // reset at at 12:00 PM midday UTC. + int64 quota_usage = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The maximum number of calls allowed per day for the group. + int64 quota_limit = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The maximum number of calls allowed per minute for the group. + int64 quota_minute_limit = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of all methods group quota applies to. + repeated MethodDetails method_details = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The method details per method in the Merchant API. +message MethodDetails { + // Output only. The name of the method for example `products.list`. + string method = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The API version that the method belongs to. + string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The sub-API that the method belongs to. + string subapi = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The path for the method such as + // `products/v1/productInputs.insert` + string path = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the ListQuotaGroups method. +message ListQuotaGroupsRequest { + // Required. The merchant account who owns the collection of method quotas + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/QuotaGroup" + } + ]; + + // Optional. The maximum number of quotas to return in the response, used + // for paging. Defaults to 500; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Token (if provided) to retrieve the subsequent page. All other + // parameters must match the original call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the ListMethodGroups method. +message ListQuotaGroupsResponse { + // The methods, current quota usage and limits per each group. The quota is + // shared between all methods in the group. The groups are sorted in + // descending order based on + // [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage]. + repeated QuotaGroup quota_groups = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/google/shopping/merchant/quota/v1beta/quota_grpc_service_config.json b/google/shopping/merchant/quota/v1beta/quota_grpc_service_config.json new file mode 100644 index 0000000000000..573bda286a75a --- /dev/null +++ b/google/shopping/merchant/quota/v1beta/quota_grpc_service_config.json @@ -0,0 +1,15 @@ +{ + "methodConfig": [{ + "name": [ + { "service": "google.shopping.merchant.quota.v1beta.QuotaService" } + ], + "timeout": "60s", + "retryPolicy": { + "maxAttempts": 5, + "initialBackoff": "1s", + "maxBackoff": "10s", + "backoffMultiplier": 1.3, + "retryableStatusCodes": ["UNAVAILABLE"] + } + }] +} \ No newline at end of file