Autogenerated update (2019-09-20)

Update:
- binaryauthorization_v1
- fitness_v1
- ml_v1
- monitoring_v3
- spanner_v1
- speech_v1
- speech_v1p1beta1
- speech_v2beta
This commit is contained in:
Google APIs 2019-09-20 00:38:50 +00:00
parent 629e1c0f4d
commit 516cff9fe9
22 changed files with 965 additions and 127 deletions

View File

@ -26,7 +26,7 @@ module Google
# @see https://cloud.google.com/binary-authorization/
module BinaryauthorizationV1
VERSION = 'V1'
REVISION = '20190906'
REVISION = '20190916'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -182,6 +182,54 @@ module Google
end
end
# Associates `members` with a `role`.
class Binding
include Google::Apis::Core::Hashable
# Represents an expression text. Example:
# title: "User account presence"
# description: "Determines whether the request has a user account"
# expression: "size(request.user) > 0"
# Corresponds to the JSON property `condition`
# @return [Google::Apis::BinaryauthorizationV1::Expr]
attr_accessor :condition
# Specifies the identities requesting access for a Cloud Platform resource.
# `members` can have the following values:
# * `allUsers`: A special identifier that represents anyone who is
# on the internet; with or without a Google account.
# * `allAuthenticatedUsers`: A special identifier that represents anyone
# who is authenticated with a Google account or a service account.
# * `user:`emailid``: An email address that represents a specific Google
# account. For example, `alice@example.com` .
# * `serviceAccount:`emailid``: An email address that represents a service
# account. For example, `my-other-app@appspot.gserviceaccount.com`.
# * `group:`emailid``: An email address that represents a Google group.
# For example, `admins@example.com`.
# * `domain:`domain``: The G Suite domain (primary) that represents all the
# users of that domain. For example, `google.com` or `example.com`.
# Corresponds to the JSON property `members`
# @return [Array<String>]
attr_accessor :members
# Role that is assigned to `members`.
# For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
# Corresponds to the JSON property `role`
# @return [String]
attr_accessor :role
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@condition = args[:condition] if args.key?(:condition)
@members = args[:members] if args.key?(:members)
@role = args[:role] if args.key?(:role)
end
end
# A generic empty message that you can re-use to avoid defining duplicated
# empty messages in your APIs. A typical example is to use it as the request
# or the response type of an API method. For instance:
@ -201,6 +249,135 @@ module Google
end
end
# Represents an expression text. Example:
# title: "User account presence"
# description: "Determines whether the request has a user account"
# expression: "size(request.user) > 0"
class Expr
include Google::Apis::Core::Hashable
# An optional description of the expression. This is a longer text which
# describes the expression, e.g. when hovered over it in a UI.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Textual representation of an expression in
# Common Expression Language syntax.
# The application context of the containing message determines which
# well-known feature set of CEL is supported.
# Corresponds to the JSON property `expression`
# @return [String]
attr_accessor :expression
# An optional string indicating the location of the expression for error
# reporting, e.g. a file name and a position in the file.
# Corresponds to the JSON property `location`
# @return [String]
attr_accessor :location
# An optional title for the expression, i.e. a short string describing
# its purpose. This can be used e.g. in UIs which allow to enter the
# expression.
# Corresponds to the JSON property `title`
# @return [String]
attr_accessor :title
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@expression = args[:expression] if args.key?(:expression)
@location = args[:location] if args.key?(:location)
@title = args[:title] if args.key?(:title)
end
end
# Defines an Identity and Access Management (IAM) policy. It is used to
# specify access control policies for Cloud Platform resources.
# A `Policy` consists of a list of `bindings`. A `binding` binds a list of
# `members` to a `role`, where the members can be user accounts, Google groups,
# Google domains, and service accounts. A `role` is a named list of permissions
# defined by IAM.
# **JSON Example**
# `
# "bindings": [
# `
# "role": "roles/owner",
# "members": [
# "user:mike@example.com",
# "group:admins@example.com",
# "domain:google.com",
# "serviceAccount:my-other-app@appspot.gserviceaccount.com"
# ]
# `,
# `
# "role": "roles/viewer",
# "members": ["user:sean@example.com"]
# `
# ]
# `
# **YAML Example**
# bindings:
# - members:
# - user:mike@example.com
# - group:admins@example.com
# - domain:google.com
# - serviceAccount:my-other-app@appspot.gserviceaccount.com
# role: roles/owner
# - members:
# - user:sean@example.com
# role: roles/viewer
# For a description of IAM and its features, see the
# [IAM developer's guide](https://cloud.google.com/iam/docs).
class IamPolicy
include Google::Apis::Core::Hashable
# Associates a list of `members` to a `role`.
# `bindings` with no members will result in an error.
# Corresponds to the JSON property `bindings`
# @return [Array<Google::Apis::BinaryauthorizationV1::Binding>]
attr_accessor :bindings
# `etag` is used for optimistic concurrency control as a way to help
# prevent simultaneous updates of a policy from overwriting each other.
# It is strongly suggested that systems make use of the `etag` in the
# read-modify-write cycle to perform policy updates in order to avoid race
# conditions: An `etag` is returned in the response to `getIamPolicy`, and
# systems are expected to put that etag in the request to `setIamPolicy` to
# ensure that their change will be applied to the same version of the policy.
# If no `etag` is provided in the call to `setIamPolicy`, then the existing
# policy is overwritten.
# Corresponds to the JSON property `etag`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :etag
# Specifies the format of the policy.
# Valid values are 0, 1, and 3. Requests specifying an invalid value will be
# rejected.
# Policies with any conditional bindings must specify version 3. Policies
# without any conditional bindings may specify any valid value or leave the
# field unset.
# Corresponds to the JSON property `version`
# @return [Fixnum]
attr_accessor :version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bindings = args[:bindings] if args.key?(:bindings)
@etag = args[:etag] if args.key?(:etag)
@version = args[:version] if args.key?(:version)
end
end
# Response message for BinauthzManagementService.ListAttestors.
class ListAttestorsResponse
include Google::Apis::Core::Hashable
@ -334,6 +511,103 @@ module Google
end
end
# Request message for `SetIamPolicy` method.
class SetIamPolicyRequest
include Google::Apis::Core::Hashable
# Defines an Identity and Access Management (IAM) policy. It is used to
# specify access control policies for Cloud Platform resources.
# A `Policy` consists of a list of `bindings`. A `binding` binds a list of
# `members` to a `role`, where the members can be user accounts, Google groups,
# Google domains, and service accounts. A `role` is a named list of permissions
# defined by IAM.
# **JSON Example**
# `
# "bindings": [
# `
# "role": "roles/owner",
# "members": [
# "user:mike@example.com",
# "group:admins@example.com",
# "domain:google.com",
# "serviceAccount:my-other-app@appspot.gserviceaccount.com"
# ]
# `,
# `
# "role": "roles/viewer",
# "members": ["user:sean@example.com"]
# `
# ]
# `
# **YAML Example**
# bindings:
# - members:
# - user:mike@example.com
# - group:admins@example.com
# - domain:google.com
# - serviceAccount:my-other-app@appspot.gserviceaccount.com
# role: roles/owner
# - members:
# - user:sean@example.com
# role: roles/viewer
# For a description of IAM and its features, see the
# [IAM developer's guide](https://cloud.google.com/iam/docs).
# Corresponds to the JSON property `policy`
# @return [Google::Apis::BinaryauthorizationV1::IamPolicy]
attr_accessor :policy
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@policy = args[:policy] if args.key?(:policy)
end
end
# Request message for `TestIamPermissions` method.
class TestIamPermissionsRequest
include Google::Apis::Core::Hashable
# The set of permissions to check for the `resource`. Permissions with
# wildcards (such as '*' or 'storage.*') are not allowed. For more
# information see
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
# Corresponds to the JSON property `permissions`
# @return [Array<String>]
attr_accessor :permissions
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@permissions = args[:permissions] if args.key?(:permissions)
end
end
# Response message for `TestIamPermissions` method.
class TestIamPermissionsResponse
include Google::Apis::Core::Hashable
# A subset of `TestPermissionsRequest.permissions` that the caller is
# allowed.
# Corresponds to the JSON property `permissions`
# @return [Array<String>]
attr_accessor :permissions
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@permissions = args[:permissions] if args.key?(:permissions)
end
end
# An user owned Grafeas note references a Grafeas
# Attestation.Authority Note created by the user.
class UserOwnedGrafeasNote

