Skip to content

Commit

Permalink
docs(secret_manager-v1beta1): Add Configuration docs and update enum …
Browse files Browse the repository at this point in the history
…return types
  • Loading branch information
quartzmo committed Mar 4, 2020
1 parent a483553 commit 303798d
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 10 deletions.
Expand Up @@ -40,7 +40,18 @@ class Client
attr_reader :secret_manager_service_stub

##
# Configuration for the SecretManagerService Client API.
# Configure the SecretManagerService Client class.
#
# See {Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration}
# for a description of the configuration fields.
#
# ## Example
#
# To modify the configuration for all SecretManagerService clients:
#
# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config|
# config.timeout = 10_000
# end
#
# @yield [config] Configure the Client client.
# @yieldparam config [Client::Configuration]
Expand Down Expand Up @@ -69,6 +80,9 @@ def self.configure
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
# should be made on {Client.configure}.
#
# See {Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration}
# for a description of the configuration fields.
#
# @yield [config] Configure the Client client.
# @yieldparam config [Client::Configuration]
#
Expand All @@ -80,9 +94,23 @@ def configure
end

##
# Create a new Client client object.
# Create a new SecretManagerService client object.
#
# @yield [config] Configure the Client client.
# ## Examples
#
# To create a new SecretManagerService client with the default
# configuration:
#
# client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new
#
# To create a new SecretManagerService client with a custom
# configuration:
#
# client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config|
# config.timeout = 10_000
# end
#
# @yield [config] Configure the SecretManagerService client.
# @yieldparam config [Client::Configuration]
#
def initialize
Expand Down Expand Up @@ -1100,6 +1128,81 @@ def test_iam_permissions request, options = nil

##
# Configuration class for the SecretManagerService API.
#
# This class represents the configuration for SecretManagerService,
# providing control over timeouts, retry behavior, logging, transport
# parameters, and other low-level controls. Certain parameters can also be
# applied individually to specific RPCs. See
# {Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client::Configuration::Rpcs}
# for a list of RPCs that can be configured independently.
#
# Configuration can be applied globally to all clients, or to a single client
# on construction.
#
# # Examples
#
# To modify the global config, setting the timeout for list_secrets
# to 20 seconds, and all remaining timeouts to 10 seconds:
#
# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.configure do |config|
# config.timeout = 10_000
# config.rpcs.list_secrets.timeout = 20_000
# end
#
# To apply the above configuration only to a new client:
#
# client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new do |config|
# config.timeout = 10_000
# config.rpcs.list_secrets.timeout = 20_000
# end
#
# @!attribute [rw] endpoint
# The hostname or hostname:port of the service endpoint.
# Defaults to `"secretmanager.googleapis.com"`.
# @return [String]
# @!attribute [rw] credentials
# Credentials to send with calls. You may provide any of the following types:
# * (`String`) The path to a service account key file in JSON format
# * (`Hash`) A service account key as a Hash
# * (`Google::Auth::Credentials`) A googleauth credentials object
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
# * (`nil`) indicating no credentials
# @return [Object]
# @!attribute [rw] scope
# The OAuth scopes
# @return [Array<String>]
# @!attribute [rw] lib_name
# The library name as recorded in instrumentation and logging
# @return [String]
# @!attribute [rw] lib_version
# The library version as recorded in instrumentation and logging
# @return [String]
# @!attribute [rw] channel_args
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
# `GRPC::Core::Channel` object is provided as the credential.
# @return [Hash]
# @!attribute [rw] interceptors
# An array of interceptors that are run before calls are executed.
# @return [Array<GRPC::ClientInterceptor>]
# @!attribute [rw] timeout
# The call timeout in milliseconds.
# @return [Numeric]
# @!attribute [rw] metadata
# Additional gRPC headers to be sent with the call.
# @return [Hash{Symbol=>String}]
# @!attribute [rw] retry_policy
# The retry policy. The value is a hash with the following keys:
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
# trigger a retry.
# @return [Hash]
#
class Configuration
extend Gapic::Config

Expand All @@ -1118,12 +1221,17 @@ class Configuration
config_attr :metadata, nil, Hash, nil
config_attr :retry_policy, nil, Hash, Proc, nil

# @private
def initialize parent_config = nil
@parent_config = parent_config unless parent_config.nil?

yield self if block_given?
end

##
# Configurations for individual RPCs
# @return [Rpcs]
#
def rpcs
@rpcs ||= begin
parent_rpcs = nil
Expand All @@ -1134,23 +1242,99 @@ def rpcs