View File

@ -46,12 +46,30 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class Binding
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Empty
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Expr
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class IamPolicy
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListAttestorsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -70,6 +88,24 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class SetIamPolicyRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TestIamPermissionsRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TestIamPermissionsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class UserOwnedGrafeasNote
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -114,12 +150,42 @@ module Google
end
end
class Binding
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :condition, as: 'condition', class: Google::Apis::BinaryauthorizationV1::Expr, decorator: Google::Apis::BinaryauthorizationV1::Expr::Representation
collection :members, as: 'members'
property :role, as: 'role'
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class Expr
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :description, as: 'description'
property :expression, as: 'expression'
property :location, as: 'location'
property :title, as: 'title'
end
end
class IamPolicy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :bindings, as: 'bindings', class: Google::Apis::BinaryauthorizationV1::Binding, decorator: Google::Apis::BinaryauthorizationV1::Binding::Representation
property :etag, :base64 => true, as: 'etag'
property :version, as: 'version'
end
end
class ListAttestorsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -153,6 +219,28 @@ module Google
end
end
class SetIamPolicyRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :policy, as: 'policy', class: Google::Apis::BinaryauthorizationV1::IamPolicy, decorator: Google::Apis::BinaryauthorizationV1::IamPolicy::Representation
end
end
class TestIamPermissionsRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :permissions, as: 'permissions'
end
end
class TestIamPermissionsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :permissions, as: 'permissions'
end
end
class UserOwnedGrafeasNote
# @private
class Representation < Google::Apis::Core::JsonRepresentation

View File

@ -225,6 +225,47 @@ module Google
execute_or_queue_command(command, &block)
end
# Gets the access control policy for a resource.
# Returns an empty policy if the resource exists and does not have a policy
# set.
# @param [String] resource
# REQUIRED: The resource for which the policy is being requested.
# See the operation documentation for the appropriate value for this field.
# @param [Fixnum] options_requested_policy_version
# Optional. The policy format version to be returned.
# Valid values are 0, 1, and 3. Requests specifying an invalid value will be
# rejected.
# Requests for policies with any conditional bindings must specify version 3.
# Policies without any conditional bindings may specify any valid value or
# leave the field unset.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::BinaryauthorizationV1::IamPolicy] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::BinaryauthorizationV1::IamPolicy]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_attestor_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation
command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy
command.params['resource'] = resource unless resource.nil?
command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists attestors.
# Returns INVALID_ARGUMENT if the project does not exist.
# @param [String] parent
@ -266,6 +307,80 @@ module Google
execute_or_queue_command(command, &block)
end
# Sets the access control policy on the specified resource. Replaces any
# existing policy.
# @param [String] resource
# REQUIRED: The resource for which the policy is being specified.
# See the operation documentation for the appropriate value for this field.
# @param [Google::Apis::BinaryauthorizationV1::SetIamPolicyRequest] set_iam_policy_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::BinaryauthorizationV1::IamPolicy] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::BinaryauthorizationV1::IamPolicy]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def set_attestor_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
command.request_representation = Google::Apis::BinaryauthorizationV1::SetIamPolicyRequest::Representation
command.request_object = set_iam_policy_request_object
command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation
command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy
command.params['resource'] = resource unless resource.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Returns permissions that a caller has on the specified resource.
# If the resource does not exist, this will return an empty set of
# permissions, not a NOT_FOUND error.
# Note: This operation is designed to be used for building permission-aware
# UIs and command-line tools, not for authorization checking. This operation
# may "fail open" without warning.
# @param [String] resource
# REQUIRED: The resource for which the policy detail is being requested.
# See the operation documentation for the appropriate value for this field.
# @param [Google::Apis::BinaryauthorizationV1::TestIamPermissionsRequest] test_iam_permissions_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def test_attestor_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
command.request_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsRequest::Representation
command.request_object = test_iam_permissions_request_object
command.response_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse::Representation
command.response_class = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse
command.params['resource'] = resource unless resource.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Updates an attestor.
# Returns NOT_FOUND if the attestor does not exist.
# @param [String] name
@ -300,6 +415,121 @@ module Google
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the access control policy for a resource.
# Returns an empty policy if the resource exists and does not have a policy
# set.
# @param [String] resource
# REQUIRED: The resource for which the policy is being requested.
# See the operation documentation for the appropriate value for this field.
# @param [Fixnum] options_requested_policy_version
# Optional. The policy format version to be returned.
# Valid values are 0, 1, and 3. Requests specifying an invalid value will be
# rejected.
# Requests for policies with any conditional bindings must specify version 3.
# Policies without any conditional bindings may specify any valid value or
# leave the field unset.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::BinaryauthorizationV1::IamPolicy] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::BinaryauthorizationV1::IamPolicy]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_policy_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation
command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy
command.params['resource'] = resource unless resource.nil?
command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Sets the access control policy on the specified resource. Replaces any
# existing policy.
# @param [String] resource
# REQUIRED: The resource for which the policy is being specified.
# See the operation documentation for the appropriate value for this field.
# @param [Google::Apis::BinaryauthorizationV1::SetIamPolicyRequest] set_iam_policy_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::BinaryauthorizationV1::IamPolicy] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::BinaryauthorizationV1::IamPolicy]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def set_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
command.request_representation = Google::Apis::BinaryauthorizationV1::SetIamPolicyRequest::Representation
command.request_object = set_iam_policy_request_object
command.response_representation = Google::Apis::BinaryauthorizationV1::IamPolicy::Representation
command.response_class = Google::Apis::BinaryauthorizationV1::IamPolicy
command.params['resource'] = resource unless resource.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Returns permissions that a caller has on the specified resource.
# If the resource does not exist, this will return an empty set of
# permissions, not a NOT_FOUND error.
# Note: This operation is designed to be used for building permission-aware
# UIs and command-line tools, not for authorization checking. This operation
# may "fail open" without warning.
# @param [String] resource
# REQUIRED: The resource for which the policy detail is being requested.
# See the operation documentation for the appropriate value for this field.
# @param [Google::Apis::BinaryauthorizationV1::TestIamPermissionsRequest] test_iam_permissions_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def test_policy_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
command.request_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsRequest::Representation
command.request_object = test_iam_permissions_request_object
command.response_representation = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse::Representation
command.response_class = Google::Apis::BinaryauthorizationV1::TestIamPermissionsResponse
command.params['resource'] = resource unless resource.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
protected

View File

@ -25,60 +25,60 @@ module Google
# @see https://developers.google.com/fit/rest/
module FitnessV1
VERSION = 'V1'
REVISION = '20190627'
REVISION = '20190910'
# View your activity information in Google Fit
# Use Google Fit to see and store your physical activity data
AUTH_FITNESS_ACTIVITY_READ = 'https://www.googleapis.com/auth/fitness.activity.read'
# View and store your activity information in Google Fit
# See and add to your Google Fit physical activity data
AUTH_FITNESS_ACTIVITY_WRITE = 'https://www.googleapis.com/auth/fitness.activity.write'
# View blood glucose data in Google Fit
# See info about your blood glucose in Google Fit
AUTH_FITNESS_BLOOD_GLUCOSE_READ = 'https://www.googleapis.com/auth/fitness.blood_glucose.read'
# View and store blood glucose data in Google Fit
# See and add info about your blood glucose to Google Fit
AUTH_FITNESS_BLOOD_GLUCOSE_WRITE = 'https://www.googleapis.com/auth/fitness.blood_glucose.write'
# View blood pressure data in Google Fit
# See info about your blood pressure in Google Fit
AUTH_FITNESS_BLOOD_PRESSURE_READ = 'https://www.googleapis.com/auth/fitness.blood_pressure.read'
# View and store blood pressure data in Google Fit
# See and add info about your blood pressure in Google Fit
AUTH_FITNESS_BLOOD_PRESSURE_WRITE = 'https://www.googleapis.com/auth/fitness.blood_pressure.write'
# View body sensor information in Google Fit
# See info about your body measurements and heart rate in Google Fit
AUTH_FITNESS_BODY_READ = 'https://www.googleapis.com/auth/fitness.body.read'
# View and store body sensor data in Google Fit
# See and add info about your body measurements and heart rate to Google Fit
AUTH_FITNESS_BODY_WRITE = 'https://www.googleapis.com/auth/fitness.body.write'
# View body temperature data in Google Fit
# See info about your body temperature in Google Fit
AUTH_FITNESS_BODY_TEMPERATURE_READ = 'https://www.googleapis.com/auth/fitness.body_temperature.read'
# View and store body temperature data in Google Fit
# See and add to info about your body temperature in Google Fit
AUTH_FITNESS_BODY_TEMPERATURE_WRITE = 'https://www.googleapis.com/auth/fitness.body_temperature.write'
# View your stored location data in Google Fit
# See your Google Fit speed and distance data
AUTH_FITNESS_LOCATION_READ = 'https://www.googleapis.com/auth/fitness.location.read'
# View and store your location data in Google Fit
# See and add to your Google Fit location data
AUTH_FITNESS_LOCATION_WRITE = 'https://www.googleapis.com/auth/fitness.location.write'
# View nutrition information in Google Fit
# See info about your nutrition in Google Fit
AUTH_FITNESS_NUTRITION_READ = 'https://www.googleapis.com/auth/fitness.nutrition.read'
# View and store nutrition information in Google Fit
# See and add to info about your nutrition in Google Fit
AUTH_FITNESS_NUTRITION_WRITE = 'https://www.googleapis.com/auth/fitness.nutrition.write'
# View oxygen saturation data in Google Fit
# See info about your oxygen saturation in Google Fit
AUTH_FITNESS_OXYGEN_SATURATION_READ = 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read'
# View and store oxygen saturation data in Google Fit
# See and add info about your oxygen saturation in Google Fit
AUTH_FITNESS_OXYGEN_SATURATION_WRITE = 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write'
# View reproductive health data in Google Fit
# See info about your reproductive health in Google Fit
AUTH_FITNESS_REPRODUCTIVE_HEALTH_READ = 'https://www.googleapis.com/auth/fitness.reproductive_health.read'
# View and store reproductive health data in Google Fit
# See and add info about your reproductive health in Google Fit
AUTH_FITNESS_REPRODUCTIVE_HEALTH_WRITE = 'https://www.googleapis.com/auth/fitness.reproductive_health.write'
end
end

View File