##
# Configuration RPC class for the SecretManagerService API.
#
# Includes fields providing the configuration for each RPC in this service.
# Each configuration object is of type `Gapic::Config::Method` and includes
# the following configuration fields:
#
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
# include the following keys:
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
# trigger a retry.
#
class Rpcs
##
# RPC-specific configuration for `list_secrets`
# @return [Gapic::Config::Method]
#
attr_reader :list_secrets
##
# RPC-specific configuration for `create_secret`
# @return [Gapic::Config::Method]
#
attr_reader :create_secret
##
# RPC-specific configuration for `add_secret_version`
# @return [Gapic::Config::Method]
#
attr_reader :add_secret_version
##
# RPC-specific configuration for `get_secret`
# @return [Gapic::Config::Method]
#
attr_reader :get_secret
##
# RPC-specific configuration for `update_secret`
# @return [Gapic::Config::Method]
#
attr_reader :update_secret
##
# RPC-specific configuration for `delete_secret`
# @return [Gapic::Config::Method]
#
attr_reader :delete_secret
##
# RPC-specific configuration for `list_secret_versions`
# @return [Gapic::Config::Method]
#
attr_reader :list_secret_versions
##
# RPC-specific configuration for `get_secret_version`
# @return [Gapic::Config::Method]
#
attr_reader :get_secret_version
##
# RPC-specific configuration for `access_secret_version`
# @return [Gapic::Config::Method]
#
attr_reader :access_secret_version
##
# RPC-specific configuration for `disable_secret_version`
# @return [Gapic::Config::Method]
#
attr_reader :disable_secret_version
##
# RPC-specific configuration for `enable_secret_version`
# @return [Gapic::Config::Method]
#
attr_reader :enable_secret_version
##
# RPC-specific configuration for `destroy_secret_version`
# @return [Gapic::Config::Method]
#
attr_reader :destroy_secret_version
##
# RPC-specific configuration for `set_iam_policy`
# @return [Gapic::Config::Method]
#
attr_reader :set_iam_policy
##
# RPC-specific configuration for `get_iam_policy`
# @return [Gapic::Config::Method]
#
attr_reader :get_iam_policy
##
# RPC-specific configuration for `test_iam_permissions`
# @return [Gapic::Config::Method]
#
attr_reader :test_iam_permissions

# @private
def initialize parent_rpcs = nil
list_secrets_config = parent_rpcs&.list_secrets if parent_rpcs&.respond_to? :list_secrets
@list_secrets = Gapic::Config::Method.new list_secrets_config
Expand Down
Expand Up @@ -165,7 +165,7 @@ module Api
# Optional. The field on the resource that designates the resource name
# field. If omitted, this is assumed to be "name".
# @!attribute [rw] history
# @return [ENUM(History)]
# @return [Google::Api::ResourceDescriptor::History]
# Optional. The historical or future-looking state of the resource pattern.
#
# Example:
Expand Down
Expand Up @@ -81,7 +81,7 @@ class LabelsEntry
# Only present if [state][google.cloud.secrets.v1beta1.SecretVersion.state] is
# [DESTROYED][google.cloud.secrets.v1beta1.SecretVersion.State.DESTROYED].
# @!attribute [r] state
# @return [ENUM(State)]
# @return [Google::Cloud::SecretManager::V1beta1::SecretVersion::State]
# Output only. The current state of the [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].
class SecretVersion
include Google::Protobuf::MessageExts
Expand Down
Expand Up @@ -122,7 +122,7 @@ class PolicyDelta
# One delta entry for Binding. Each individual change (only one member in each
# entry) to a binding will be a separate entry.
# @!attribute [rw] action
# @return [ENUM(Action)]
# @return [Google::Iam::V1::BindingDelta::Action]
# The action that was performed on a Binding.
# Required
# @!attribute [rw] role
Expand Down
8 changes: 4 additions & 4 deletions google-cloud-secret_manager-v1beta1/synth.metadata
@@ -1,13 +1,13 @@
{
"updateTime": "2020-02-26T11:44:43.166608Z",
"updateTime": "2020-03-04T11:43:39.092829Z",
"sources": [
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0aba1900ffef672ec5f0da677cf590ee5686e13b",
"internalRef": "297204568",
"log": "0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\n"
"sha": "541b1ded4abadcc38e8178680b0677f65594ea6f",
"internalRef": "298686266",
"log": "541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n"
}
}
],
Expand Down

0 comments on commit 303798d

Please sign in to comment.