@ -25,7 +25,7 @@ module Google
# @see https://cloud.google.com/ml/
module MlV1
VERSION = 'V1'
REVISION = '20190910'
REVISION = '20190913'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -1216,26 +1216,42 @@ module Google
end
end
# Configurations for logging request-response pairs. Currently only BigQuery
# logging is supported. The request and response will be converted to raw
# string and stored within the specified BigQuery table. The schema is:
# model: STRING
# version: STRING
# time: Timestamp
# raw_data: STRING
# raw_prediction: STRING
# ground_truth: STRING
# Configuration for logging request-response pairs to a BigQuery table.
# Online prediction requests to a model version and the responses to these
# requests are converted to raw strings and saved to the specified BigQuery
# table. Logging is constrained by [BigQuery quotas and
# limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
# AI Platform Prediction does not log request-response pairs, but it continues
# to serve predictions.
# If you are using [continuous
# evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
# specify this configuration manually. Setting up continuous evaluation
# automatically enables logging of request-response pairs.
class GoogleCloudMlV1RequestLoggingConfig
include Google::Apis::Core::Hashable
# Fully qualified BigQuery table name in the format of
# "[project_id].[dataset_name].[table_name]".
# Required. Fully qualified BigQuery table name in the following format:
# "<var>project_id</var>.<var>dataset_name</var>.<var>table_name</var>"
# The specifcied table must already exist, and the "Cloud ML Service Agent"
# for your project must have permission to write to it. The table must have
# the following [schema](/bigquery/docs/schemas):
# <table>
# <tr><th>Field name</th><th style="display: table-cell">Type</th>
# <th style="display: table-cell">Mode</th></tr>
# <tr><td>model</td><td>STRING</td><td>REQUIRED</td></tr>
# <tr><td>model_version</td><td>STRING</td><td>REQUIRED</td></tr>
# <tr><td>time</td><td>TIMESTAMP</td><td>REQUIRED</td></tr>
# <tr><td>raw_data</td><td>STRING</td><td>REQUIRED</td></tr>
# <tr><td>raw_prediction</td><td>STRING</td><td>NULLABLE</td></tr>
# <tr><td>groundtruth</td><td>STRING</td><td>NULLABLE</td></tr>
# </table>
# Corresponds to the JSON property `bigqueryTableName`
# @return [String]
attr_accessor :bigquery_table_name
# Percentage of the request being logged. The sampling window is the lifetime
# of the Version. Defaults to 0.
# Percentage of requests to be logged, expressed as a fraction from 0 to 1.
# For example, if you want to log 10% of requests, enter `0.1`. The sampling
# window is the lifetime of the model version. Defaults to 0.
# Corresponds to the JSON property `samplingPercentage`
# @return [Float]
attr_accessor :sampling_percentage
@ -1789,15 +1805,17 @@ module Google
# @return [String]
attr_accessor :python_version
# Configurations for logging request-response pairs. Currently only BigQuery
# logging is supported. The request and response will be converted to raw
# string and stored within the specified BigQuery table. The schema is:
# model: STRING
# version: STRING
# time: Timestamp
# raw_data: STRING
# raw_prediction: STRING
# ground_truth: STRING
# Configuration for logging request-response pairs to a BigQuery table.
# Online prediction requests to a model version and the responses to these
# requests are converted to raw strings and saved to the specified BigQuery
# table. Logging is constrained by [BigQuery quotas and
# limits](/bigquery/quotas). If your project exceeds BigQuery quotas or limits,
# AI Platform Prediction does not log request-response pairs, but it continues
# to serve predictions.
# If you are using [continuous
# evaluation](/ml-engine/docs/continuous-evaluation/), you do not need to
# specify this configuration manually. Setting up continuous evaluation
# automatically enables logging of request-response pairs.
# Corresponds to the JSON property `requestLoggingConfig`
# @return [Google::Apis::MlV1::GoogleCloudMlV1RequestLoggingConfig]
attr_accessor :request_logging_config
@ -2079,7 +2097,12 @@ module Google
# @return [String]
attr_accessor :etag
# Deprecated.
# Specifies the format of the policy.
# Valid values are 0, 1, and 3. Requests specifying an invalid value will be
# rejected.
# Policies with any conditional bindings must specify version 3. Policies
# without any conditional bindings may specify any valid value or leave the
# field unset.
# Corresponds to the JSON property `version`
# @return [Fixnum]
attr_accessor :version

View File

@ -221,9 +221,11 @@ module Google
# See the operation documentation for the appropriate value for this field.
# @param [Fixnum] options_requested_policy_version
# Optional. The policy format version to be returned.
# Acceptable values are 0, 1, and 3.
# If the value is 0, or the field is omitted, policy format version 1 will be
# returned.
# Valid values are 0, 1, and 3. Requests specifying an invalid value will be
# rejected.
# Requests for policies with any conditional bindings must specify version 3.
# Policies without any conditional bindings may specify any valid value or
# leave the field unset.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
@ -617,9 +619,11 @@ module Google
# See the operation documentation for the appropriate value for this field.
# @param [Fixnum] options_requested_policy_version
# Optional. The policy format version to be returned.
# Acceptable values are 0, 1, and 3.
# If the value is 0, or the field is omitted, policy format version 1 will be
# returned.
# Valid values are 0, 1, and 3. Requests specifying an invalid value will be
# rejected.
# Requests for policies with any conditional bindings must specify version 3.
# Policies without any conditional bindings may specify any valid value or
# leave the field unset.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user

View File

@ -30,7 +30,7 @@ module Google
# @see https://cloud.google.com/monitoring/api/
module MonitoringV3
VERSION = 'V3'
REVISION = '20190907'
REVISION = '20190915'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -1883,9 +1883,7 @@ module Google
# for each resource or when aggregating streams across all members of a group of
# resources).When computing ratios, the aggregations and
# denominator_aggregations fields must use the same alignment period and produce
# time series that have the same periodicity and labels.This field is similar to
# the one in the MetricService.ListTimeSeries request. It is advisable to use
# the ListTimeSeries method when debugging this field.
# time series that have the same periodicity and labels.
# Corresponds to the JSON property `denominatorAggregations`
# @return [Array<Google::Apis::MonitoringV3::Aggregation>]
attr_accessor :denominator_aggregations
@ -1893,11 +1891,9 @@ module Google
# A filter that identifies a time series that should be used as the denominator
# of a ratio that will be compared with the threshold. If a denominator_filter
# is specified, the time series specified by the filter field will be used as
# the numerator.The filter is similar to the one that is specified in the
# MetricService.ListTimeSeries request (that call is useful to verify the time
# series that will be retrieved / processed) and must specify the metric type
# and optionally may contain restrictions on resource type, resource labels, and
# metric labels. This field may not exceed 2048 Unicode characters in length.
# the numerator.The filter and must specify the metric type and optionally may
# contain restrictions on resource type, resource labels, and metric labels.
# This field may not exceed 2048 Unicode characters in length.
# Corresponds to the JSON property `denominatorFilter`
# @return [String]
attr_accessor :denominator_filter

View File

@ -26,7 +26,7 @@ module Google
# @see https://cloud.google.com/spanner/
module SpannerV1
VERSION = 'V1'
REVISION = '20190723'
REVISION = '20190911'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -22,6 +22,54 @@ module Google
module Apis
module SpannerV1
# The request for BatchCreateSessions.
class BatchCreateSessionsRequest
include Google::Apis::Core::Hashable
# Required. The number of sessions to be created in this batch call.
# The API may return fewer than the requested number of sessions. If a
# specific number of sessions are desired, the client can make additional
# calls to BatchCreateSessions (adjusting
# session_count as necessary).
# Corresponds to the JSON property `sessionCount`
# @return [Fixnum]
attr_accessor :session_count
# A session in the Cloud Spanner API.
# Corresponds to the JSON property `sessionTemplate`
# @return [Google::Apis::SpannerV1::Session]
attr_accessor :session_template
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@session_count = args[:session_count] if args.key?(:session_count)
@session_template = args[:session_template] if args.key?(:session_template)
end
end
# The response for BatchCreateSessions.
class BatchCreateSessionsResponse
include Google::Apis::Core::Hashable
# The freshly created sessions.
# Corresponds to the JSON property `session`
# @return [Array<Google::Apis::SpannerV1::Session>]
attr_accessor :session
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@session = args[:session] if args.key?(:session)
end
end
# The request for BeginTransaction.
class BeginTransactionRequest
include Google::Apis::Core::Hashable
@ -274,7 +322,7 @@ module Google
# * `allAuthenticatedUsers`: A special identifier that represents anyone
# who is authenticated with a Google account or a service account.
# * `user:`emailid``: An email address that represents a specific Google
# account. For example, `alice@gmail.com` .
# account. For example, `alice@example.com` .
# * `serviceAccount:`emailid``: An email address that represents a service
# account. For example, `my-other-app@appspot.gserviceaccount.com`.
# * `group:`emailid``: An email address that represents a Google group.
@ -1126,12 +1174,40 @@ module Google
class GetIamPolicyRequest
include Google::Apis::Core::Hashable
# Encapsulates settings provided to GetIamPolicy.
# Corresponds to the JSON property `options`
# @return [Google::Apis::SpannerV1::GetPolicyOptions]
attr_accessor :options
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@options = args[:options] if args.key?(:options)
end
end
# Encapsulates settings provided to GetIamPolicy.
class GetPolicyOptions
include Google::Apis::Core::Hashable
# Optional. The policy format version to be returned.
# Acceptable values are 0, 1, and 3.
# If the value is 0, or the field is omitted, policy format version 1 will be
# returned.
# Corresponds to the JSON property `requestedPolicyVersion`
# @return [Fixnum]
attr_accessor :requested_policy_version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)
end
end
@ -2101,7 +2177,7 @@ module Google
# systems are expected to put that etag in the request to `setIamPolicy` to
# ensure that their change will be applied to the same version of the policy.
# If no `etag` is provided in the call to `setIamPolicy`, then the existing
# policy is overwritten blindly.
# policy is overwritten.
# Corresponds to the JSON property `etag`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]

View File

@ -22,6 +22,18 @@ module Google
module Apis
module SpannerV1
class BatchCreateSessionsRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BatchCreateSessionsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BeginTransactionRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -142,6 +154,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class GetPolicyOptions
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Instance
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -418,6 +436,23 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class BatchCreateSessionsRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :session_count, as: 'sessionCount'
property :session_template, as: 'sessionTemplate', class: Google::Apis::SpannerV1::Session, decorator: Google::Apis::SpannerV1::Session::Representation
end
end
class BatchCreateSessionsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :session, as: 'session', class: Google::Apis::SpannerV1::Session, decorator: Google::Apis::SpannerV1::Session::Representation
end
end
class BeginTransactionRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -595,6 +630,15 @@ module Google
class GetIamPolicyRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :options, as: 'options', class: Google::Apis::SpannerV1::GetPolicyOptions, decorator: Google::Apis::SpannerV1::GetPolicyOptions::Representation
end
end
class GetPolicyOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :requested_policy_version, as: 'requestedPolicyVersion'
end
end

View File

@ -974,6 +974,41 @@ module Google
execute_or_queue_command(command, &block)
end
# Creates multiple new sessions.
# This API can be used to initialize a session cache on the clients.
# See https://goo.gl/TgSFN2 for best practices on session cache management.
# @param [String] database
# Required. The database in which the new sessions are created.
# @param [Google::Apis::SpannerV1::BatchCreateSessionsRequest] batch_create_sessions_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::SpannerV1::BatchCreateSessionsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::SpannerV1::BatchCreateSessionsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def batch_create_sessions(database, batch_create_sessions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+database}/sessions:batchCreate', options)
command.request_representation = Google::Apis::SpannerV1::BatchCreateSessionsRequest::Representation
command.request_object = batch_create_sessions_request_object
command.response_representation = Google::Apis::SpannerV1::BatchCreateSessionsResponse::Representation
command.response_class = Google::Apis::SpannerV1::BatchCreateSessionsResponse
command.params['database'] = database unless database.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Begins a new transaction. This step can often be skipped:
# Read, ExecuteSql and
# Commit can begin a new transaction as a

View File

@ -25,7 +25,7 @@ module Google
# @see https://cloud.google.com/speech-to-text/docs/quickstart-protocol
module SpeechV1
VERSION = 'V1'
REVISION = '20190823'
REVISION = '20190918'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -119,7 +119,7 @@ module Google
class LongRunningRecognizeResponse
include Google::Apis::Core::Hashable
# Output only. Sequential list of transcription results corresponding to
# Sequential list of transcription results corresponding to
# sequential portions of audio.
# Corresponds to the JSON property `results`
# @return [Array<Google::Apis::SpeechV1::SpeechRecognitionResult>]
@ -241,7 +241,7 @@ module Google
class RecognitionConfig
include Google::Apis::Core::Hashable
# *Optional* The number of channels in the input audio data.
# The number of channels in the input audio data.
# ONLY set this for MULTI-CHANNEL recognition.
# Valid values for LINEAR16 and FLAC are `1`-`8`.
# Valid values for OGG_OPUS are '1'-'254'.
@ -254,7 +254,12 @@ module Google
# @return [Fixnum]
attr_accessor :audio_channel_count
# *Optional* If 'true', adds punctuation to recognition result hypotheses.
# Config to enable speaker diarization.
# Corresponds to the JSON property `diarizationConfig`
# @return [Google::Apis::SpeechV1::SpeakerDiarizationConfig]
attr_accessor :diarization_config
# If 'true', adds punctuation to recognition result hypotheses.
# This feature is only available in select languages. Setting this for
# requests in other languages has no effect at all.
# The default 'false' value does not add punctuation to result hypotheses.
@ -277,7 +282,7 @@ module Google
attr_accessor :enable_separate_recognition_per_channel
alias_method :enable_separate_recognition_per_channel?, :enable_separate_recognition_per_channel
# *Optional* If `true`, the top result includes a list of words and
# If `true`, the top result includes a list of words and
# the start and end time offsets (timestamps) for those words. If
# `false`, no word-level time offset information is returned. The default is
# `false`.
@ -293,7 +298,7 @@ module Google
# @return [String]
attr_accessor :encoding
# *Required* The language of the supplied audio as a
# Required. The language of the supplied audio as a
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
# Example: "en-US".
# See [Language
@ -303,7 +308,7 @@ module Google
# @return [String]
attr_accessor :language_code
# *Optional* Maximum number of recognition hypotheses to be returned.
# Maximum number of recognition hypotheses to be returned.
# Specifically, the maximum number of `SpeechRecognitionAlternative` messages
# within each `SpeechRecognitionResult`.
# The server may return fewer than `max_alternatives`.
@ -318,7 +323,7 @@ module Google
# @return [Google::Apis::SpeechV1::RecognitionMetadata]
attr_accessor :metadata
# *Optional* Which model to select for the given request. Select the model
# Which model to select for the given request. Select the model
# best suited to your domain to get best results. If a model is not
# explicitly specified, then we auto-select a model based on the parameters
# in the RecognitionConfig.
@ -354,7 +359,7 @@ module Google
# @return [String]
attr_accessor :model
# *Optional* If set to `true`, the server will attempt to filter out
# If set to `true`, the server will attempt to filter out
# profanities, replacing all but the initial character in each filtered word
# with asterisks, e.g. "f***". If set to `false` or omitted, profanities
# won't be filtered out.
@ -374,7 +379,7 @@ module Google
# @return [Fixnum]
attr_accessor :sample_rate_hertz
# *Optional* array of SpeechContext.
# Array of SpeechContext.
# A means to provide context to assist the speech recognition. For more
# information, see
# [speech
@ -383,7 +388,7 @@ module Google
# @return [Array<Google::Apis::SpeechV1::SpeechContext>]
attr_accessor :speech_contexts
# *Optional* Set to true to use an enhanced model for speech recognition.
# Set to true to use an enhanced model for speech recognition.
# If `use_enhanced` is set to true and the `model` field is not set, then
# an appropriate enhanced model is chosen if an enhanced model exists for
# the audio.
@ -402,6 +407,7 @@ module Google
# Update properties of this object
def update!(**args)
@audio_channel_count = args[:audio_channel_count] if args.key?(:audio_channel_count)
@diarization_config = args[:diarization_config] if args.key?(:diarization_config)
@enable_automatic_punctuation = args[:enable_automatic_punctuation] if args.key?(:enable_automatic_punctuation)
@enable_separate_recognition_per_channel = args[:enable_separate_recognition_per_channel] if args.key?(:enable_separate_recognition_per_channel)
@enable_word_time_offsets = args[:enable_word_time_offsets] if args.key?(:enable_word_time_offsets)
@ -529,7 +535,7 @@ module Google
class RecognizeResponse
include Google::Apis::Core::Hashable
# Output only. Sequential list of transcription results corresponding to
# Sequential list of transcription results corresponding to
# sequential portions of audio.
# Corresponds to the JSON property `results`
# @return [Array<Google::Apis::SpeechV1::SpeechRecognitionResult>]
@ -545,12 +551,50 @@ module Google
end
end
# Config to enable speaker diarization.
class SpeakerDiarizationConfig
include Google::Apis::Core::Hashable
# If 'true', enables speaker detection for each recognized word in
# the top alternative of the recognition result using a speaker_tag provided
# in the WordInfo.
# Corresponds to the JSON property `enableSpeakerDiarization`
# @return [Boolean]
attr_accessor :enable_speaker_diarization
alias_method :enable_speaker_diarization?, :enable_speaker_diarization
# Maximum number of speakers in the conversation. This range gives you more
# flexibility by allowing the system to automatically determine the correct
# number of speakers. If not set, the default value is 6.
# Corresponds to the JSON property `maxSpeakerCount`
# @return [Fixnum]
attr_accessor :max_speaker_count
# Minimum number of speakers in the conversation. This range gives you more
# flexibility by allowing the system to automatically determine the correct
# number of speakers. If not set, the default value is 2.
# Corresponds to the JSON property `minSpeakerCount`
# @return [Fixnum]
attr_accessor :min_speaker_count
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@enable_speaker_diarization = args[:enable_speaker_diarization] if args.key?(:enable_speaker_diarization)
@max_speaker_count = args[:max_speaker_count] if args.key?(:max_speaker_count)
@min_speaker_count = args[:min_speaker_count] if args.key?(:min_speaker_count)
end
end
# Provides "hints" to the speech recognizer to favor specific words and phrases
# in the results.
class SpeechContext
include Google::Apis::Core::Hashable
# *Optional* A list of strings containing words and phrases "hints" so that
# A list of strings containing words and phrases "hints" so that
# the speech recognition is more likely to recognize them. This can be used
# to improve the accuracy for specific words and phrases, for example, if
# specific commands are typically spoken by the user. This can also be used
@ -579,7 +623,7 @@ module Google
class SpeechRecognitionAlternative
include Google::Apis::Core::Hashable
# Output only. The confidence estimate between 0.0 and 1.0. A higher number
# The confidence estimate between 0.0 and 1.0. A higher number
# indicates an estimated greater likelihood that the recognized words are
# correct. This field is set only for the top alternative of a non-streaming
# result or, of a streaming result where `is_final=true`.
@ -590,12 +634,12 @@ module Google
# @return [Float]
attr_accessor :confidence
# Output only. Transcript text representing the words that the user spoke.
# Transcript text representing the words that the user spoke.
# Corresponds to the JSON property `transcript`
# @return [String]
attr_accessor :transcript
# Output only. A list of word-specific information for each recognized word.
# A list of word-specific information for each recognized word.
# Note: When `enable_speaker_diarization` is true, you will see all the words
# from the beginning of the audio.
# Corresponds to the JSON property `words`
@ -618,7 +662,7 @@ module Google
class SpeechRecognitionResult
include Google::Apis::Core::Hashable
# Output only. May contain one or more recognition hypotheses (up to the
# May contain one or more recognition hypotheses (up to the
# maximum specified in `max_alternatives`).
# These alternatives are ordered in terms of accuracy, with the top (first)
# alternative being the most probable, as ranked by the recognizer.
@ -687,7 +731,7 @@ module Google
class WordInfo
include Google::Apis::Core::Hashable
# Output only. Time offset relative to the beginning of the audio,
# Time offset relative to the beginning of the audio,
# and corresponding to the end of the spoken word.
# This field is only set if `enable_word_time_offsets=true` and only
# in the top hypothesis.
@ -697,7 +741,16 @@ module Google
# @return [String]
attr_accessor :end_time
# Output only. Time offset relative to the beginning of the audio,
# A distinct integer value is assigned for every speaker within
# the audio. This field specifies which one of those speakers was detected to
# have spoken this word. Value ranges from '1' to diarization_speaker_count.
# speaker_tag is set if enable_speaker_diarization = 'true' and only in the
# top alternative.
# Corresponds to the JSON property `speakerTag`
# @return [Fixnum]
attr_accessor :speaker_tag
# Time offset relative to the beginning of the audio,
# and corresponding to the start of the spoken word.
# This field is only set if `enable_word_time_offsets=true` and only
# in the top hypothesis.
@ -707,7 +760,7 @@ module Google
# @return [String]
attr_accessor :start_time
# Output only. The word corresponding to this set of information.
# The word corresponding to this set of information.
# Corresponds to the JSON property `word`
# @return [String]
attr_accessor :word
@ -719,6 +772,7 @@ module Google
# Update properties of this object
def update!(**args)
@end_time = args[:end_time] if args.key?(:end_time)
@speaker_tag = args[:speaker_tag] if args.key?(:speaker_tag)
@start_time = args[:start_time] if args.key?(:start_time)
@word = args[:word] if args.key?(:word)
end

View File

@ -82,6 +82,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class SpeakerDiarizationConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SpeechContext
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -172,6 +178,8 @@ module Google
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :audio_channel_count, as: 'audioChannelCount'
property :diarization_config, as: 'diarizationConfig', class: Google::Apis::SpeechV1::SpeakerDiarizationConfig, decorator: Google::Apis::SpeechV1::SpeakerDiarizationConfig::Representation
property :enable_automatic_punctuation, as: 'enableAutomaticPunctuation'
property :enable_separate_recognition_per_channel, as: 'enableSeparateRecognitionPerChannel'
property :enable_word_time_offsets, as: 'enableWordTimeOffsets'
@ -222,6 +230,15 @@ module Google
end
end
class SpeakerDiarizationConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :enable_speaker_diarization, as: 'enableSpeakerDiarization'
property :max_speaker_count, as: 'maxSpeakerCount'
property :min_speaker_count, as: 'minSpeakerCount'
end
end
class SpeechContext
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -261,6 +278,7 @@ module Google
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :end_time, as: 'endTime'
property :speaker_tag, as: 'speakerTag'
property :start_time, as: 'startTime'
property :word, as: 'word'
end

View File

@ -25,7 +25,7 @@ module Google
# @see https://cloud.google.com/speech-to-text/docs/quickstart-protocol
module SpeechV1p1beta1
VERSION = 'V1p1beta1'
REVISION = '20190823'
REVISION = '20190918'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -119,7 +119,7 @@ module Google
class LongRunningRecognizeResponse
include Google::Apis::Core::Hashable
# Output only. Sequential list of transcription results corresponding to
# Sequential list of transcription results corresponding to
# sequential portions of audio.
# Corresponds to the JSON property `results`
# @return [Array<Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult>]
@ -241,7 +241,7 @@ module Google
class RecognitionConfig
include Google::Apis::Core::Hashable
# *Optional* A list of up to 3 additional
# A list of up to 3 additional
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
# listing possible alternative languages of the supplied audio.
# See [Language
@ -257,7 +257,7 @@ module Google
# @return [Array<String>]
attr_accessor :alternative_language_codes
# *Optional* The number of channels in the input audio data.
# The number of channels in the input audio data.
# ONLY set this for MULTI-CHANNEL recognition.
# Valid values for LINEAR16 and FLAC are `1`-`8`.
# Valid values for OGG_OPUS are '1'-'254'.
@ -270,12 +270,11 @@ module Google
# @return [Fixnum]
attr_accessor :audio_channel_count
# *Optional* Config to enable speaker diarization.
# Config to enable speaker diarization.
# Corresponds to the JSON property `diarizationConfig`
# @return [Google::Apis::SpeechV1p1beta1::SpeakerDiarizationConfig]
attr_accessor :diarization_config
# *Optional*
# If set, specifies the estimated number of speakers in the conversation.
# Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
# Note: Use diarization_config instead.
@ -283,7 +282,7 @@ module Google
# @return [Fixnum]
attr_accessor :diarization_speaker_count
# *Optional* If 'true', adds punctuation to recognition result hypotheses.
# If 'true', adds punctuation to recognition result hypotheses.
# This feature is only available in select languages. Setting this for
# requests in other languages has no effect at all.
# The default 'false' value does not add punctuation to result hypotheses.
@ -306,7 +305,7 @@ module Google
attr_accessor :enable_separate_recognition_per_channel
alias_method :enable_separate_recognition_per_channel?, :enable_separate_recognition_per_channel
# *Optional* If 'true', enables speaker detection for each recognized word in
# If 'true', enables speaker detection for each recognized word in
# the top alternative of the recognition result using a speaker_tag provided
# in the WordInfo.
# Note: Use diarization_config instead.
@ -315,7 +314,7 @@ module Google
attr_accessor :enable_speaker_diarization
alias_method :enable_speaker_diarization?, :enable_speaker_diarization
# *Optional* If `true`, the top result includes a list of words and the
# If `true`, the top result includes a list of words and the
# confidence for those words. If `false`, no word-level confidence
# information is returned. The default is `false`.
# Corresponds to the JSON property `enableWordConfidence`
@ -323,7 +322,7 @@ module Google
attr_accessor :enable_word_confidence
alias_method :enable_word_confidence?, :enable_word_confidence
# *Optional* If `true`, the top result includes a list of words and
# If `true`, the top result includes a list of words and
# the start and end time offsets (timestamps) for those words. If
# `false`, no word-level time offset information is returned. The default is
# `false`.
@ -339,7 +338,7 @@ module Google
# @return [String]
attr_accessor :encoding
# *Required* The language of the supplied audio as a
# Required. The language of the supplied audio as a
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
# Example: "en-US".
# See [Language
@ -349,7 +348,7 @@ module Google
# @return [String]
attr_accessor :language_code
# *Optional* Maximum number of recognition hypotheses to be returned.
# Maximum number of recognition hypotheses to be returned.
# Specifically, the maximum number of `SpeechRecognitionAlternative` messages
# within each `SpeechRecognitionResult`.
# The server may return fewer than `max_alternatives`.
@ -364,7 +363,7 @@ module Google
# @return [Google::Apis::SpeechV1p1beta1::RecognitionMetadata]
attr_accessor :metadata
# *Optional* Which model to select for the given request. Select the model
# Which model to select for the given request. Select the model
# best suited to your domain to get best results. If a model is not
# explicitly specified, then we auto-select a model based on the parameters
# in the RecognitionConfig.
@ -400,7 +399,7 @@ module Google
# @return [String]
attr_accessor :model
# *Optional* If set to `true`, the server will attempt to filter out
# If set to `true`, the server will attempt to filter out
# profanities, replacing all but the initial character in each filtered word
# with asterisks, e.g. "f***". If set to `false` or omitted, profanities
# won't be filtered out.
@ -420,7 +419,7 @@ module Google
# @return [Fixnum]
attr_accessor :sample_rate_hertz
# *Optional* array of SpeechContext.
# Array of SpeechContext.
# A means to provide context to assist the speech recognition. For more
# information, see
# [speech
@ -429,7 +428,7 @@ module Google
# @return [Array<Google::Apis::SpeechV1p1beta1::SpeechContext>]
attr_accessor :speech_contexts
# *Optional* Set to true to use an enhanced model for speech recognition.
# Set to true to use an enhanced model for speech recognition.
# If `use_enhanced` is set to true and the `model` field is not set, then
# an appropriate enhanced model is chosen if an enhanced model exists for
# the audio.
@ -563,7 +562,7 @@ module Google
# @return [Google::Apis::SpeechV1p1beta1::RecognitionConfig]
attr_accessor :config
# *Optional* The name of the model to use for recognition.
# The name of the model to use for recognition.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
@ -586,7 +585,7 @@ module Google
class RecognizeResponse
include Google::Apis::Core::Hashable
# Output only. Sequential list of transcription results corresponding to
# Sequential list of transcription results corresponding to
# sequential portions of audio.
# Corresponds to the JSON property `results`
# @return [Array<Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult>]
@ -602,11 +601,11 @@ module Google
end
end
# *Optional* Config to enable speaker diarization.
# Config to enable speaker diarization.
class SpeakerDiarizationConfig
include Google::Apis::Core::Hashable
# *Optional* If 'true', enables speaker detection for each recognized word in
# If 'true', enables speaker detection for each recognized word in
# the top alternative of the recognition result using a speaker_tag provided
# in the WordInfo.
# Corresponds to the JSON property `enableSpeakerDiarization`
@ -614,7 +613,6 @@ module Google
attr_accessor :enable_speaker_diarization
alias_method :enable_speaker_diarization?, :enable_speaker_diarization
# *Optional*
# Maximum number of speakers in the conversation. This range gives you more
# flexibility by allowing the system to automatically determine the correct
# number of speakers. If not set, the default value is 6.
@ -622,7 +620,6 @@ module Google
# @return [Fixnum]
attr_accessor :max_speaker_count
# *Optional*
# Minimum number of speakers in the conversation. This range gives you more
# flexibility by allowing the system to automatically determine the correct
# number of speakers. If not set, the default value is 2.
@ -659,7 +656,7 @@ module Google
# @return [Float]
attr_accessor :boost
# *Optional* A list of strings containing words and phrases "hints" so that
# A list of strings containing words and phrases "hints" so that
# the speech recognition is more likely to recognize them. This can be used
# to improve the accuracy for specific words and phrases, for example, if
# specific commands are typically spoken by the user. This can also be used
@ -689,7 +686,7 @@ module Google
class SpeechRecognitionAlternative
include Google::Apis::Core::Hashable
# Output only. The confidence estimate between 0.0 and 1.0. A higher number
# The confidence estimate between 0.0 and 1.0. A higher number
# indicates an estimated greater likelihood that the recognized words are
# correct. This field is set only for the top alternative of a non-streaming
# result or, of a streaming result where `is_final=true`.
@ -700,12 +697,12 @@ module Google
# @return [Float]
attr_accessor :confidence
# Output only. Transcript text representing the words that the user spoke.
# Transcript text representing the words that the user spoke.
# Corresponds to the JSON property `transcript`
# @return [String]
attr_accessor :transcript
# Output only. A list of word-specific information for each recognized word.
# A list of word-specific information for each recognized word.
# Note: When `enable_speaker_diarization` is true, you will see all the words
# from the beginning of the audio.
# Corresponds to the JSON property `words`
@ -728,7 +725,7 @@ module Google
class SpeechRecognitionResult
include Google::Apis::Core::Hashable
# Output only. May contain one or more recognition hypotheses (up to the
# May contain one or more recognition hypotheses (up to the
# maximum specified in `max_alternatives`).
# These alternatives are ordered in terms of accuracy, with the top (first)
# alternative being the most probable, as ranked by the recognizer.
@ -743,10 +740,9 @@ module Google
# @return [Fixnum]
attr_accessor :channel_tag
# Output only. The
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of the
# language in this result. This language code was detected to have the most
# likelihood of being spoken in the audio.
# The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
# of the language in this result. This language code was detected to have
# the most likelihood of being spoken in the audio.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
@ -806,7 +802,7 @@ module Google
class WordInfo
include Google::Apis::Core::Hashable
# Output only. The confidence estimate between 0.0 and 1.0. A higher number
# The confidence estimate between 0.0 and 1.0. A higher number
# indicates an estimated greater likelihood that the recognized words are
# correct. This field is set only for the top alternative of a non-streaming
# result or, of a streaming result where `is_final=true`.
@ -817,7 +813,7 @@ module Google
# @return [Float]
attr_accessor :confidence
# Output only. Time offset relative to the beginning of the audio,
# Time offset relative to the beginning of the audio,
# and corresponding to the end of the spoken word.
# This field is only set if `enable_word_time_offsets=true` and only
# in the top hypothesis.
@ -827,7 +823,7 @@ module Google
# @return [String]
attr_accessor :end_time
# Output only. A distinct integer value is assigned for every speaker within
# A distinct integer value is assigned for every speaker within
# the audio. This field specifies which one of those speakers was detected to
# have spoken this word. Value ranges from '1' to diarization_speaker_count.
# speaker_tag is set if enable_speaker_diarization = 'true' and only in the
@ -836,7 +832,7 @@ module Google
# @return [Fixnum]
attr_accessor :speaker_tag
# Output only. Time offset relative to the beginning of the audio,
# Time offset relative to the beginning of the audio,
# and corresponding to the start of the spoken word.
# This field is only set if `enable_word_time_offsets=true` and only
# in the top hypothesis.
@ -846,7 +842,7 @@ module Google
# @return [String]
attr_accessor :start_time
# Output only. The word corresponding to this set of information.
# The word corresponding to this set of information.
# Corresponds to the JSON property `word`
# @return [String]
attr_accessor :word

View File

@ -25,7 +25,7 @@ module Google
# @see https://cloud.google.com/speech-to-text/docs/quickstart-protocol
module SpeechV2beta
VERSION = 'V2beta'
REVISION = '20190830'
REVISION = '20190918'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -309,9 +309,9 @@ module Google
# in the top hypothesis.
# This is an experimental feature and the accuracy of the time offset can
# vary.
# Corresponds to the JSON property `endTime`
# Corresponds to the JSON property `endOffset`
# @return [String]
attr_accessor :end_time
attr_accessor :end_offset
# Output only. A distinct integer value is assigned for every speaker within
# the audio. This field specifies which one of those speakers was detected to
@ -328,9 +328,9 @@ module Google
# in the top hypothesis.
# This is an experimental feature and the accuracy of the time offset can
# vary.
# Corresponds to the JSON property `startTime`
# Corresponds to the JSON property `startOffset`
# @return [String]
attr_accessor :start_time
attr_accessor :start_offset
# Output only. The word corresponding to this set of information.
# Corresponds to the JSON property `word`
@ -344,9 +344,9 @@ module Google
# Update properties of this object
def update!(**args)
@confidence = args[:confidence] if args.key?(:confidence)
@end_time = args[:end_time] if args.key?(:end_time)
@end_offset = args[:end_offset] if args.key?(:end_offset)
@speaker_tag = args[:speaker_tag] if args.key?(:speaker_tag)
@start_time = args[:start_time] if args.key?(:start_time)
@start_offset = args[:start_offset] if args.key?(:start_offset)
@word = args[:word] if args.key?(:word)
end
end

View File

@ -141,9 +141,9 @@ module Google
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :confidence, as: 'confidence'
property :end_time, as: 'endTime'
property :end_offset, as: 'endOffset'
property :speaker_tag, as: 'speakerTag'
property :start_time, as: 'startTime'
property :start_offset, as: 'startOffset'
property :word, as: 'word'
end
end