Autogenerated update (2020-01-16)

Update:
- accesscontextmanager_v1
- datafusion_v1beta1
- serviceconsumermanagement_v1
- servicenetworking_v1
- servicenetworking_v1beta
- serviceusage_v1
- serviceusage_v1beta1
This commit is contained in:
Google APIs 2020-01-16 00:37:07 +00:00
parent 0a5261b583
commit 9449867bbe
34 changed files with 6138 additions and 512 deletions

View File

@ -0,0 +1,34 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'google/apis/accessapproval_v1/service.rb'
require 'google/apis/accessapproval_v1/classes.rb'
require 'google/apis/accessapproval_v1/representations.rb'
module Google
module Apis
# Access Approval API
#
# An API for controlling access to data by Google personnel.
#
# @see https://cloud.google.com/access-approval/docs
module AccessapprovalV1
VERSION = 'V1'
REVISION = '20200113'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
end
end
end

View File

@ -0,0 +1,417 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module AccessapprovalV1
# Settings on a Project/Folder/Organization related to Access Approval.
class AccessApprovalSettings
include Google::Apis::Core::Hashable
# Output only. This field is read only (not settable via
# UpdateAccessAccessApprovalSettings method). If the field is true, that
# indicates that at least one service is enrolled for Access Approval in one
# or more ancestors of the Project or Folder (this field will always be
# unset for the organization since organizations do not have ancestors).
# Corresponds to the JSON property `enrolledAncestor`
# @return [Boolean]
attr_accessor :enrolled_ancestor
alias_method :enrolled_ancestor?, :enrolled_ancestor
# A list of Google Cloud Services for which the given resource has Access
# Approval enrolled. Access requests for the resource given by name against
# any of these services contained here will be required to have explicit
# approval. If name refers to an organization, enrollment can be done for
# individual services. If name refers to a folder or project, enrollment can
# only be done on an all or nothing basis.
# If a cloud_product is repeated in this list, the first entry will be
# honored and all following entries will be discarded. A maximum of 10
# enrolled services will be enforced, to be expanded as the set of supported
# services is expanded.
# Corresponds to the JSON property `enrolledServices`
# @return [Array<Google::Apis::AccessapprovalV1::EnrolledService>]
attr_accessor :enrolled_services
# The resource name of the settings. Format is one of:
# <ol>
# <li>"projects/`project_id`/accessApprovalSettings"</li>
# <li>"folders/`folder_id`/accessApprovalSettings"</li>
# <li>"organizations/`organization_id`/accessApprovalSettings"</li>
# <ol>
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# A list of email addresses to which notifications relating to approval
# requests should be sent. Notifications relating to a resource will be sent
# to all emails in the settings of ancestor resources of that resource. A
# maximum of 50 email addresses are allowed.
# Corresponds to the JSON property `notificationEmails`
# @return [Array<String>]
attr_accessor :notification_emails
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@enrolled_ancestor = args[:enrolled_ancestor] if args.key?(:enrolled_ancestor)
@enrolled_services = args[:enrolled_services] if args.key?(:enrolled_services)
@name = args[:name] if args.key?(:name)
@notification_emails = args[:notification_emails] if args.key?(:notification_emails)
end
end
# Home office and physical location of the principal.
class AccessLocations
include Google::Apis::Core::Hashable
# The "home office" location of the principal. A two-letter country code
# (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
# limited situations Google systems may refer refer to a region code instead
# of a country code.
# Possible Region Codes:
# <ol>
# <li>ASI: Asia</li>
# <li>EUR: Europe</li>
# <li>OCE: Oceania</li>
# <li>AFR: Africa</li>
# <li>NAM: North America</li>
# <li>SAM: South America</li>
# <li>ANT: Antarctica</li>
# <li>ANY: Any location</li>
# </ol>
# Corresponds to the JSON property `principalOfficeCountry`
# @return [String]
attr_accessor :principal_office_country
# Physical location of the principal at the time of the access. A
# two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
# a region code. In some limited situations Google systems may refer refer to
# a region code instead of a country code.
# Possible Region Codes:
# <ol>
# <li>ASI: Asia</li>
# <li>EUR: Europe</li>
# <li>OCE: Oceania</li>
# <li>AFR: Africa</li>
# <li>NAM: North America</li>
# <li>SAM: South America</li>
# <li>ANT: Antarctica</li>
# <li>ANY: Any location</li>
# </ol>
# Corresponds to the JSON property `principalPhysicalLocationCountry`
# @return [String]
attr_accessor :principal_physical_location_country
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@principal_office_country = args[:principal_office_country] if args.key?(:principal_office_country)
@principal_physical_location_country = args[:principal_physical_location_country] if args.key?(:principal_physical_location_country)
end
end
#
class AccessReason
include Google::Apis::Core::Hashable
# More detail about certain reason types. See comments for each type above.
# Corresponds to the JSON property `detail`
# @return [String]
attr_accessor :detail
# Type of access justification.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@detail = args[:detail] if args.key?(:detail)
@type = args[:type] if args.key?(:type)
end
end
# A request for the customer to approve access to a resource.
class ApprovalRequest
include Google::Apis::Core::Hashable
# A decision that has been made to approve access to a resource.
# Corresponds to the JSON property `approve`
# @return [Google::Apis::AccessapprovalV1::ApproveDecision]
attr_accessor :approve
# A decision that has been made to dismiss an approval request.
# Corresponds to the JSON property `dismiss`
# @return [Google::Apis::AccessapprovalV1::DismissDecision]
attr_accessor :dismiss
# The resource name of the request. Format is
# "`projects|folders|organizations`/`id`/approvalRequests/`approval_request_id`".
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The time at which approval was requested.
# Corresponds to the JSON property `requestTime`
# @return [String]
attr_accessor :request_time
# The requested expiration for the approval. If the request is approved,
# access will be granted from the time of approval until the expiration time.
# Corresponds to the JSON property `requestedExpiration`
# @return [String]
attr_accessor :requested_expiration
# Home office and physical location of the principal.
# Corresponds to the JSON property `requestedLocations`
# @return [Google::Apis::AccessapprovalV1::AccessLocations]
attr_accessor :requested_locations
# The justification for which approval is being requested.
# Corresponds to the JSON property `requestedReason`
# @return [Google::Apis::AccessapprovalV1::AccessReason]
attr_accessor :requested_reason
# The resource for which approval is being requested. The format of the
# resource name is defined at
# https://cloud.google.com/apis/design/resource_names. The resource name here
# may either be a "full" resource name (e.g.
# "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
# resource name (e.g. "shelves/shelf1/books/book2") as described in the
# resource name specification.
# Corresponds to the JSON property `requestedResourceName`
# @return [String]
attr_accessor :requested_resource_name
# The properties associated with the resource of the request.
# Corresponds to the JSON property `requestedResourceProperties`
# @return [Google::Apis::AccessapprovalV1::ResourceProperties]
attr_accessor :requested_resource_properties
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@approve = args[:approve] if args.key?(:approve)
@dismiss = args[:dismiss] if args.key?(:dismiss)
@name = args[:name] if args.key?(:name)
@request_time = args[:request_time] if args.key?(:request_time)
@requested_expiration = args[:requested_expiration] if args.key?(:requested_expiration)
@requested_locations = args[:requested_locations] if args.key?(:requested_locations)
@requested_reason = args[:requested_reason] if args.key?(:requested_reason)
@requested_resource_name = args[:requested_resource_name] if args.key?(:requested_resource_name)
@requested_resource_properties = args[:requested_resource_properties] if args.key?(:requested_resource_properties)
end
end
# Request to approve an ApprovalRequest.
class ApproveApprovalRequestMessage
include Google::Apis::Core::Hashable
# The expiration time of this approval.
# Corresponds to the JSON property `expireTime`
# @return [String]
attr_accessor :expire_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@expire_time = args[:expire_time] if args.key?(:expire_time)
end
end
# A decision that has been made to approve access to a resource.
class ApproveDecision
include Google::Apis::Core::Hashable
# The time at which approval was granted.
# Corresponds to the JSON property `approveTime`
# @return [String]
attr_accessor :approve_time
# The time at which the approval expires.
# Corresponds to the JSON property `expireTime`
# @return [String]
attr_accessor :expire_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@approve_time = args[:approve_time] if args.key?(:approve_time)
@expire_time = args[:expire_time] if args.key?(:expire_time)
end
end
# Request to dismiss an approval request.
class DismissApprovalRequestMessage
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# A decision that has been made to dismiss an approval request.
class DismissDecision
include Google::Apis::Core::Hashable
# The time at which the approval request was dismissed.
# Corresponds to the JSON property `dismissTime`
# @return [String]
attr_accessor :dismiss_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@dismiss_time = args[:dismiss_time] if args.key?(:dismiss_time)
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:
# service Foo `
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
# `
# The JSON representation for `Empty` is empty JSON object ````.
class Empty
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Represents the enrollment of a cloud resource into a specific service.
class EnrolledService
include Google::Apis::Core::Hashable
# The product for which Access Approval will be enrolled. Allowed values are
# listed below (case-sensitive):
# <ol>
# <li>all</li>
# <li>appengine.googleapis.com</li>
# <li>bigquery.googleapis.com</li>
# <li>bigtable.googleapis.com</li>
# <li>cloudkms.googleapis.com</li>
# <li>compute.googleapis.com</li>
# <li>dataflow.googleapis.com</li>
# <li>iam.googleapis.com</li>
# <li>pubsub.googleapis.com</li>
# <li>storage.googleapis.com</li>
# <ol>
# Corresponds to the JSON property `cloudProduct`
# @return [String]
attr_accessor :cloud_product
# The enrollment level of the service.
# Corresponds to the JSON property `enrollmentLevel`
# @return [String]
attr_accessor :enrollment_level
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@cloud_product = args[:cloud_product] if args.key?(:cloud_product)
@enrollment_level = args[:enrollment_level] if args.key?(:enrollment_level)
end
end
# Response to listing of ApprovalRequest objects.
class ListApprovalRequestsResponse
include Google::Apis::Core::Hashable
# Approval request details.
# Corresponds to the JSON property `approvalRequests`
# @return [Array<Google::Apis::AccessapprovalV1::ApprovalRequest>]
attr_accessor :approval_requests
# Token to retrieve the next page of results, or empty if there are no more.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@approval_requests = args[:approval_requests] if args.key?(:approval_requests)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# The properties associated with the resource of the request.
class ResourceProperties
include Google::Apis::Core::Hashable
# Whether an approval will exclude the descendants of the resource being
# requested.
# Corresponds to the JSON property `excludesDescendants`
# @return [Boolean]
attr_accessor :excludes_descendants
alias_method :excludes_descendants?, :excludes_descendants
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@excludes_descendants = args[:excludes_descendants] if args.key?(:excludes_descendants)
end
end
end
end
end

View File

@ -0,0 +1,203 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module AccessapprovalV1
class AccessApprovalSettings
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AccessLocations
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AccessReason
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ApprovalRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ApproveApprovalRequestMessage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ApproveDecision
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DismissApprovalRequestMessage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DismissDecision
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 EnrolledService
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListApprovalRequestsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ResourceProperties
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class AccessApprovalSettings
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :enrolled_ancestor, as: 'enrolledAncestor'
collection :enrolled_services, as: 'enrolledServices', class: Google::Apis::AccessapprovalV1::EnrolledService, decorator: Google::Apis::AccessapprovalV1::EnrolledService::Representation
property :name, as: 'name'
collection :notification_emails, as: 'notificationEmails'
end
end
class AccessLocations
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :principal_office_country, as: 'principalOfficeCountry'
property :principal_physical_location_country, as: 'principalPhysicalLocationCountry'
end
end
class AccessReason
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :detail, as: 'detail'
property :type, as: 'type'
end
end
class ApprovalRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :approve, as: 'approve', class: Google::Apis::AccessapprovalV1::ApproveDecision, decorator: Google::Apis::AccessapprovalV1::ApproveDecision::Representation
property :dismiss, as: 'dismiss', class: Google::Apis::AccessapprovalV1::DismissDecision, decorator: Google::Apis::AccessapprovalV1::DismissDecision::Representation
property :name, as: 'name'
property :request_time, as: 'requestTime'
property :requested_expiration, as: 'requestedExpiration'
property :requested_locations, as: 'requestedLocations', class: Google::Apis::AccessapprovalV1::AccessLocations, decorator: Google::Apis::AccessapprovalV1::AccessLocations::Representation
property :requested_reason, as: 'requestedReason', class: Google::Apis::AccessapprovalV1::AccessReason, decorator: Google::Apis::AccessapprovalV1::AccessReason::Representation
property :requested_resource_name, as: 'requestedResourceName'
property :requested_resource_properties, as: 'requestedResourceProperties', class: Google::Apis::AccessapprovalV1::ResourceProperties, decorator: Google::Apis::AccessapprovalV1::ResourceProperties::Representation
end
end
class ApproveApprovalRequestMessage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :expire_time, as: 'expireTime'
end
end
class ApproveDecision
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :approve_time, as: 'approveTime'
property :expire_time, as: 'expireTime'
end
end
class DismissApprovalRequestMessage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class DismissDecision
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :dismiss_time, as: 'dismissTime'
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class EnrolledService
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cloud_product, as: 'cloudProduct'
property :enrollment_level, as: 'enrollmentLevel'
end
end
class ListApprovalRequestsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :approval_requests, as: 'approvalRequests', class: Google::Apis::AccessapprovalV1::ApprovalRequest, decorator: Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ResourceProperties
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :excludes_descendants, as: 'excludesDescendants'
end
end
end
end
end

View File

@ -0,0 +1,854 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module AccessapprovalV1
# Access Approval API
#
# An API for controlling access to data by Google personnel.
#
# @example
# require 'google/apis/accessapproval_v1'
#
# Accessapproval = Google::Apis::AccessapprovalV1 # Alias the module
# service = Accessapproval::AccessApprovalService.new
#
# @see https://cloud.google.com/access-approval/docs
class AccessApprovalService < Google::Apis::Core::BaseService
# @return [String]
# API key. Your API key identifies your project and provides you with API access,
# quota, and reports. Required unless you provide an OAuth 2.0 token.
attr_accessor :key
# @return [String]
# 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.
attr_accessor :quota_user
def initialize
super('https://accessapproval.googleapis.com/', '')
@batch_path = 'batch'
end
# Deletes the settings associated with a project, folder, or organization.
# This will have the effect of disabling Access Approval for the project,
# folder, or organization, but only if all ancestors also have Access
# Approval disabled. If Access Approval is enabled at a higher level of the
# hierarchy, then Access Approval will still be enabled at this level as
# the settings are inherited.
# @param [String] name
# Name of the AccessApprovalSettings to delete.
# @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::AccessapprovalV1::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::Empty]
#
# @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 delete_folder_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::Empty::Representation
command.response_class = Google::Apis::AccessapprovalV1::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the settings associated with a project, folder, or organization.
# @param [String] name
# Name of the AccessApprovalSettings to retrieve.
# @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::AccessapprovalV1::AccessApprovalSettings] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
#
# @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_folder_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
command.params['name'] = name unless name.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 the settings associated with a project, folder, or organization.
# Settings to update are determined by the value of field_mask.
# @param [String] name
# The resource name of the settings. Format is one of:
# <ol>
# <li>"projects/`project_id`/accessApprovalSettings"</li>
# <li>"folders/`folder_id`/accessApprovalSettings"</li>
# <li>"organizations/`organization_id`/accessApprovalSettings"</li>
# <ol>
# @param [Google::Apis::AccessapprovalV1::AccessApprovalSettings] access_approval_settings_object
# @param [String] update_mask
# For the `FieldMask` definition, see
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
# fieldmask
# If this field is left unset, only the notification_emails field will be
# updated.
# @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::AccessapprovalV1::AccessApprovalSettings] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
#
# @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 update_folder_access_approval_settings(name, access_approval_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'v1/{+name}', options)
command.request_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.request_object = access_approval_settings_object
command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
command.params['name'] = name unless name.nil?
command.query['updateMask'] = update_mask unless update_mask.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Approves a request and returns the updated ApprovalRequest.
# Returns NOT_FOUND if the request does not exist. Returns
# FAILED_PRECONDITION if the request exists but is not in a pending state.
# @param [String] name
# Name of the approval request to approve.
# @param [Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage] approve_approval_request_message_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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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 approve_folder_approval_request(name, approve_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:approve', options)
command.request_representation = Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage::Representation
command.request_object = approve_approval_request_message_object
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Dismisses a request. Returns the updated ApprovalRequest.
# NOTE: This does not deny access to the resource if another request has been
# made and approved. It is equivalent in effect to ignoring the request
# altogether.
# Returns NOT_FOUND if the request does not exist.
# Returns FAILED_PRECONDITION if the request exists but is not in a pending
# state.
# @param [String] name
# Name of the ApprovalRequest to dismiss.
# @param [Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage] dismiss_approval_request_message_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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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 dismiss_folder_approval_request(name, dismiss_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:dismiss', options)
command.request_representation = Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage::Representation
command.request_object = dismiss_approval_request_message_object
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets an approval request. Returns NOT_FOUND if the request does not exist.
# @param [String] name
# Name of the approval request to retrieve.
# @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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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_folder_approval_request(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.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 approval requests associated with a project, folder, or organization.
# Approval requests can be filtered by state (pending, active, dismissed).
# The order is reverse chronological.
# @param [String] parent
# The parent resource. This may be "projects/`project_id`",
# "folders/`folder_id`", or "organizations/`organization_id`".
# @param [String] filter
# A filter on the type of approval requests to retrieve. Must be one of the
# following values:
# <ol>
# <li>[not set]: Requests that are pending or have active approvals.</li>
# <li>ALL: All requests.</li>
# <li>PENDING: Only pending requests.</li>
# <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
# <li>DISMISSED: Only dismissed (including expired) requests.</li>
# </ol>
# @param [Fixnum] page_size
# Requested page size.
# @param [String] page_token
# A token identifying the page of results to return.
# @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::AccessapprovalV1::ListApprovalRequestsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse]
#
# @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 list_folder_approval_requests(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+parent}/approvalRequests', options)
command.response_representation = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse::Representation
command.response_class = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse
command.params['parent'] = parent unless parent.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes the settings associated with a project, folder, or organization.
# This will have the effect of disabling Access Approval for the project,
# folder, or organization, but only if all ancestors also have Access
# Approval disabled. If Access Approval is enabled at a higher level of the
# hierarchy, then Access Approval will still be enabled at this level as
# the settings are inherited.
# @param [String] name
# Name of the AccessApprovalSettings to delete.
# @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::AccessapprovalV1::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::Empty]
#
# @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 delete_organization_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::Empty::Representation
command.response_class = Google::Apis::AccessapprovalV1::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the settings associated with a project, folder, or organization.
# @param [String] name
# Name of the AccessApprovalSettings to retrieve.
# @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::AccessapprovalV1::AccessApprovalSettings] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
#
# @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_organization_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
command.params['name'] = name unless name.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 the settings associated with a project, folder, or organization.
# Settings to update are determined by the value of field_mask.
# @param [String] name
# The resource name of the settings. Format is one of:
# <ol>
# <li>"projects/`project_id`/accessApprovalSettings"</li>
# <li>"folders/`folder_id`/accessApprovalSettings"</li>
# <li>"organizations/`organization_id`/accessApprovalSettings"</li>
# <ol>
# @param [Google::Apis::AccessapprovalV1::AccessApprovalSettings] access_approval_settings_object
# @param [String] update_mask
# For the `FieldMask` definition, see
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
# fieldmask
# If this field is left unset, only the notification_emails field will be
# updated.
# @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::AccessapprovalV1::AccessApprovalSettings] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
#
# @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 update_organization_access_approval_settings(name, access_approval_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'v1/{+name}', options)
command.request_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.request_object = access_approval_settings_object
command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
command.params['name'] = name unless name.nil?
command.query['updateMask'] = update_mask unless update_mask.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Approves a request and returns the updated ApprovalRequest.
# Returns NOT_FOUND if the request does not exist. Returns
# FAILED_PRECONDITION if the request exists but is not in a pending state.
# @param [String] name
# Name of the approval request to approve.
# @param [Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage] approve_approval_request_message_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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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 approve_organization_approval_request(name, approve_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:approve', options)
command.request_representation = Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage::Representation
command.request_object = approve_approval_request_message_object
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Dismisses a request. Returns the updated ApprovalRequest.
# NOTE: This does not deny access to the resource if another request has been
# made and approved. It is equivalent in effect to ignoring the request
# altogether.
# Returns NOT_FOUND if the request does not exist.
# Returns FAILED_PRECONDITION if the request exists but is not in a pending
# state.
# @param [String] name
# Name of the ApprovalRequest to dismiss.
# @param [Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage] dismiss_approval_request_message_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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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 dismiss_organization_approval_request(name, dismiss_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:dismiss', options)
command.request_representation = Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage::Representation
command.request_object = dismiss_approval_request_message_object
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets an approval request. Returns NOT_FOUND if the request does not exist.
# @param [String] name
# Name of the approval request to retrieve.
# @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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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_organization_approval_request(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.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 approval requests associated with a project, folder, or organization.
# Approval requests can be filtered by state (pending, active, dismissed).
# The order is reverse chronological.
# @param [String] parent
# The parent resource. This may be "projects/`project_id`",
# "folders/`folder_id`", or "organizations/`organization_id`".
# @param [String] filter
# A filter on the type of approval requests to retrieve. Must be one of the
# following values:
# <ol>
# <li>[not set]: Requests that are pending or have active approvals.</li>
# <li>ALL: All requests.</li>
# <li>PENDING: Only pending requests.</li>
# <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
# <li>DISMISSED: Only dismissed (including expired) requests.</li>
# </ol>
# @param [Fixnum] page_size
# Requested page size.
# @param [String] page_token
# A token identifying the page of results to return.
# @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::AccessapprovalV1::ListApprovalRequestsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse]
#
# @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 list_organization_approval_requests(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+parent}/approvalRequests', options)
command.response_representation = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse::Representation
command.response_class = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse
command.params['parent'] = parent unless parent.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes the settings associated with a project, folder, or organization.
# This will have the effect of disabling Access Approval for the project,
# folder, or organization, but only if all ancestors also have Access
# Approval disabled. If Access Approval is enabled at a higher level of the
# hierarchy, then Access Approval will still be enabled at this level as
# the settings are inherited.
# @param [String] name
# Name of the AccessApprovalSettings to delete.
# @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::AccessapprovalV1::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::Empty]
#
# @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 delete_project_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::Empty::Representation
command.response_class = Google::Apis::AccessapprovalV1::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the settings associated with a project, folder, or organization.
# @param [String] name
# Name of the AccessApprovalSettings to retrieve.
# @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::AccessapprovalV1::AccessApprovalSettings] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
#
# @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_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
command.params['name'] = name unless name.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 the settings associated with a project, folder, or organization.
# Settings to update are determined by the value of field_mask.
# @param [String] name
# The resource name of the settings. Format is one of:
# <ol>
# <li>"projects/`project_id`/accessApprovalSettings"</li>
# <li>"folders/`folder_id`/accessApprovalSettings"</li>
# <li>"organizations/`organization_id`/accessApprovalSettings"</li>
# <ol>
# @param [Google::Apis::AccessapprovalV1::AccessApprovalSettings] access_approval_settings_object
# @param [String] update_mask
# For the `FieldMask` definition, see
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
# fieldmask
# If this field is left unset, only the notification_emails field will be
# updated.
# @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::AccessapprovalV1::AccessApprovalSettings] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::AccessApprovalSettings]
#
# @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 update_project_access_approval_settings(name, access_approval_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'v1/{+name}', options)
command.request_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.request_object = access_approval_settings_object
command.response_representation = Google::Apis::AccessapprovalV1::AccessApprovalSettings::Representation
command.response_class = Google::Apis::AccessapprovalV1::AccessApprovalSettings
command.params['name'] = name unless name.nil?
command.query['updateMask'] = update_mask unless update_mask.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Approves a request and returns the updated ApprovalRequest.
# Returns NOT_FOUND if the request does not exist. Returns
# FAILED_PRECONDITION if the request exists but is not in a pending state.
# @param [String] name
# Name of the approval request to approve.
# @param [Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage] approve_approval_request_message_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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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 approve_project_approval_request(name, approve_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:approve', options)
command.request_representation = Google::Apis::AccessapprovalV1::ApproveApprovalRequestMessage::Representation
command.request_object = approve_approval_request_message_object
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Dismisses a request. Returns the updated ApprovalRequest.
# NOTE: This does not deny access to the resource if another request has been
# made and approved. It is equivalent in effect to ignoring the request
# altogether.
# Returns NOT_FOUND if the request does not exist.
# Returns FAILED_PRECONDITION if the request exists but is not in a pending
# state.
# @param [String] name
# Name of the ApprovalRequest to dismiss.
# @param [Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage] dismiss_approval_request_message_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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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 dismiss_project_approval_request(name, dismiss_approval_request_message_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:dismiss', options)
command.request_representation = Google::Apis::AccessapprovalV1::DismissApprovalRequestMessage::Representation
command.request_object = dismiss_approval_request_message_object
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets an approval request. Returns NOT_FOUND if the request does not exist.
# @param [String] name
# Name of the approval request to retrieve.
# @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::AccessapprovalV1::ApprovalRequest] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ApprovalRequest]
#
# @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_approval_request(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::AccessapprovalV1::ApprovalRequest::Representation
command.response_class = Google::Apis::AccessapprovalV1::ApprovalRequest
command.params['name'] = name unless name.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 approval requests associated with a project, folder, or organization.
# Approval requests can be filtered by state (pending, active, dismissed).
# The order is reverse chronological.
# @param [String] parent
# The parent resource. This may be "projects/`project_id`",
# "folders/`folder_id`", or "organizations/`organization_id`".
# @param [String] filter
# A filter on the type of approval requests to retrieve. Must be one of the
# following values:
# <ol>
# <li>[not set]: Requests that are pending or have active approvals.</li>
# <li>ALL: All requests.</li>
# <li>PENDING: Only pending requests.</li>
# <li>ACTIVE: Only active (i.e. currently approved) requests.</li>
# <li>DISMISSED: Only dismissed (including expired) requests.</li>
# </ol>
# @param [Fixnum] page_size
# Requested page size.
# @param [String] page_token
# A token identifying the page of results to return.
# @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::AccessapprovalV1::ListApprovalRequestsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse]
#
# @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 list_project_approval_requests(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+parent}/approvalRequests', options)
command.response_representation = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse::Representation
command.response_class = Google::Apis::AccessapprovalV1::ListApprovalRequestsResponse
command.params['parent'] = parent unless parent.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.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
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
end
end
end
end
end

View File

@ -25,7 +25,7 @@ module Google
# @see https://cloud.google.com/access-context-manager/docs/reference/rest/
module AccesscontextmanagerV1
VERSION = 'V1'
REVISION = '20191012'
REVISION = '20200110'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -37,6 +37,13 @@ module Google
# @return [String]
attr_accessor :create_time
# `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language
# to represent the necessary conditions for the level to apply to a request.
# See CEL spec at: https://github.com/google/cel-spec
# Corresponds to the JSON property `custom`
# @return [Google::Apis::AccesscontextmanagerV1::CustomLevel]
attr_accessor :custom
# Description of the `AccessLevel` and its use. Does not affect behavior.
# Corresponds to the JSON property `description`
# @return [String]
@ -67,6 +74,7 @@ module Google
def update!(**args)
@basic = args[:basic] if args.key?(:basic)
@create_time = args[:create_time] if args.key?(:create_time)
@custom = args[:custom] if args.key?(:custom)
@description = args[:description] if args.key?(:description)
@name = args[:name] if args.key?(:name)
@title = args[:title] if args.key?(:title)
@ -247,6 +255,30 @@ module Google
end
end
# `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language
# to represent the necessary conditions for the level to apply to a request.
# See CEL spec at: https://github.com/google/cel-spec
class CustomLevel
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 `expr`
# @return [Google::Apis::AccesscontextmanagerV1::Expr]
attr_accessor :expr
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@expr = args[:expr] if args.key?(:expr)
end
end
# `DevicePolicy` specifies device specific restrictions necessary to acquire a
# given access level. A `DevicePolicy` specifies requirements for requests from
# devices to be granted access levels, it does not do any enforcement on the
@ -328,6 +360,53 @@ 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
# A response to `ListAccessLevelsRequest`.
class ListAccessLevelsResponse
include Google::Apis::Core::Hashable

View File

@ -52,6 +52,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class CustomLevel
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DevicePolicy
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -64,6 +70,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class Expr
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListAccessLevelsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -124,6 +136,8 @@ module Google
property :basic, as: 'basic', class: Google::Apis::AccesscontextmanagerV1::BasicLevel, decorator: Google::Apis::AccesscontextmanagerV1::BasicLevel::Representation
property :create_time, as: 'createTime'
property :custom, as: 'custom', class: Google::Apis::AccesscontextmanagerV1::CustomLevel, decorator: Google::Apis::AccesscontextmanagerV1::CustomLevel::Representation
property :description, as: 'description'
property :name, as: 'name'
property :title, as: 'title'
@ -170,6 +184,14 @@ module Google
end
end
class CustomLevel
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :expr, as: 'expr', class: Google::Apis::AccesscontextmanagerV1::Expr, decorator: Google::Apis::AccesscontextmanagerV1::Expr::Representation
end
end
class DevicePolicy
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -189,6 +211,16 @@ module Google
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 ListAccessLevelsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation

View File

@ -0,0 +1,34 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'google/apis/cloudbuild_v1alpha2/service.rb'
require 'google/apis/cloudbuild_v1alpha2/classes.rb'
require 'google/apis/cloudbuild_v1alpha2/representations.rb'
module Google
module Apis
# Cloud Build API
#
# Creates and manages builds on Google Cloud Platform.
#
# @see https://cloud.google.com/cloud-build/docs/
module CloudbuildV1alpha2
VERSION = 'V1alpha2'
REVISION = '20200108'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
end
end
end

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,429 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module CloudbuildV1alpha2
class ArtifactObjects
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ArtifactResult
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Artifacts
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Build
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BuildOperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BuildOptions
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BuildStep
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BuiltImage
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 FileHashes
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class HashProp
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListWorkerPoolsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class NetworkConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class RepoSource
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Results
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Secret
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Source
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SourceProvenance
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class StorageSource
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TimeSpan
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Volume
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class WorkerConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class WorkerPool
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ArtifactObjects
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :location, as: 'location'
collection :paths, as: 'paths'
property :timing, as: 'timing', class: Google::Apis::CloudbuildV1alpha2::TimeSpan, decorator: Google::Apis::CloudbuildV1alpha2::TimeSpan::Representation
end
end
class ArtifactResult
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :file_hash, as: 'fileHash', class: Google::Apis::CloudbuildV1alpha2::FileHashes, decorator: Google::Apis::CloudbuildV1alpha2::FileHashes::Representation
property :location, as: 'location'
end
end
class Artifacts
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :images, as: 'images'
property :objects, as: 'objects', class: Google::Apis::CloudbuildV1alpha2::ArtifactObjects, decorator: Google::Apis::CloudbuildV1alpha2::ArtifactObjects::Representation
end
end
class Build
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :artifacts, as: 'artifacts', class: Google::Apis::CloudbuildV1alpha2::Artifacts, decorator: Google::Apis::CloudbuildV1alpha2::Artifacts::Representation
property :build_trigger_id, as: 'buildTriggerId'
property :create_time, as: 'createTime'
property :finish_time, as: 'finishTime'
property :id, as: 'id'
collection :images, as: 'images'
property :log_url, as: 'logUrl'
property :logs_bucket, as: 'logsBucket'
property :options, as: 'options', class: Google::Apis::CloudbuildV1alpha2::BuildOptions, decorator: Google::Apis::CloudbuildV1alpha2::BuildOptions::Representation
property :project_id, as: 'projectId'
property :results, as: 'results', class: Google::Apis::CloudbuildV1alpha2::Results, decorator: Google::Apis::CloudbuildV1alpha2::Results::Representation
collection :secrets, as: 'secrets', class: Google::Apis::CloudbuildV1alpha2::Secret, decorator: Google::Apis::CloudbuildV1alpha2::Secret::Representation
property :source, as: 'source', class: Google::Apis::CloudbuildV1alpha2::Source, decorator: Google::Apis::CloudbuildV1alpha2::Source::Representation
property :source_provenance, as: 'sourceProvenance', class: Google::Apis::CloudbuildV1alpha2::SourceProvenance, decorator: Google::Apis::CloudbuildV1alpha2::SourceProvenance::Representation
property :start_time, as: 'startTime'
property :status, as: 'status'
property :status_detail, as: 'statusDetail'
collection :steps, as: 'steps', class: Google::Apis::CloudbuildV1alpha2::BuildStep, decorator: Google::Apis::CloudbuildV1alpha2::BuildStep::Representation
hash :substitutions, as: 'substitutions'
collection :tags, as: 'tags'
property :timeout, as: 'timeout'
hash :timing, as: 'timing', class: Google::Apis::CloudbuildV1alpha2::TimeSpan, decorator: Google::Apis::CloudbuildV1alpha2::TimeSpan::Representation
end
end
class BuildOperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :build, as: 'build', class: Google::Apis::CloudbuildV1alpha2::Build, decorator: Google::Apis::CloudbuildV1alpha2::Build::Representation
end
end
class BuildOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :disk_size_gb, :numeric_string => true, as: 'diskSizeGb'
collection :env, as: 'env'
property :log_streaming_option, as: 'logStreamingOption'
property :logging, as: 'logging'
property :machine_type, as: 'machineType'
property :requested_verify_option, as: 'requestedVerifyOption'
collection :secret_env, as: 'secretEnv'
collection :source_provenance_hash, as: 'sourceProvenanceHash'
property :substitution_option, as: 'substitutionOption'
collection :volumes, as: 'volumes', class: Google::Apis::CloudbuildV1alpha2::Volume, decorator: Google::Apis::CloudbuildV1alpha2::Volume::Representation
property :worker_pool, as: 'workerPool'
end
end
class BuildStep
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :args, as: 'args'
property :dir, as: 'dir'
property :entrypoint, as: 'entrypoint'
collection :env, as: 'env'
property :id, as: 'id'
property :name, as: 'name'
property :pull_timing, as: 'pullTiming', class: Google::Apis::CloudbuildV1alpha2::TimeSpan, decorator: Google::Apis::CloudbuildV1alpha2::TimeSpan::Representation
collection :secret_env, as: 'secretEnv'
property :status, as: 'status'
property :timeout, as: 'timeout'
property :timing, as: 'timing', class: Google::Apis::CloudbuildV1alpha2::TimeSpan, decorator: Google::Apis::CloudbuildV1alpha2::TimeSpan::Representation
collection :volumes, as: 'volumes', class: Google::Apis::CloudbuildV1alpha2::Volume, decorator: Google::Apis::CloudbuildV1alpha2::Volume::Representation
collection :wait_for, as: 'waitFor'
end
end
class BuiltImage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :digest, as: 'digest'
property :name, as: 'name'
property :push_timing, as: 'pushTiming', class: Google::Apis::CloudbuildV1alpha2::TimeSpan, decorator: Google::Apis::CloudbuildV1alpha2::TimeSpan::Representation
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class FileHashes
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :file_hash, as: 'fileHash', class: Google::Apis::CloudbuildV1alpha2::HashProp, decorator: Google::Apis::CloudbuildV1alpha2::HashProp::Representation
end
end
class HashProp
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :type, as: 'type'
property :value, :base64 => true, as: 'value'
end
end
class ListWorkerPoolsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :worker_pools, as: 'workerPools', class: Google::Apis::CloudbuildV1alpha2::WorkerPool, decorator: Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
end
end
class NetworkConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :peered_network, as: 'peeredNetwork'
end
end
class RepoSource
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :branch_name, as: 'branchName'
property :commit_sha, as: 'commitSha'
property :dir, as: 'dir'
property :project_id, as: 'projectId'
property :repo_name, as: 'repoName'
hash :substitutions, as: 'substitutions'
property :tag_name, as: 'tagName'
end
end
class Results
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :artifact_manifest, as: 'artifactManifest'
property :artifact_timing, as: 'artifactTiming', class: Google::Apis::CloudbuildV1alpha2::TimeSpan, decorator: Google::Apis::CloudbuildV1alpha2::TimeSpan::Representation
collection :build_step_images, as: 'buildStepImages'
collection :build_step_outputs, as: 'buildStepOutputs'
collection :images, as: 'images', class: Google::Apis::CloudbuildV1alpha2::BuiltImage, decorator: Google::Apis::CloudbuildV1alpha2::BuiltImage::Representation
property :num_artifacts, :numeric_string => true, as: 'numArtifacts'
end
end
class Secret
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :kms_key_name, as: 'kmsKeyName'
hash :secret_env, as: 'secretEnv'
end
end
class Source
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :repo_source, as: 'repoSource', class: Google::Apis::CloudbuildV1alpha2::RepoSource, decorator: Google::Apis::CloudbuildV1alpha2::RepoSource::Representation
property :storage_source, as: 'storageSource', class: Google::Apis::CloudbuildV1alpha2::StorageSource, decorator: Google::Apis::CloudbuildV1alpha2::StorageSource::Representation
end
end
class SourceProvenance
# @private
class Representation < Google::Apis::Core::JsonRepresentation
hash :file_hashes, as: 'fileHashes', class: Google::Apis::CloudbuildV1alpha2::FileHashes, decorator: Google::Apis::CloudbuildV1alpha2::FileHashes::Representation
property :resolved_repo_source, as: 'resolvedRepoSource', class: Google::Apis::CloudbuildV1alpha2::RepoSource, decorator: Google::Apis::CloudbuildV1alpha2::RepoSource::Representation
property :resolved_storage_source, as: 'resolvedStorageSource', class: Google::Apis::CloudbuildV1alpha2::StorageSource, decorator: Google::Apis::CloudbuildV1alpha2::StorageSource::Representation
end
end
class StorageSource
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :bucket, as: 'bucket'
property :generation, :numeric_string => true, as: 'generation'
property :object, as: 'object'
end
end
class TimeSpan
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :end_time, as: 'endTime'
property :start_time, as: 'startTime'
end
end
class Volume
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :name, as: 'name'
property :path, as: 'path'
end
end
class WorkerConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :disk_size_gb, :numeric_string => true, as: 'diskSizeGb'
property :machine_type, as: 'machineType'
end
end
class WorkerPool
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :create_time, as: 'createTime'
property :delete_time, as: 'deleteTime'
property :name, as: 'name'
property :network_config, as: 'networkConfig', class: Google::Apis::CloudbuildV1alpha2::NetworkConfig, decorator: Google::Apis::CloudbuildV1alpha2::NetworkConfig::Representation
property :region, as: 'region'
property :state, as: 'state'
property :update_time, as: 'updateTime'
property :worker_config, as: 'workerConfig', class: Google::Apis::CloudbuildV1alpha2::WorkerConfig, decorator: Google::Apis::CloudbuildV1alpha2::WorkerConfig::Representation
end
end
end
end
end

View File

@ -0,0 +1,232 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module CloudbuildV1alpha2
# Cloud Build API
#
# Creates and manages builds on Google Cloud Platform.
#
# @example
# require 'google/apis/cloudbuild_v1alpha2'
#
# Cloudbuild = Google::Apis::CloudbuildV1alpha2 # Alias the module
# service = Cloudbuild::CloudBuildService.new
#
# @see https://cloud.google.com/cloud-build/docs/
class CloudBuildService < Google::Apis::Core::BaseService
# @return [String]
# API key. Your API key identifies your project and provides you with API access,
# quota, and reports. Required unless you provide an OAuth 2.0 token.
attr_accessor :key
# @return [String]
# 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.
attr_accessor :quota_user
def initialize
super('https://cloudbuild.googleapis.com/', '')
@batch_path = 'batch'
end
# Creates a `WorkerPool` to run the builds, and returns the new worker pool.
# @param [String] parent
# Required. The parent resource where this book will be created.
# Format: projects/`project`
# @param [Google::Apis::CloudbuildV1alpha2::WorkerPool] worker_pool_object
# @param [String] worker_pool_id
# Required. Immutable. The ID to use for the `WorkerPool`, which will become the
# final component
# of the resource name.
# This value should be 1-63 characters, and valid characters
# are /a-z-/.
# @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::CloudbuildV1alpha2::WorkerPool] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudbuildV1alpha2::WorkerPool]
#
# @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 create_project_worker_pool(parent, worker_pool_object = nil, worker_pool_id: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1alpha2/{+parent}/workerPools', options)
command.request_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
command.request_object = worker_pool_object
command.response_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
command.response_class = Google::Apis::CloudbuildV1alpha2::WorkerPool
command.params['parent'] = parent unless parent.nil?
command.query['workerPoolId'] = worker_pool_id unless worker_pool_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a `WorkerPool`.
# @param [String] name
# Required. The name of the `WorkerPool` to delete.
# Format: projects/`project`/workerPools/`workerPool`
# @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::CloudbuildV1alpha2::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudbuildV1alpha2::Empty]
#
# @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 delete_project_worker_pool(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1alpha2/{+name}', options)
command.response_representation = Google::Apis::CloudbuildV1alpha2::Empty::Representation
command.response_class = Google::Apis::CloudbuildV1alpha2::Empty
command.params['name'] = name unless name.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 details of a `WorkerPool`.
# @param [String] name
# Required. The name of the `WorkerPool` to retrieve.
# Format: projects/`project`/workerPools/`workerPool`
# @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::CloudbuildV1alpha2::WorkerPool] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudbuildV1alpha2::WorkerPool]
#
# @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_worker_pool(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha2/{+name}', options)
command.response_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
command.response_class = Google::Apis::CloudbuildV1alpha2::WorkerPool
command.params['name'] = name unless name.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 `WorkerPool`s by project.
# @param [String] parent
# Required. The parent, which owns this collection of `WorkerPools`.
# Format: projects/`project`
# @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::CloudbuildV1alpha2::ListWorkerPoolsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudbuildV1alpha2::ListWorkerPoolsResponse]
#
# @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 list_project_worker_pools(parent, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha2/{+parent}/workerPools', options)
command.response_representation = Google::Apis::CloudbuildV1alpha2::ListWorkerPoolsResponse::Representation
command.response_class = Google::Apis::CloudbuildV1alpha2::ListWorkerPoolsResponse
command.params['parent'] = parent unless parent.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 a `WorkerPool`.
# @param [String] name
# Output only. The resource name of the `WorkerPool`.
# Format of the name is `projects/`project_id`/workerPools/`worker_pool_id``,
# where the value of `worker_pool_id` is provided in the CreateWorkerPool
# request.
# @param [Google::Apis::CloudbuildV1alpha2::WorkerPool] worker_pool_object
# @param [String] update_mask
# A mask specifying which fields in `WorkerPool` should be updated.
# @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::CloudbuildV1alpha2::WorkerPool] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::CloudbuildV1alpha2::WorkerPool]
#
# @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 patch_project_worker_pool(name, worker_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'v1alpha2/{+name}', options)
command.request_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
command.request_object = worker_pool_object
command.response_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
command.response_class = Google::Apis::CloudbuildV1alpha2::WorkerPool
command.params['name'] = name unless name.nil?
command.query['updateMask'] = update_mask unless update_mask.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
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
end
end
end
end
end

View File

@ -34,7 +34,7 @@ module Google
# @see https://cloud.google.com/data-fusion/docs
module DatafusionV1beta1
VERSION = 'V1beta1'
REVISION = '20191007'
REVISION = '20200114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -77,11 +77,6 @@ module Google
# @return [Array<Google::Apis::DatafusionV1beta1::AuditLogConfig>]
attr_accessor :audit_log_configs
#
# Corresponds to the JSON property `exemptedMembers`
# @return [Array<String>]
attr_accessor :exempted_members
# Specifies a service that will be enabled for audit logging.
# For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
# `allServices` is a special value that covers all services.
@ -96,7 +91,6 @@ module Google
# Update properties of this object
def update!(**args)
@audit_log_configs = args[:audit_log_configs] if args.key?(:audit_log_configs)
@exempted_members = args[:exempted_members] if args.key?(:exempted_members)
@service = args[:service] if args.key?(:service)
end
end
@ -128,12 +122,6 @@ module Google
# @return [Array<String>]
attr_accessor :exempted_members
#
# Corresponds to the JSON property `ignoreChildExemptions`
# @return [Boolean]
attr_accessor :ignore_child_exemptions
alias_method :ignore_child_exemptions?, :ignore_child_exemptions
# The log type that this config enables.
# Corresponds to the JSON property `logType`
# @return [String]
@ -146,30 +134,10 @@ module Google
# Update properties of this object
def update!(**args)
@exempted_members = args[:exempted_members] if args.key?(:exempted_members)
@ignore_child_exemptions = args[:ignore_child_exemptions] if args.key?(:ignore_child_exemptions)
@log_type = args[:log_type] if args.key?(:log_type)
end
end
# Authorization-related information used by Cloud Audit Logging.
class AuthorizationLoggingOptions
include Google::Apis::Core::Hashable
# The type of the permission that was checked.
# Corresponds to the JSON property `permissionType`
# @return [String]
attr_accessor :permission_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@permission_type = args[:permission_type] if args.key?(:permission_type)
end
end
# Associates `members` with a `role`.
class Binding
include Google::Apis::Core::Hashable
@ -194,6 +162,23 @@ module Google
# account. For example, `my-other-app@appspot.gserviceaccount.com`.
# * `group:`emailid``: An email address that represents a Google group.
# For example, `admins@example.com`.
# * `deleted:user:`emailid`?uid=`uniqueid``: An email address (plus unique
# identifier) representing a user that has been recently deleted. For
# example, `alice@example.com?uid=123456789012345678901`. If the user is
# recovered, this value reverts to `user:`emailid`` and the recovered user
# retains the role in the binding.
# * `deleted:serviceAccount:`emailid`?uid=`uniqueid``: An email address (plus
# unique identifier) representing a service account that has been recently
# deleted. For example,
# `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
# If the service account is undeleted, this value reverts to
# `serviceAccount:`emailid`` and the undeleted service account retains the
# role in the binding.
# * `deleted:group:`emailid`?uid=`uniqueid``: An email address (plus unique
# identifier) representing a Google group that has been recently
# deleted. For example, `admins@example.com?uid=123456789012345678901`. If
# the group is recovered, this value reverts to `group:`emailid`` and the
# recovered group retains the role in the binding.
# * `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`
@ -231,172 +216,6 @@ module Google
end
end
# Write a Cloud Audit log
class CloudAuditOptions
include Google::Apis::Core::Hashable
# Authorization-related information used by Cloud Audit Logging.
# Corresponds to the JSON property `authorizationLoggingOptions`
# @return [Google::Apis::DatafusionV1beta1::AuthorizationLoggingOptions]
attr_accessor :authorization_logging_options
# The log_name to populate in the Cloud Audit Record.
# Corresponds to the JSON property `logName`
# @return [String]
attr_accessor :log_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@authorization_logging_options = args[:authorization_logging_options] if args.key?(:authorization_logging_options)
@log_name = args[:log_name] if args.key?(:log_name)
end
end
# A condition to be met.
class Condition
include Google::Apis::Core::Hashable
# Trusted attributes supplied by the IAM system.
# Corresponds to the JSON property `iam`
# @return [String]
attr_accessor :iam
# An operator to apply the subject with.
# Corresponds to the JSON property `op`
# @return [String]
attr_accessor :op
# Trusted attributes discharged by the service.
# Corresponds to the JSON property `svc`
# @return [String]
attr_accessor :svc
# Trusted attributes supplied by any service that owns resources and uses
# the IAM system for access control.
# Corresponds to the JSON property `sys`
# @return [String]
attr_accessor :sys
# The objects of the condition.
# Corresponds to the JSON property `values`
# @return [Array<String>]
attr_accessor :values
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@iam = args[:iam] if args.key?(:iam)
@op = args[:op] if args.key?(:op)
@svc = args[:svc] if args.key?(:svc)
@sys = args[:sys] if args.key?(:sys)
@values = args[:values] if args.key?(:values)
end
end
# Increment a streamz counter with the specified metric and field names.
# Metric names should start with a '/', generally be lowercase-only,
# and end in "_count". Field names should not contain an initial slash.
# The actual exported metric names will have "/iam/policy" prepended.
# Field names correspond to IAM request parameters and field values are
# their respective values.
# Supported field names:
# - "authority", which is "[token]" if IAMContext.token is present,
# otherwise the value of IAMContext.authority_selector if present, and
# otherwise a representation of IAMContext.principal; or
# - "iam_principal", a representation of IAMContext.principal even if a
# token or authority selector is present; or
# - "" (empty string), resulting in a counter with no fields.
# Examples:
# counter ` metric: "/debug_access_count" field: "iam_principal" `
# ==> increment counter /iam/policy/debug_access_count
# `iam_principal=[value of IAMContext.principal]`
class CounterOptions
include Google::Apis::Core::Hashable
# Custom fields.
# Corresponds to the JSON property `customFields`
# @return [Array<Google::Apis::DatafusionV1beta1::CustomField>]
attr_accessor :custom_fields
# The field value to attribute.
# Corresponds to the JSON property `field`
# @return [String]
attr_accessor :field
# The metric to update.
# Corresponds to the JSON property `metric`
# @return [String]
attr_accessor :metric
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@custom_fields = args[:custom_fields] if args.key?(:custom_fields)
@field = args[:field] if args.key?(:field)
@metric = args[:metric] if args.key?(:metric)
end
end
# Custom fields.
# These can be used to create a counter with arbitrary field/value
# pairs.
# See: go/rpcsp-custom-fields.
class CustomField
include Google::Apis::Core::Hashable
# Name is the field name.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Value is the field value. It is important that in contrast to the
# CounterOptions.field, the value here is a constant that is not
# derived from the IAMContext.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@name = args[:name] if args.key?(:name)
@value = args[:value] if args.key?(:value)
end
end
# Write a Data Access (Gin) log
class DataAccessOptions
include Google::Apis::Core::Hashable
# Whether Gin logging should happen in a fail-closed manner at the caller.
# This is relevant only in the LocalIAM implementation, for now.
# Corresponds to the JSON property `logMode`
# @return [String]
attr_accessor :log_mode
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@log_mode = args[:log_mode] if args.key?(:log_mode)
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:
@ -505,9 +324,15 @@ module Google
attr_accessor :enable_stackdriver_monitoring
alias_method :enable_stackdriver_monitoring?, :enable_stackdriver_monitoring
# Output only. Cloud Storage bucket generated by Data Fusion in the customer
# project.
# Corresponds to the JSON property `gcsBucket`
# @return [String]
attr_accessor :gcs_bucket
# The resource labels for instance to use to annotate any related underlying
# resources such as GCE VMs. The character '=' is not allowed to be used
# within the labels.
# resources such as Compute Engine VMs. The character '=' is not allowed to
# be used within the labels.
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
@ -574,7 +399,7 @@ module Google
# @return [String]
attr_accessor :update_time
# Current version of the Data Fusion. Only specifiable in Update.
# Current version of Data Fusion.
# Corresponds to the JSON property `version`
# @return [String]
attr_accessor :version
@ -597,6 +422,7 @@ module Google
@display_name = args[:display_name] if args.key?(:display_name)
@enable_stackdriver_logging = args[:enable_stackdriver_logging] if args.key?(:enable_stackdriver_logging)
@enable_stackdriver_monitoring = args[:enable_stackdriver_monitoring] if args.key?(:enable_stackdriver_monitoring)
@gcs_bucket = args[:gcs_bucket] if args.key?(:gcs_bucket)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@network_config = args[:network_config] if args.key?(:network_config)
@ -742,53 +568,6 @@ module Google
end
end
# Specifies what kind of log the caller must write
class LogConfig
include Google::Apis::Core::Hashable
# Write a Cloud Audit log
# Corresponds to the JSON property `cloudAudit`
# @return [Google::Apis::DatafusionV1beta1::CloudAuditOptions]
attr_accessor :cloud_audit
# Increment a streamz counter with the specified metric and field names.
# Metric names should start with a '/', generally be lowercase-only,
# and end in "_count". Field names should not contain an initial slash.
# The actual exported metric names will have "/iam/policy" prepended.
# Field names correspond to IAM request parameters and field values are
# their respective values.
# Supported field names:
# - "authority", which is "[token]" if IAMContext.token is present,
# otherwise the value of IAMContext.authority_selector if present, and
# otherwise a representation of IAMContext.principal; or
# - "iam_principal", a representation of IAMContext.principal even if a
# token or authority selector is present; or
# - "" (empty string), resulting in a counter with no fields.
# Examples:
# counter ` metric: "/debug_access_count" field: "iam_principal" `
# ==> increment counter /iam/policy/debug_access_count
# `iam_principal=[value of IAMContext.principal]`
# Corresponds to the JSON property `counter`
# @return [Google::Apis::DatafusionV1beta1::CounterOptions]
attr_accessor :counter
# Write a Data Access (Gin) log
# Corresponds to the JSON property `dataAccess`
# @return [Google::Apis::DatafusionV1beta1::DataAccessOptions]
attr_accessor :data_access
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@cloud_audit = args[:cloud_audit] if args.key?(:cloud_audit)
@counter = args[:counter] if args.key?(:counter)
@data_access = args[:data_access] if args.key?(:data_access)
end
end
# Network configuration for a Data Fusion instance. These configurations
# are used for peering with the customer network. Configurations are optional
# when a public Data Fusion instance is to be created. However, providing
@ -947,16 +726,18 @@ module Google
end
end
# Defines an Identity and Access Management (IAM) policy. It is used to
# specify access control policies for Cloud Platform resources.
# An Identity and Access Management (IAM) policy, which specifies access
# controls for Google Cloud resources.
# A `Policy` is a collection of `bindings`. A `binding` binds one or more
# `members` to a single `role`. Members can be user accounts, service accounts,
# Google groups, and domains (such as G Suite). A `role` is a named list of
# permissions (defined by IAM or configured by users). A `binding` can
# optionally specify a `condition`, which is a logic expression that further
# constrains the role binding based on attributes about the request and/or
# target resource.
# **JSON Example**
# permissions; each `role` can be an IAM predefined role or a user-created
# custom role.
# Optionally, a `binding` can specify a `condition`, which is a logical
# expression that allows access to a resource only if the expression evaluates
# to `true`. A condition can add constraints based on attributes of the
# request, the resource, or both.
# **JSON example:**
# `
# "bindings": [
# `
@ -974,13 +755,15 @@ module Google
# "condition": `
# "title": "expirable access",
# "description": "Does not grant access after Sep 2020",
# "expression": "request.time <
# timestamp('2020-10-01T00:00:00.000Z')",
# "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')
# ",
# `
# `
# ]
# ],
# "etag": "BwWWja0YfJA=",
# "version": 3
# `
# **YAML Example**
# **YAML example:**
# bindings:
# - members:
# - user:mike@example.com
@ -995,8 +778,10 @@ module Google
# title: expirable access
# description: Does not grant access after Sep 2020
# expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
# - etag: BwWWja0YfJA=
# - version: 3
# For a description of IAM and its features, see the
# [IAM developer's guide](https://cloud.google.com/iam/docs).
# [IAM documentation](https://cloud.google.com/iam/docs/).
class Policy
include Google::Apis::Core::Hashable
@ -1005,9 +790,9 @@ module Google
# @return [Array<Google::Apis::DatafusionV1beta1::AuditConfig>]
attr_accessor :audit_configs
# Associates a list of `members` to a `role`. Optionally may specify a
# `condition` that determines when binding is in effect.
# `bindings` with no members will result in an error.
# Associates a list of `members` to a `role`. Optionally, may specify a
# `condition` that determines how and when the `bindings` are applied. Each
# of the `bindings` must contain at least one member.
# Corresponds to the JSON property `bindings`
# @return [Array<Google::Apis::DatafusionV1beta1::Binding>]
attr_accessor :bindings
@ -1019,44 +804,31 @@ module Google
# 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. Due to blind-set semantics of an etag-less policy,
# 'setIamPolicy' will not fail even if either of incoming or stored policy
# does not meet the version requirements.
# **Important:** If you use IAM Conditions, you must include the `etag` field
# whenever you call `setIamPolicy`. If you omit this field, then IAM allows
# you to overwrite a version `3` policy with a version `1` policy, and all of
# the conditions in the version `3` policy are lost.
# Corresponds to the JSON property `etag`
# NOTE: Values are automatically base64 encoded/decoded in the client library.
# @return [String]
attr_accessor :etag
#
# Corresponds to the JSON property `iamOwned`
# @return [Boolean]
attr_accessor :iam_owned
alias_method :iam_owned?, :iam_owned
# If more than one rule is specified, the rules are applied in the following
# manner:
# - All matching LOG rules are always applied.
# - If any DENY/DENY_WITH_LOG rule matches, permission is denied.
# Logging will be applied if one or more matching rule requires logging.
# - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
# granted.
# Logging will be applied if one or more matching rule requires logging.
# - Otherwise, if no rule applies, permission is denied.
# Corresponds to the JSON property `rules`
# @return [Array<Google::Apis::DatafusionV1beta1::Rule>]
attr_accessor :rules
# Specifies the format of the policy.
# Valid values are 0, 1, and 3. Requests specifying an invalid value will be
# rejected.
# Operations affecting conditional bindings must specify version 3. This can
# be either setting a conditional policy, modifying a conditional binding,
# or removing a conditional binding from the stored conditional policy.
# Operations on non-conditional policies may specify any valid value or
# leave the field unset.
# If no etag is provided in the call to `setIamPolicy`, any version
# compliance checks on the incoming and/or stored policy is skipped.
# Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
# are rejected.
# Any operation that affects conditional role bindings must specify version
# `3`. This requirement applies to the following operations:
# * Getting a policy that includes a conditional role binding
# * Adding a conditional role binding to a policy
# * Changing a conditional role binding in a policy
# * Removing any role binding, with or without a condition, from a policy
# that includes conditions
# **Important:** If you use IAM Conditions, you must include the `etag` field
# whenever you call `setIamPolicy`. If you omit this field, then IAM allows
# you to overwrite a version `3` policy with a version `1` policy, and all of
# the conditions in the version `3` policy are lost.
# If a policy does not include any conditions, operations on that policy may
# specify any valid version or leave the field unset.
# Corresponds to the JSON property `version`
# @return [Fixnum]
attr_accessor :version
@ -1070,8 +842,6 @@ module Google
@audit_configs = args[:audit_configs] if args.key?(:audit_configs)
@bindings = args[:bindings] if args.key?(:bindings)
@etag = args[:etag] if args.key?(:etag)
@iam_owned = args[:iam_owned] if args.key?(:iam_owned)
@rules = args[:rules] if args.key?(:rules)
@version = args[:version] if args.key?(:version)
end
end
@ -1089,83 +859,22 @@ module Google
end
end
# A rule to be applied in a Policy.
class Rule
include Google::Apis::Core::Hashable
# Required
# Corresponds to the JSON property `action`
# @return [String]
attr_accessor :action
# Additional restrictions that must be met. All conditions must pass for the
# rule to match.
# Corresponds to the JSON property `conditions`
# @return [Array<Google::Apis::DatafusionV1beta1::Condition>]
attr_accessor :conditions
# Human-readable description of the rule.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# If one or more 'in' clauses are specified, the rule matches if
# the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
# Corresponds to the JSON property `in`
# @return [Array<String>]
attr_accessor :in
# The config returned to callers of tech.iam.IAM.CheckPolicy for any entries
# that match the LOG action.
# Corresponds to the JSON property `logConfig`
# @return [Array<Google::Apis::DatafusionV1beta1::LogConfig>]
attr_accessor :log_config
# If one or more 'not_in' clauses are specified, the rule matches
# if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
# The format for in and not_in entries can be found at in the Local IAM
# documentation (see go/local-iam#features).
# Corresponds to the JSON property `notIn`
# @return [Array<String>]
attr_accessor :not_in
# A permission is a string of form '<service>.<resource type>.<verb>'
# (e.g., 'storage.buckets.list'). A value of '*' matches all permissions,
# and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
# 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)
@action = args[:action] if args.key?(:action)
@conditions = args[:conditions] if args.key?(:conditions)
@description = args[:description] if args.key?(:description)
@in = args[:in] if args.key?(:in)
@log_config = args[:log_config] if args.key?(:log_config)
@not_in = args[:not_in] if args.key?(:not_in)
@permissions = args[:permissions] if args.key?(:permissions)
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.
# An Identity and Access Management (IAM) policy, which specifies access
# controls for Google Cloud resources.
# A `Policy` is a collection of `bindings`. A `binding` binds one or more
# `members` to a single `role`. Members can be user accounts, service accounts,
# Google groups, and domains (such as G Suite). A `role` is a named list of
# permissions (defined by IAM or configured by users). A `binding` can
# optionally specify a `condition`, which is a logic expression that further
# constrains the role binding based on attributes about the request and/or
# target resource.
# **JSON Example**
# permissions; each `role` can be an IAM predefined role or a user-created
# custom role.
# Optionally, a `binding` can specify a `condition`, which is a logical
# expression that allows access to a resource only if the expression evaluates
# to `true`. A condition can add constraints based on attributes of the
# request, the resource, or both.
# **JSON example:**
# `
# "bindings": [
# `
@ -1183,13 +892,15 @@ module Google
# "condition": `
# "title": "expirable access",
# "description": "Does not grant access after Sep 2020",
# "expression": "request.time <
# timestamp('2020-10-01T00:00:00.000Z')",
# "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')
# ",
# `
# `
# ]
# ],
# "etag": "BwWWja0YfJA=",
# "version": 3
# `
# **YAML Example**
# **YAML example:**
# bindings:
# - members:
# - user:mike@example.com
@ -1204,8 +915,10 @@ module Google
# title: expirable access
# description: Does not grant access after Sep 2020
# expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
# - etag: BwWWja0YfJA=
# - version: 3
# For a description of IAM and its features, see the
# [IAM developer's guide](https://cloud.google.com/iam/docs).
# [IAM documentation](https://cloud.google.com/iam/docs/).
# Corresponds to the JSON property `policy`
# @return [Google::Apis::DatafusionV1beta1::Policy]
attr_accessor :policy

View File

@ -34,12 +34,6 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class AuthorizationLoggingOptions
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Binding
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -52,36 +46,6 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class CloudAuditOptions
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Condition
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CounterOptions
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CustomField
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DataAccessOptions
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Empty
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -124,12 +88,6 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class LogConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class NetworkConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -160,12 +118,6 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class Rule
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SetIamPolicyRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -207,7 +159,6 @@ module Google
class Representation < Google::Apis::Core::JsonRepresentation
collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::DatafusionV1beta1::AuditLogConfig, decorator: Google::Apis::DatafusionV1beta1::AuditLogConfig::Representation
collection :exempted_members, as: 'exemptedMembers'
property :service, as: 'service'
end
end
@ -216,18 +167,10 @@ module Google
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :exempted_members, as: 'exemptedMembers'
property :ignore_child_exemptions, as: 'ignoreChildExemptions'
property :log_type, as: 'logType'
end
end
class AuthorizationLoggingOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :permission_type, as: 'permissionType'
end
end
class Binding
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -244,51 +187,6 @@ module Google
end
end
class CloudAuditOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :authorization_logging_options, as: 'authorizationLoggingOptions', class: Google::Apis::DatafusionV1beta1::AuthorizationLoggingOptions, decorator: Google::Apis::DatafusionV1beta1::AuthorizationLoggingOptions::Representation
property :log_name, as: 'logName'
end
end
class Condition
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :iam, as: 'iam'
property :op, as: 'op'
property :svc, as: 'svc'
property :sys, as: 'sys'
collection :values, as: 'values'
end
end
class CounterOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :custom_fields, as: 'customFields', class: Google::Apis::DatafusionV1beta1::CustomField, decorator: Google::Apis::DatafusionV1beta1::CustomField::Representation
property :field, as: 'field'
property :metric, as: 'metric'
end
end
class CustomField
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :name, as: 'name'
property :value, as: 'value'
end
end
class DataAccessOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :log_mode, as: 'logMode'
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -316,6 +214,7 @@ module Google
property :display_name, as: 'displayName'
property :enable_stackdriver_logging, as: 'enableStackdriverLogging'
property :enable_stackdriver_monitoring, as: 'enableStackdriverMonitoring'
property :gcs_bucket, as: 'gcsBucket'
hash :labels, as: 'labels'
property :name, as: 'name'
property :network_config, as: 'networkConfig', class: Google::Apis::DatafusionV1beta1::NetworkConfig, decorator: Google::Apis::DatafusionV1beta1::NetworkConfig::Representation
@ -372,18 +271,6 @@ module Google
end
end
class LogConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cloud_audit, as: 'cloudAudit', class: Google::Apis::DatafusionV1beta1::CloudAuditOptions, decorator: Google::Apis::DatafusionV1beta1::CloudAuditOptions::Representation
property :counter, as: 'counter', class: Google::Apis::DatafusionV1beta1::CounterOptions, decorator: Google::Apis::DatafusionV1beta1::CounterOptions::Representation
property :data_access, as: 'dataAccess', class: Google::Apis::DatafusionV1beta1::DataAccessOptions, decorator: Google::Apis::DatafusionV1beta1::DataAccessOptions::Representation
end
end
class NetworkConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -425,9 +312,6 @@ module Google
collection :bindings, as: 'bindings', class: Google::Apis::DatafusionV1beta1::Binding, decorator: Google::Apis::DatafusionV1beta1::Binding::Representation
property :etag, :base64 => true, as: 'etag'
property :iam_owned, as: 'iamOwned'
collection :rules, as: 'rules', class: Google::Apis::DatafusionV1beta1::Rule, decorator: Google::Apis::DatafusionV1beta1::Rule::Representation
property :version, as: 'version'
end
end
@ -438,21 +322,6 @@ module Google
end
end
class Rule
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :action, as: 'action'
collection :conditions, as: 'conditions', class: Google::Apis::DatafusionV1beta1::Condition, decorator: Google::Apis::DatafusionV1beta1::Condition::Representation
property :description, as: 'description'
collection :in, as: 'in'
collection :log_config, as: 'logConfig', class: Google::Apis::DatafusionV1beta1::LogConfig, decorator: Google::Apis::DatafusionV1beta1::LogConfig::Representation
collection :not_in, as: 'notIn'
collection :permissions, as: 'permissions'
end
end
class SetIamPolicyRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation

View File

@ -91,6 +91,9 @@ module Google
# The resource that owns the locations collection, if applicable.
# @param [String] filter
# The standard list filter.
# @param [Boolean] include_unrevealed_locations
# If true, the returned list will include locations which are not yet
# revealed.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
@ -112,12 +115,13 @@ module Google
# @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 list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
def list_project_locations(name, filter: nil, include_unrevealed_locations: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1beta1/{+name}/locations', options)
command.response_representation = Google::Apis::DatafusionV1beta1::ListLocationsResponse::Representation
command.response_class = Google::Apis::DatafusionV1beta1::ListLocationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['includeUnrevealedLocations'] = include_unrevealed_locations unless include_unrevealed_locations.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?

View File

@ -25,7 +25,7 @@ module Google
# @see https://cloud.google.com/service-consumer-management/docs/overview
module ServiceconsumermanagementV1
VERSION = 'V1'
REVISION = '20191230'
REVISION = '20200114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -1508,6 +1508,13 @@ module Google
# @return [Array<Google::Apis::ServiceconsumermanagementV1::HttpRule>]
attr_accessor :additional_bindings
# When this flag is set to true, HTTP requests will be allowed to invoke a
# half-duplex streaming method.
# Corresponds to the JSON property `allowHalfDuplex`
# @return [Boolean]
attr_accessor :allow_half_duplex
alias_method :allow_half_duplex?, :allow_half_duplex
# The name of the request field whose value is mapped to the HTTP request
# body, or `*` for mapping all request fields not captured by the path
# pattern to the HTTP body, or omitted for not having any HTTP request body.
@ -1570,6 +1577,7 @@ module Google
# Update properties of this object
def update!(**args)
@additional_bindings = args[:additional_bindings] if args.key?(:additional_bindings)
@allow_half_duplex = args[:allow_half_duplex] if args.key?(:allow_half_duplex)
@body = args[:body] if args.key?(:body)
@custom = args[:custom] if args.key?(:custom)
@delete = args[:delete] if args.key?(:delete)
@ -3263,6 +3271,48 @@ module Google
end
end
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
class ServiceIdentity
include Google::Apis::Core::Hashable
# Optional. A user-specified opaque description of the service account.
# Must be less than or equal to 256 UTF-8 bytes.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Optional. A user-specified name for the service account.
# Must be less than or equal to 100 UTF-8 bytes.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# A service account project that hosts the service accounts.
# An example name would be:
# `projects/123456789`
# Corresponds to the JSON property `serviceAccountParent`
# @return [String]
attr_accessor :service_account_parent
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@service_account_parent = args[:service_account_parent] if args.key?(:service_account_parent)
end
end
# `SourceContext` represents information about the source of a
# protobuf element, like the file in which it is defined.
class SourceContext
@ -3717,6 +3767,18 @@ module Google
# @return [Array<Google::Apis::ServiceconsumermanagementV1::UsageRule>]
attr_accessor :rules
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
# Corresponds to the JSON property `serviceIdentity`
# @return [Google::Apis::ServiceconsumermanagementV1::ServiceIdentity]
attr_accessor :service_identity
def initialize(**args)
update!(**args)
end
@ -3726,6 +3788,7 @@ module Google
@producer_notification_channel = args[:producer_notification_channel] if args.key?(:producer_notification_channel)
@requirements = args[:requirements] if args.key?(:requirements)
@rules = args[:rules] if args.key?(:rules)
@service_identity = args[:service_identity] if args.key?(:service_identity)
end
end

View File

@ -358,6 +358,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class ServiceIdentity
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SourceContext
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -840,6 +846,7 @@ module Google
class Representation < Google::Apis::Core::JsonRepresentation
collection :additional_bindings, as: 'additionalBindings', class: Google::Apis::ServiceconsumermanagementV1::HttpRule, decorator: Google::Apis::ServiceconsumermanagementV1::HttpRule::Representation
property :allow_half_duplex, as: 'allowHalfDuplex'
property :body, as: 'body'
property :custom, as: 'custom', class: Google::Apis::ServiceconsumermanagementV1::CustomHttpPattern, decorator: Google::Apis::ServiceconsumermanagementV1::CustomHttpPattern::Representation
@ -1148,6 +1155,15 @@ module Google
end
end
class ServiceIdentity
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :description, as: 'description'
property :display_name, as: 'displayName'
property :service_account_parent, as: 'serviceAccountParent'
end
end
class SourceContext
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -1270,6 +1286,8 @@ module Google
collection :requirements, as: 'requirements'
collection :rules, as: 'rules', class: Google::Apis::ServiceconsumermanagementV1::UsageRule, decorator: Google::Apis::ServiceconsumermanagementV1::UsageRule::Representation
property :service_identity, as: 'serviceIdentity', class: Google::Apis::ServiceconsumermanagementV1::ServiceIdentity, decorator: Google::Apis::ServiceconsumermanagementV1::ServiceIdentity::Representation
end
end

View File

@ -26,7 +26,7 @@ module Google
# @see https://cloud.google.com/service-infrastructure/docs/service-networking/getting-started
module ServicenetworkingV1
VERSION = 'V1'
REVISION = '20191230'
REVISION = '20200114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -1594,6 +1594,13 @@ module Google
# @return [Array<Google::Apis::ServicenetworkingV1::HttpRule>]
attr_accessor :additional_bindings
# When this flag is set to true, HTTP requests will be allowed to invoke a
# half-duplex streaming method.
# Corresponds to the JSON property `allowHalfDuplex`
# @return [Boolean]
attr_accessor :allow_half_duplex
alias_method :allow_half_duplex?, :allow_half_duplex
# The name of the request field whose value is mapped to the HTTP request
# body, or `*` for mapping all request fields not captured by the path
# pattern to the HTTP body, or omitted for not having any HTTP request body.
@ -1656,6 +1663,7 @@ module Google
# Update properties of this object
def update!(**args)
@additional_bindings = args[:additional_bindings] if args.key?(:additional_bindings)
@allow_half_duplex = args[:allow_half_duplex] if args.key?(:allow_half_duplex)
@body = args[:body] if args.key?(:body)
@custom = args[:custom] if args.key?(:custom)
@delete = args[:delete] if args.key?(:delete)
@ -3325,6 +3333,48 @@ module Google
end
end
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
class ServiceIdentity
include Google::Apis::Core::Hashable
# Optional. A user-specified opaque description of the service account.
# Must be less than or equal to 256 UTF-8 bytes.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Optional. A user-specified name for the service account.
# Must be less than or equal to 100 UTF-8 bytes.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# A service account project that hosts the service accounts.
# An example name would be:
# `projects/123456789`
# Corresponds to the JSON property `serviceAccountParent`
# @return [String]
attr_accessor :service_account_parent
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@service_account_parent = args[:service_account_parent] if args.key?(:service_account_parent)
end
end
# `SourceContext` represents information about the source of a
# protobuf element, like the file in which it is defined.
class SourceContext
@ -3636,6 +3686,18 @@ module Google
# @return [Array<Google::Apis::ServicenetworkingV1::UsageRule>]
attr_accessor :rules
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
# Corresponds to the JSON property `serviceIdentity`
# @return [Google::Apis::ServicenetworkingV1::ServiceIdentity]
attr_accessor :service_identity
def initialize(**args)
update!(**args)
end
@ -3645,6 +3707,7 @@ module Google
@producer_notification_channel = args[:producer_notification_channel] if args.key?(:producer_notification_channel)
@requirements = args[:requirements] if args.key?(:requirements)
@rules = args[:rules] if args.key?(:rules)
@service_identity = args[:service_identity] if args.key?(:service_identity)
end
end

View File

@ -352,6 +352,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class ServiceIdentity
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SourceContext
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -727,6 +733,7 @@ module Google
class Representation < Google::Apis::Core::JsonRepresentation
collection :additional_bindings, as: 'additionalBindings', class: Google::Apis::ServicenetworkingV1::HttpRule, decorator: Google::Apis::ServicenetworkingV1::HttpRule::Representation
property :allow_half_duplex, as: 'allowHalfDuplex'
property :body, as: 'body'
property :custom, as: 'custom', class: Google::Apis::ServicenetworkingV1::CustomHttpPattern, decorator: Google::Apis::ServicenetworkingV1::CustomHttpPattern::Representation
@ -1025,6 +1032,15 @@ module Google
end
end
class ServiceIdentity
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :description, as: 'description'
property :display_name, as: 'displayName'
property :service_account_parent, as: 'serviceAccountParent'
end
end
class SourceContext
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -1106,6 +1122,8 @@ module Google
collection :requirements, as: 'requirements'
collection :rules, as: 'rules', class: Google::Apis::ServicenetworkingV1::UsageRule, decorator: Google::Apis::ServicenetworkingV1::UsageRule::Representation
property :service_identity, as: 'serviceIdentity', class: Google::Apis::ServicenetworkingV1::ServiceIdentity, decorator: Google::Apis::ServicenetworkingV1::ServiceIdentity::Representation
end
end

View File

@ -26,7 +26,7 @@ module Google
# @see https://cloud.google.com/service-infrastructure/docs/service-networking/getting-started
module ServicenetworkingV1beta
VERSION = 'V1beta'
REVISION = '20191230'
REVISION = '20200114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -1493,6 +1493,13 @@ module Google
# @return [Array<Google::Apis::ServicenetworkingV1beta::HttpRule>]
attr_accessor :additional_bindings
# When this flag is set to true, HTTP requests will be allowed to invoke a
# half-duplex streaming method.
# Corresponds to the JSON property `allowHalfDuplex`
# @return [Boolean]
attr_accessor :allow_half_duplex
alias_method :allow_half_duplex?, :allow_half_duplex
# The name of the request field whose value is mapped to the HTTP request
# body, or `*` for mapping all request fields not captured by the path
# pattern to the HTTP body, or omitted for not having any HTTP request body.
@ -1555,6 +1562,7 @@ module Google
# Update properties of this object
def update!(**args)
@additional_bindings = args[:additional_bindings] if args.key?(:additional_bindings)
@allow_half_duplex = args[:allow_half_duplex] if args.key?(:allow_half_duplex)
@body = args[:body] if args.key?(:body)
@custom = args[:custom] if args.key?(:custom)
@delete = args[:delete] if args.key?(:delete)
@ -3178,6 +3186,48 @@ module Google
end
end
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
class ServiceIdentity
include Google::Apis::Core::Hashable
# Optional. A user-specified opaque description of the service account.
# Must be less than or equal to 256 UTF-8 bytes.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Optional. A user-specified name for the service account.
# Must be less than or equal to 100 UTF-8 bytes.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# A service account project that hosts the service accounts.
# An example name would be:
# `projects/123456789`
# Corresponds to the JSON property `serviceAccountParent`
# @return [String]
attr_accessor :service_account_parent
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@service_account_parent = args[:service_account_parent] if args.key?(:service_account_parent)
end
end
# `SourceContext` represents information about the source of a
# protobuf element, like the file in which it is defined.
class SourceContext
@ -3489,6 +3539,18 @@ module Google
# @return [Array<Google::Apis::ServicenetworkingV1beta::UsageRule>]
attr_accessor :rules
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
# Corresponds to the JSON property `serviceIdentity`
# @return [Google::Apis::ServicenetworkingV1beta::ServiceIdentity]
attr_accessor :service_identity
def initialize(**args)
update!(**args)
end
@ -3498,6 +3560,7 @@ module Google
@producer_notification_channel = args[:producer_notification_channel] if args.key?(:producer_notification_channel)
@requirements = args[:requirements] if args.key?(:requirements)
@rules = args[:rules] if args.key?(:rules)
@service_identity = args[:service_identity] if args.key?(:service_identity)
end
end

View File

@ -310,6 +310,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class ServiceIdentity
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SourceContext
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -640,6 +646,7 @@ module Google
class Representation < Google::Apis::Core::JsonRepresentation
collection :additional_bindings, as: 'additionalBindings', class: Google::Apis::ServicenetworkingV1beta::HttpRule, decorator: Google::Apis::ServicenetworkingV1beta::HttpRule::Representation
property :allow_half_duplex, as: 'allowHalfDuplex'
property :body, as: 'body'
property :custom, as: 'custom', class: Google::Apis::ServicenetworkingV1beta::CustomHttpPattern, decorator: Google::Apis::ServicenetworkingV1beta::CustomHttpPattern::Representation
@ -922,6 +929,15 @@ module Google
end
end
class ServiceIdentity
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :description, as: 'description'
property :display_name, as: 'displayName'
property :service_account_parent, as: 'serviceAccountParent'
end
end
class SourceContext
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -1003,6 +1019,8 @@ module Google
collection :requirements, as: 'requirements'
collection :rules, as: 'rules', class: Google::Apis::ServicenetworkingV1beta::UsageRule, decorator: Google::Apis::ServicenetworkingV1beta::UsageRule::Representation
property :service_identity, as: 'serviceIdentity', class: Google::Apis::ServicenetworkingV1beta::ServiceIdentity, decorator: Google::Apis::ServicenetworkingV1beta::ServiceIdentity::Representation
end
end

View File

@ -27,7 +27,7 @@ module Google
# @see https://cloud.google.com/service-usage/
module ServiceusageV1
VERSION = 'V1'
REVISION = '20191230'
REVISION = '20200114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -1750,6 +1750,48 @@ module Google
end
end
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
class GoogleApiServiceIdentity
include Google::Apis::Core::Hashable
# Optional. A user-specified opaque description of the service account.
# Must be less than or equal to 256 UTF-8 bytes.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Optional. A user-specified name for the service account.
# Must be less than or equal to 100 UTF-8 bytes.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# A service account project that hosts the service accounts.
# An example name would be:
# `projects/123456789`
# Corresponds to the JSON property `serviceAccountParent`
# @return [String]
attr_accessor :service_account_parent
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@service_account_parent = args[:service_account_parent] if args.key?(:service_account_parent)
end
end
# The operation metadata returned for the batchend services operation.
class GoogleApiServiceusageV1OperationMetadata
include Google::Apis::Core::Hashable
@ -2296,6 +2338,13 @@ module Google
# @return [Array<Google::Apis::ServiceusageV1::HttpRule>]
attr_accessor :additional_bindings
# When this flag is set to true, HTTP requests will be allowed to invoke a
# half-duplex streaming method.
# Corresponds to the JSON property `allowHalfDuplex`
# @return [Boolean]
attr_accessor :allow_half_duplex
alias_method :allow_half_duplex?, :allow_half_duplex
# The name of the request field whose value is mapped to the HTTP request
# body, or `*` for mapping all request fields not captured by the path
# pattern to the HTTP body, or omitted for not having any HTTP request body.
@ -2358,6 +2407,7 @@ module Google
# Update properties of this object
def update!(**args)
@additional_bindings = args[:additional_bindings] if args.key?(:additional_bindings)
@allow_half_duplex = args[:allow_half_duplex] if args.key?(:allow_half_duplex)
@body = args[:body] if args.key?(:body)
@custom = args[:custom] if args.key?(:custom)
@delete = args[:delete] if args.key?(:delete)
@ -3878,6 +3928,18 @@ module Google
# @return [Array<Google::Apis::ServiceusageV1::UsageRule>]
attr_accessor :rules
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
# Corresponds to the JSON property `serviceIdentity`
# @return [Google::Apis::ServiceusageV1::GoogleApiServiceIdentity]
attr_accessor :service_identity
def initialize(**args)
update!(**args)
end
@ -3887,6 +3949,7 @@ module Google
@producer_notification_channel = args[:producer_notification_channel] if args.key?(:producer_notification_channel)
@requirements = args[:requirements] if args.key?(:requirements)
@rules = args[:rules] if args.key?(:rules)
@service_identity = args[:service_identity] if args.key?(:service_identity)
end
end

View File

@ -226,6 +226,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class GoogleApiServiceIdentity
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleApiServiceusageV1OperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -828,6 +834,15 @@ module Google
end
end
class GoogleApiServiceIdentity
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :description, as: 'description'
property :display_name, as: 'displayName'
property :service_account_parent, as: 'serviceAccountParent'
end
end
class GoogleApiServiceusageV1OperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -897,6 +912,7 @@ module Google
class Representation < Google::Apis::Core::JsonRepresentation
collection :additional_bindings, as: 'additionalBindings', class: Google::Apis::ServiceusageV1::HttpRule, decorator: Google::Apis::ServiceusageV1::HttpRule::Representation
property :allow_half_duplex, as: 'allowHalfDuplex'
property :body, as: 'body'
property :custom, as: 'custom', class: Google::Apis::ServiceusageV1::CustomHttpPattern, decorator: Google::Apis::ServiceusageV1::CustomHttpPattern::Representation
@ -1213,6 +1229,8 @@ module Google
collection :requirements, as: 'requirements'
collection :rules, as: 'rules', class: Google::Apis::ServiceusageV1::UsageRule, decorator: Google::Apis::ServiceusageV1::UsageRule::Representation
property :service_identity, as: 'serviceIdentity', class: Google::Apis::ServiceusageV1::GoogleApiServiceIdentity, decorator: Google::Apis::ServiceusageV1::GoogleApiServiceIdentity::Representation
end
end

View File

@ -27,7 +27,7 @@ module Google
# @see https://cloud.google.com/service-usage/
module ServiceusageV1beta1
VERSION = 'V1beta1'
REVISION = '20191230'
REVISION = '20200114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'

View File

@ -1728,6 +1728,48 @@ module Google
end
end
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
class GoogleApiServiceIdentity
include Google::Apis::Core::Hashable
# Optional. A user-specified opaque description of the service account.
# Must be less than or equal to 256 UTF-8 bytes.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Optional. A user-specified name for the service account.
# Must be less than or equal to 100 UTF-8 bytes.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# A service account project that hosts the service accounts.
# An example name would be:
# `projects/123456789`
# Corresponds to the JSON property `serviceAccountParent`
# @return [String]
attr_accessor :service_account_parent
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@display_name = args[:display_name] if args.key?(:display_name)
@service_account_parent = args[:service_account_parent] if args.key?(:service_account_parent)
end
end
# The operation metadata returned for the batchend services operation.
class GoogleApiServiceusageV1OperationMetadata
include Google::Apis::Core::Hashable
@ -2274,6 +2316,13 @@ module Google
# @return [Array<Google::Apis::ServiceusageV1beta1::HttpRule>]
attr_accessor :additional_bindings
# When this flag is set to true, HTTP requests will be allowed to invoke a
# half-duplex streaming method.
# Corresponds to the JSON property `allowHalfDuplex`
# @return [Boolean]
attr_accessor :allow_half_duplex
alias_method :allow_half_duplex?, :allow_half_duplex
# The name of the request field whose value is mapped to the HTTP request
# body, or `*` for mapping all request fields not captured by the path
# pattern to the HTTP body, or omitted for not having any HTTP request body.
@ -2336,6 +2385,7 @@ module Google
# Update properties of this object
def update!(**args)
@additional_bindings = args[:additional_bindings] if args.key?(:additional_bindings)
@allow_half_duplex = args[:allow_half_duplex] if args.key?(:allow_half_duplex)
@body = args[:body] if args.key?(:body)
@custom = args[:custom] if args.key?(:custom)
@delete = args[:delete] if args.key?(:delete)
@ -4061,6 +4111,18 @@ module Google
# @return [Array<Google::Apis::ServiceusageV1beta1::UsageRule>]
attr_accessor :rules
# The per-product per-project service identity for a service.
# Use this field to configure per-product per-project service identity.
# Example of a service identity configuration.
# usage:
# service_identity:
# - service_account_parent: "projects/123456789"
# display_name: "Cloud XXX Service Agent"
# description: "Used as the identity of Cloud XXX to access resources"
# Corresponds to the JSON property `serviceIdentity`
# @return [Google::Apis::ServiceusageV1beta1::GoogleApiServiceIdentity]
attr_accessor :service_identity
def initialize(**args)
update!(**args)
end
@ -4070,6 +4132,7 @@ module Google
@producer_notification_channel = args[:producer_notification_channel] if args.key?(:producer_notification_channel)
@requirements = args[:requirements] if args.key?(:requirements)
@rules = args[:rules] if args.key?(:rules)
@service_identity = args[:service_identity] if args.key?(:service_identity)
end
end

View File

@ -220,6 +220,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class GoogleApiServiceIdentity
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GoogleApiServiceusageV1OperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
@ -827,6 +833,15 @@ module Google
end
end
class GoogleApiServiceIdentity
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :description, as: 'description'
property :display_name, as: 'displayName'
property :service_account_parent, as: 'serviceAccountParent'
end
end
class GoogleApiServiceusageV1OperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@ -896,6 +911,7 @@ module Google
class Representation < Google::Apis::Core::JsonRepresentation
collection :additional_bindings, as: 'additionalBindings', class: Google::Apis::ServiceusageV1beta1::HttpRule, decorator: Google::Apis::ServiceusageV1beta1::HttpRule::Representation
property :allow_half_duplex, as: 'allowHalfDuplex'
property :body, as: 'body'
property :custom, as: 'custom', class: Google::Apis::ServiceusageV1beta1::CustomHttpPattern, decorator: Google::Apis::ServiceusageV1beta1::CustomHttpPattern::Representation
@ -1243,6 +1259,8 @@ module Google
collection :requirements, as: 'requirements'
collection :rules, as: 'rules', class: Google::Apis::ServiceusageV1beta1::UsageRule, decorator: Google::Apis::ServiceusageV1beta1::UsageRule::Representation
property :service_identity, as: 'serviceIdentity', class: Google::Apis::ServiceusageV1beta1::GoogleApiServiceIdentity, decorator: Google::Apis::ServiceusageV1beta1::GoogleApiServiceIdentity::Representation
end
end

View File

@ -0,0 +1,37 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'google/apis/translate_v3/service.rb'
require 'google/apis/translate_v3/classes.rb'
require 'google/apis/translate_v3/representations.rb'
module Google
module Apis
# Cloud Translation API
#
# Integrates text translation into your website or application.
#
# @see https://cloud.google.com/translate/docs/quickstarts
module TranslateV3
VERSION = 'V3'
REVISION = '20200110'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
# Translate text from one language to another using Google Translate
AUTH_CLOUD_TRANSLATION = 'https://www.googleapis.com/auth/cloud-translation'
end
end
end

View File

@ -0,0 +1,940 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module TranslateV3
# The batch translation request.
class BatchTranslateTextRequest
include Google::Apis::Core::Hashable
# Optional. Glossaries to be applied for translation.
# It's keyed by target language code.
# Corresponds to the JSON property `glossaries`
# @return [Hash<String,Google::Apis::TranslateV3::TranslateTextGlossaryConfig>]
attr_accessor :glossaries
# Required. Input configurations.
# The total number of files matched should be <= 1000.
# The total content size should be <= 100M Unicode codepoints.
# The files must use UTF-8 encoding.
# Corresponds to the JSON property `inputConfigs`
# @return [Array<Google::Apis::TranslateV3::InputConfig>]
attr_accessor :input_configs
# Optional. The labels with user-defined metadata for the request.
# Label keys and values can be no longer than 63 characters
# (Unicode codepoints), can only contain lowercase letters, numeric
# characters, underscores and dashes. International characters are allowed.
# Label values are optional. Label keys must start with a letter.
# See https://cloud.google.com/translate/docs/advanced/labels for more
# information.
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
# Optional. The models to use for translation. Map's key is target language
# code. Map's value is model name. Value can be a built-in general model,
# or an AutoML Translation model.
# The value format depends on model type:
# - AutoML Translation models:
# `projects/`project-number-or-id`/locations/`location-id`/models/`model-id``
# - General (built-in) models:
# `projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
# `projects/`project-number-or-id`/locations/`location-id`/models/general/base`
# If the map is empty or a specific model is
# not requested for a language pair, then default google model (nmt) is used.
# Corresponds to the JSON property `models`
# @return [Hash<String,String>]
attr_accessor :models
# Output configuration for BatchTranslateText request.
# Corresponds to the JSON property `outputConfig`
# @return [Google::Apis::TranslateV3::OutputConfig]
attr_accessor :output_config
# Required. Source language code.
# Corresponds to the JSON property `sourceLanguageCode`
# @return [String]
attr_accessor :source_language_code
# Required. Specify up to 10 language codes here.
# Corresponds to the JSON property `targetLanguageCodes`
# @return [Array<String>]
attr_accessor :target_language_codes
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@glossaries = args[:glossaries] if args.key?(:glossaries)
@input_configs = args[:input_configs] if args.key?(:input_configs)
@labels = args[:labels] if args.key?(:labels)
@models = args[:models] if args.key?(:models)
@output_config = args[:output_config] if args.key?(:output_config)
@source_language_code = args[:source_language_code] if args.key?(:source_language_code)
@target_language_codes = args[:target_language_codes] if args.key?(:target_language_codes)
end
end
# The request message for Operations.CancelOperation.
class CancelOperationRequest
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# The request message for language detection.
class DetectLanguageRequest
include Google::Apis::Core::Hashable
# The content of the input stored as a string.
# Corresponds to the JSON property `content`
# @return [String]
attr_accessor :content
# Optional. The labels with user-defined metadata for the request.
# Label keys and values can be no longer than 63 characters
# (Unicode codepoints), can only contain lowercase letters, numeric
# characters, underscores and dashes. International characters are allowed.
# Label values are optional. Label keys must start with a letter.
# See https://cloud.google.com/translate/docs/advanced/labels for more
# information.
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
# Optional. The format of the source text, for example, "text/html",
# "text/plain". If left blank, the MIME type defaults to "text/html".
# Corresponds to the JSON property `mimeType`
# @return [String]
attr_accessor :mime_type
# Optional. The language detection model to be used.
# Format:
# `projects/`project-number-or-id`/locations/`location-id`/models/language-
# detection/`model-id``
# Only one language detection model is currently supported:
# `projects/`project-number-or-id`/locations/`location-id`/models/language-
# detection/default`.
# If not specified, the default model is used.
# Corresponds to the JSON property `model`
# @return [String]
attr_accessor :model
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@content = args[:content] if args.key?(:content)
@labels = args[:labels] if args.key?(:labels)
@mime_type = args[:mime_type] if args.key?(:mime_type)
@model = args[:model] if args.key?(:model)
end
end
# The response message for language detection.
class DetectLanguageResponse
include Google::Apis::Core::Hashable
# A list of detected languages sorted by detection confidence in descending
# order. The most probable language first.
# Corresponds to the JSON property `languages`
# @return [Array<Google::Apis::TranslateV3::DetectedLanguage>]
attr_accessor :languages
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@languages = args[:languages] if args.key?(:languages)
end
end
# The response message for language detection.
class DetectedLanguage
include Google::Apis::Core::Hashable
# The confidence of the detection result for this language.
# Corresponds to the JSON property `confidence`
# @return [Float]
attr_accessor :confidence
# The BCP-47 language code of source content in the request, detected
# automatically.
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@confidence = args[:confidence] if args.key?(:confidence)
@language_code = args[:language_code] if args.key?(:language_code)
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:
# service Foo `
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
# `
# The JSON representation for `Empty` is empty JSON object ````.
class Empty
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# The Google Cloud Storage location for the output content.
class GcsDestination
include Google::Apis::Core::Hashable
# Required. There must be no files under 'output_uri_prefix'.
# 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an
# INVALID_ARGUMENT (400) error is returned.
# Corresponds to the JSON property `outputUriPrefix`
# @return [String]
attr_accessor :output_uri_prefix
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@output_uri_prefix = args[:output_uri_prefix] if args.key?(:output_uri_prefix)
end
end
# The Google Cloud Storage location for the input content.
class GcsSource
include Google::Apis::Core::Hashable
# Required. Source data URI. For example, `gs://my_bucket/my_object`.
# Corresponds to the JSON property `inputUri`
# @return [String]
attr_accessor :input_uri
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@input_uri = args[:input_uri] if args.key?(:input_uri)
end
end
# Represents a glossary built from user provided data.
class Glossary
include Google::Apis::Core::Hashable
# Output only. When the glossary creation was finished.
# Corresponds to the JSON property `endTime`
# @return [String]
attr_accessor :end_time
# Output only. The number of entries defined in the glossary.
# Corresponds to the JSON property `entryCount`
# @return [Fixnum]
attr_accessor :entry_count
# Input configuration for glossaries.
# Corresponds to the JSON property `inputConfig`
# @return [Google::Apis::TranslateV3::GlossaryInputConfig]
attr_accessor :input_config
# Used with equivalent term set glossaries.
# Corresponds to the JSON property `languageCodesSet`
# @return [Google::Apis::TranslateV3::LanguageCodesSet]
attr_accessor :language_codes_set
# Used with unidirectional glossaries.
# Corresponds to the JSON property `languagePair`
# @return [Google::Apis::TranslateV3::LanguageCodePair]
attr_accessor :language_pair
# Required. The resource name of the glossary. Glossary names have the form
# `projects/`project-number-or-id`/locations/`location-id`/glossaries/`glossary-
# id``.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Output only. When CreateGlossary was called.
# Corresponds to the JSON property `submitTime`
# @return [String]
attr_accessor :submit_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@end_time = args[:end_time] if args.key?(:end_time)
@entry_count = args[:entry_count] if args.key?(:entry_count)
@input_config = args[:input_config] if args.key?(:input_config)
@language_codes_set = args[:language_codes_set] if args.key?(:language_codes_set)
@language_pair = args[:language_pair] if args.key?(:language_pair)
@name = args[:name] if args.key?(:name)
@submit_time = args[:submit_time] if args.key?(:submit_time)
end
end
# Input configuration for glossaries.
class GlossaryInputConfig
include Google::Apis::Core::Hashable
# The Google Cloud Storage location for the input content.
# Corresponds to the JSON property `gcsSource`
# @return [Google::Apis::TranslateV3::GcsSource]
attr_accessor :gcs_source
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
end
end
# Input configuration for BatchTranslateText request.
class InputConfig
include Google::Apis::Core::Hashable
# The Google Cloud Storage location for the input content.
# Corresponds to the JSON property `gcsSource`
# @return [Google::Apis::TranslateV3::GcsSource]
attr_accessor :gcs_source
# Optional. Can be "text/plain" or "text/html".
# For `.tsv`, "text/html" is used if mime_type is missing.
# For `.html`, this field must be "text/html" or empty.
# For `.txt`, this field must be "text/plain" or empty.
# Corresponds to the JSON property `mimeType`
# @return [String]
attr_accessor :mime_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
@mime_type = args[:mime_type] if args.key?(:mime_type)
end
end
# Used with unidirectional glossaries.
class LanguageCodePair
include Google::Apis::Core::Hashable
# Required. The BCP-47 language code of the input text, for example,
# "en-US". Expected to be an exact match for GlossaryTerm.language_code.
# Corresponds to the JSON property `sourceLanguageCode`
# @return [String]
attr_accessor :source_language_code
# Required. The BCP-47 language code for translation output, for example,
# "zh-CN". Expected to be an exact match for GlossaryTerm.language_code.
# Corresponds to the JSON property `targetLanguageCode`
# @return [String]
attr_accessor :target_language_code
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@source_language_code = args[:source_language_code] if args.key?(:source_language_code)
@target_language_code = args[:target_language_code] if args.key?(:target_language_code)
end
end
# Used with equivalent term set glossaries.
class LanguageCodesSet
include Google::Apis::Core::Hashable
# The BCP-47 language code(s) for terms defined in the glossary.
# All entries are unique. The list contains at least two entries.
# Expected to be an exact match for GlossaryTerm.language_code.
# Corresponds to the JSON property `languageCodes`
# @return [Array<String>]
attr_accessor :language_codes
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@language_codes = args[:language_codes] if args.key?(:language_codes)
end
end
# Response message for ListGlossaries.
class ListGlossariesResponse
include Google::Apis::Core::Hashable
# The list of glossaries for a project.
# Corresponds to the JSON property `glossaries`
# @return [Array<Google::Apis::TranslateV3::Glossary>]
attr_accessor :glossaries
# A token to retrieve a page of results. Pass this value in the
# [ListGlossariesRequest.page_token] field in the subsequent call to
# `ListGlossaries` method to retrieve the next page of results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@glossaries = args[:glossaries] if args.key?(:glossaries)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# The response message for Locations.ListLocations.
class ListLocationsResponse
include Google::Apis::Core::Hashable
# A list of locations that matches the specified filter in the request.
# Corresponds to the JSON property `locations`
# @return [Array<Google::Apis::TranslateV3::Location>]
attr_accessor :locations
# The standard List next-page token.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@locations = args[:locations] if args.key?(:locations)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# The response message for Operations.ListOperations.
class ListOperationsResponse
include Google::Apis::Core::Hashable
# The standard List next-page token.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# A list of operations that matches the specified filter in the request.
# Corresponds to the JSON property `operations`
# @return [Array<Google::Apis::TranslateV3::Operation>]
attr_accessor :operations
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@operations = args[:operations] if args.key?(:operations)
end
end
# A resource that represents Google Cloud Platform location.
class Location
include Google::Apis::Core::Hashable
# The friendly name for this location, typically a nearby city name.
# For example, "Tokyo".
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Cross-service attributes for the location. For example
# `"cloud.googleapis.com/region": "us-east1"`
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
# The canonical id for this location. For example: `"us-east1"`.
# Corresponds to the JSON property `locationId`
# @return [String]
attr_accessor :location_id
# Service-specific metadata. For example the available capacity at the given
# location.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# Resource name for the location, which may vary between implementations.
# For example: `"projects/example-project/locations/us-east1"`
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@labels = args[:labels] if args.key?(:labels)
@location_id = args[:location_id] if args.key?(:location_id)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
end
end
# This resource represents a long-running operation that is the result of a
# network API call.
class Operation
include Google::Apis::Core::Hashable
# If the value is `false`, it means the operation is still in progress.
# If `true`, the operation is completed, and either `error` or `response` is
# available.
# Corresponds to the JSON property `done`
# @return [Boolean]
attr_accessor :done
alias_method :done?, :done
# The `Status` type defines a logical error model that is suitable for
# different programming environments, including REST APIs and RPC APIs. It is
# used by [gRPC](https://github.com/grpc). Each `Status` message contains
# three pieces of data: error code, error message, and error details.
# You can find out more about this error model and how to work with it in the
# [API Design Guide](https://cloud.google.com/apis/design/errors).
# Corresponds to the JSON property `error`
# @return [Google::Apis::TranslateV3::Status]
attr_accessor :error
# Service-specific metadata associated with the operation. It typically
# contains progress information and common metadata such as create time.
# Some services might not provide such metadata. Any method that returns a
# long-running operation should document the metadata type, if any.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# The server-assigned name, which is only unique within the same service that
# originally returns it. If you use the default HTTP mapping, the
# `name` should be a resource name ending with `operations/`unique_id``.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The normal response of the operation in case of success. If the original
# method returns no data on success, such as `Delete`, the response is
# `google.protobuf.Empty`. If the original method is standard
# `Get`/`Create`/`Update`, the response should be the resource. For other
# methods, the response should have the type `XxxResponse`, where `Xxx`
# is the original method name. For example, if the original method name
# is `TakeSnapshot()`, the inferred response type is
# `TakeSnapshotResponse`.
# Corresponds to the JSON property `response`
# @return [Hash<String,Object>]
attr_accessor :response
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@done = args[:done] if args.key?(:done)
@error = args[:error] if args.key?(:error)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
@response = args[:response] if args.key?(:response)
end
end
# Output configuration for BatchTranslateText request.
class OutputConfig
include Google::Apis::Core::Hashable
# The Google Cloud Storage location for the output content.
# Corresponds to the JSON property `gcsDestination`
# @return [Google::Apis::TranslateV3::GcsDestination]
attr_accessor :gcs_destination
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)
end
end
# The `Status` type defines a logical error model that is suitable for
# different programming environments, including REST APIs and RPC APIs. It is
# used by [gRPC](https://github.com/grpc). Each `Status` message contains
# three pieces of data: error code, error message, and error details.
# You can find out more about this error model and how to work with it in the
# [API Design Guide](https://cloud.google.com/apis/design/errors).
class Status
include Google::Apis::Core::Hashable
# The status code, which should be an enum value of google.rpc.Code.
# Corresponds to the JSON property `code`
# @return [Fixnum]
attr_accessor :code
# A list of messages that carry the error details. There is a common set of
# message types for APIs to use.
# Corresponds to the JSON property `details`
# @return [Array<Hash<String,Object>>]
attr_accessor :details
# A developer-facing error message, which should be in English. Any
# user-facing error message should be localized and sent in the
# google.rpc.Status.details field, or localized by the client.
# Corresponds to the JSON property `message`
# @return [String]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
@details = args[:details] if args.key?(:details)
@message = args[:message] if args.key?(:message)
end
end
# A single supported language response corresponds to information related
# to one supported language.
class SupportedLanguage
include Google::Apis::Core::Hashable
# Human readable name of the language localized in the display language
# specified in the request.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Supported language code, generally consisting of its ISO 639-1
# identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes
# including language and region identifiers are returned (for example,
# 'zh-TW' and 'zh-CN')
# Corresponds to the JSON property `languageCode`
# @return [String]
attr_accessor :language_code
# Can be used as source language.
# Corresponds to the JSON property `supportSource`
# @return [Boolean]
attr_accessor :support_source
alias_method :support_source?, :support_source
# Can be used as target language.
# Corresponds to the JSON property `supportTarget`
# @return [Boolean]
attr_accessor :support_target
alias_method :support_target?, :support_target
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@display_name = args[:display_name] if args.key?(:display_name)
@language_code = args[:language_code] if args.key?(:language_code)
@support_source = args[:support_source] if args.key?(:support_source)
@support_target = args[:support_target] if args.key?(:support_target)
end
end
# The response message for discovering supported languages.
class SupportedLanguages
include Google::Apis::Core::Hashable
# A list of supported language responses. This list contains an entry
# for each language the Translation API supports.
# Corresponds to the JSON property `languages`
# @return [Array<Google::Apis::TranslateV3::SupportedLanguage>]
attr_accessor :languages
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@languages = args[:languages] if args.key?(:languages)
end
end
# Configures which glossary should be used for a specific target language,
# and defines options for applying that glossary.
class TranslateTextGlossaryConfig
include Google::Apis::Core::Hashable
# Required. Specifies the glossary used for this translation. Use
# this format: projects/*/locations/*/glossaries/*
# Corresponds to the JSON property `glossary`
# @return [String]
attr_accessor :glossary
# Optional. Indicates match is case-insensitive.
# Default value is false if missing.
# Corresponds to the JSON property `ignoreCase`
# @return [Boolean]
attr_accessor :ignore_case
alias_method :ignore_case?, :ignore_case
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@glossary = args[:glossary] if args.key?(:glossary)
@ignore_case = args[:ignore_case] if args.key?(:ignore_case)
end
end
# The request message for synchronous translation.
class TranslateTextRequest
include Google::Apis::Core::Hashable
# Required. The content of the input in string format.
# We recommend the total content be less than 30k codepoints.
# Use BatchTranslateText for larger text.
# Corresponds to the JSON property `contents`
# @return [Array<String>]
attr_accessor :contents
# Configures which glossary should be used for a specific target language,
# and defines options for applying that glossary.
# Corresponds to the JSON property `glossaryConfig`
# @return [Google::Apis::TranslateV3::TranslateTextGlossaryConfig]
attr_accessor :glossary_config
# Optional. The labels with user-defined metadata for the request.
# Label keys and values can be no longer than 63 characters
# (Unicode codepoints), can only contain lowercase letters, numeric
# characters, underscores and dashes. International characters are allowed.
# Label values are optional. Label keys must start with a letter.
# See https://cloud.google.com/translate/docs/advanced/labels for more
# information.
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
# Optional. The format of the source text, for example, "text/html",
# "text/plain". If left blank, the MIME type defaults to "text/html".
# Corresponds to the JSON property `mimeType`
# @return [String]
attr_accessor :mime_type
# Optional. The `model` type requested for this translation.
# The format depends on model type:
# - AutoML Translation models:
# `projects/`project-number-or-id`/locations/`location-id`/models/`model-id``
# - General (built-in) models:
# `projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
# `projects/`project-number-or-id`/locations/`location-id`/models/general/base`
# For global (non-regionalized) requests, use `location-id` `global`.
# For example,
# `projects/`project-number-or-id`/locations/global/models/general/nmt`.
# If missing, the system decides which google base model to use.
# Corresponds to the JSON property `model`
# @return [String]
attr_accessor :model
# Optional. The BCP-47 language code of the input text if
# known, for example, "en-US" or "sr-Latn". Supported language codes are
# listed in Language Support. If the source language isn't specified, the API
# attempts to identify the source language automatically and returns the
# source language within the response.
# Corresponds to the JSON property `sourceLanguageCode`
# @return [String]
attr_accessor :source_language_code
# Required. The BCP-47 language code to use for translation of the input
# text, set to one of the language codes listed in Language Support.
# Corresponds to the JSON property `targetLanguageCode`
# @return [String]
attr_accessor :target_language_code
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@contents = args[:contents] if args.key?(:contents)
@glossary_config = args[:glossary_config] if args.key?(:glossary_config)
@labels = args[:labels] if args.key?(:labels)
@mime_type = args[:mime_type] if args.key?(:mime_type)
@model = args[:model] if args.key?(:model)
@source_language_code = args[:source_language_code] if args.key?(:source_language_code)
@target_language_code = args[:target_language_code] if args.key?(:target_language_code)
end
end
#
class TranslateTextResponse
include Google::Apis::Core::Hashable
# Text translation responses if a glossary is provided in the request.
# This can be the same as
# `translations` if no terms apply.
# This field has the same length as
# `contents`.
# Corresponds to the JSON property `glossaryTranslations`
# @return [Array<Google::Apis::TranslateV3::Translation>]
attr_accessor :glossary_translations
# Text translation responses with no glossary applied.
# This field has the same length as
# `contents`.
# Corresponds to the JSON property `translations`
# @return [Array<Google::Apis::TranslateV3::Translation>]
attr_accessor :translations
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@glossary_translations = args[:glossary_translations] if args.key?(:glossary_translations)
@translations = args[:translations] if args.key?(:translations)
end
end
# A single translation response.
class Translation
include Google::Apis::Core::Hashable
# The BCP-47 language code of source text in the initial request, detected
# automatically, if no source language was passed within the initial
# request. If the source language was passed, auto-detection of the language
# does not occur and this field is empty.
# Corresponds to the JSON property `detectedLanguageCode`
# @return [String]
attr_accessor :detected_language_code
# Configures which glossary should be used for a specific target language,
# and defines options for applying that glossary.
# Corresponds to the JSON property `glossaryConfig`
# @return [Google::Apis::TranslateV3::TranslateTextGlossaryConfig]
attr_accessor :glossary_config
# Only present when `model` is present in the request.
# `model` here is normalized to have project number.
# For example:
# If the `model` requested in TranslationTextRequest is
# `projects/`project-id`/locations/`location-id`/models/general/nmt` then
# `model` here would be normalized to
# `projects/`project-number`/locations/`location-id`/models/general/nmt`.
# Corresponds to the JSON property `model`
# @return [String]
attr_accessor :model
# Text translated into the target language.
# Corresponds to the JSON property `translatedText`
# @return [String]
attr_accessor :translated_text
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@detected_language_code = args[:detected_language_code] if args.key?(:detected_language_code)
@glossary_config = args[:glossary_config] if args.key?(:glossary_config)
@model = args[:model] if args.key?(:model)
@translated_text = args[:translated_text] if args.key?(:translated_text)
end
end
# The request message for Operations.WaitOperation.
class WaitOperationRequest
include Google::Apis::Core::Hashable
# The maximum duration to wait before timing out. If left blank, the wait
# will be at most the time permitted by the underlying HTTP/RPC protocol.
# If RPC context deadline is also specified, the shorter one will be used.
# Corresponds to the JSON property `timeout`
# @return [String]
attr_accessor :timeout
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@timeout = args[:timeout] if args.key?(:timeout)
end
end
end
end
end

View File

@ -0,0 +1,439 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module TranslateV3
class BatchTranslateTextRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class CancelOperationRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DetectLanguageRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DetectLanguageResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class DetectedLanguage
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 GcsDestination
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GcsSource
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Glossary
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class GlossaryInputConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class InputConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class LanguageCodePair
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class LanguageCodesSet
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListGlossariesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListLocationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListOperationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Location
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Operation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class OutputConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Status
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SupportedLanguage
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class SupportedLanguages
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TranslateTextGlossaryConfig
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TranslateTextRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class TranslateTextResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Translation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class WaitOperationRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class BatchTranslateTextRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
hash :glossaries, as: 'glossaries', class: Google::Apis::TranslateV3::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3::TranslateTextGlossaryConfig::Representation
collection :input_configs, as: 'inputConfigs', class: Google::Apis::TranslateV3::InputConfig, decorator: Google::Apis::TranslateV3::InputConfig::Representation
hash :labels, as: 'labels'
hash :models, as: 'models'
property :output_config, as: 'outputConfig', class: Google::Apis::TranslateV3::OutputConfig, decorator: Google::Apis::TranslateV3::OutputConfig::Representation
property :source_language_code, as: 'sourceLanguageCode'
collection :target_language_codes, as: 'targetLanguageCodes'
end
end
class CancelOperationRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class DetectLanguageRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :content, as: 'content'
hash :labels, as: 'labels'
property :mime_type, as: 'mimeType'
property :model, as: 'model'
end
end
class DetectLanguageResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :languages, as: 'languages', class: Google::Apis::TranslateV3::DetectedLanguage, decorator: Google::Apis::TranslateV3::DetectedLanguage::Representation
end
end
class DetectedLanguage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :confidence, as: 'confidence'
property :language_code, as: 'languageCode'
end
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class GcsDestination
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :output_uri_prefix, as: 'outputUriPrefix'
end
end
class GcsSource
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :input_uri, as: 'inputUri'
end
end
class Glossary
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :end_time, as: 'endTime'
property :entry_count, as: 'entryCount'
property :input_config, as: 'inputConfig', class: Google::Apis::TranslateV3::GlossaryInputConfig, decorator: Google::Apis::TranslateV3::GlossaryInputConfig::Representation
property :language_codes_set, as: 'languageCodesSet', class: Google::Apis::TranslateV3::LanguageCodesSet, decorator: Google::Apis::TranslateV3::LanguageCodesSet::Representation
property :language_pair, as: 'languagePair', class: Google::Apis::TranslateV3::LanguageCodePair, decorator: Google::Apis::TranslateV3::LanguageCodePair::Representation
property :name, as: 'name'
property :submit_time, as: 'submitTime'
end
end
class GlossaryInputConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_source, as: 'gcsSource', class: Google::Apis::TranslateV3::GcsSource, decorator: Google::Apis::TranslateV3::GcsSource::Representation
end
end
class InputConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_source, as: 'gcsSource', class: Google::Apis::TranslateV3::GcsSource, decorator: Google::Apis::TranslateV3::GcsSource::Representation
property :mime_type, as: 'mimeType'
end
end
class LanguageCodePair
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :source_language_code, as: 'sourceLanguageCode'
property :target_language_code, as: 'targetLanguageCode'
end
end
class LanguageCodesSet
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :language_codes, as: 'languageCodes'
end
end
class ListGlossariesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :glossaries, as: 'glossaries', class: Google::Apis::TranslateV3::Glossary, decorator: Google::Apis::TranslateV3::Glossary::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListLocationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :locations, as: 'locations', class: Google::Apis::TranslateV3::Location, decorator: Google::Apis::TranslateV3::Location::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListOperationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :operations, as: 'operations', class: Google::Apis::TranslateV3::Operation, decorator: Google::Apis::TranslateV3::Operation::Representation
end
end
class Location
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :display_name, as: 'displayName'
hash :labels, as: 'labels'
property :location_id, as: 'locationId'
hash :metadata, as: 'metadata'
property :name, as: 'name'
end
end
class Operation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :done, as: 'done'
property :error, as: 'error', class: Google::Apis::TranslateV3::Status, decorator: Google::Apis::TranslateV3::Status::Representation
hash :metadata, as: 'metadata'
property :name, as: 'name'
hash :response, as: 'response'
end
end
class OutputConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :gcs_destination, as: 'gcsDestination', class: Google::Apis::TranslateV3::GcsDestination, decorator: Google::Apis::TranslateV3::GcsDestination::Representation
end
end
class Status
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :code, as: 'code'
collection :details, as: 'details'
property :message, as: 'message'
end
end
class SupportedLanguage
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :display_name, as: 'displayName'
property :language_code, as: 'languageCode'
property :support_source, as: 'supportSource'
property :support_target, as: 'supportTarget'
end
end
class SupportedLanguages
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :languages, as: 'languages', class: Google::Apis::TranslateV3::SupportedLanguage, decorator: Google::Apis::TranslateV3::SupportedLanguage::Representation
end
end
class TranslateTextGlossaryConfig
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :glossary, as: 'glossary'
property :ignore_case, as: 'ignoreCase'
end
end
class TranslateTextRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :contents, as: 'contents'
property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3::TranslateTextGlossaryConfig::Representation
hash :labels, as: 'labels'
property :mime_type, as: 'mimeType'
property :model, as: 'model'
property :source_language_code, as: 'sourceLanguageCode'
property :target_language_code, as: 'targetLanguageCode'
end
end
class TranslateTextResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :glossary_translations, as: 'glossaryTranslations', class: Google::Apis::TranslateV3::Translation, decorator: Google::Apis::TranslateV3::Translation::Representation
collection :translations, as: 'translations', class: Google::Apis::TranslateV3::Translation, decorator: Google::Apis::TranslateV3::Translation::Representation
end
end
class Translation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :detected_language_code, as: 'detectedLanguageCode'
property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3::TranslateTextGlossaryConfig::Representation
property :model, as: 'model'
property :translated_text, as: 'translatedText'
end
end
class WaitOperationRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :timeout, as: 'timeout'
end
end
end
end
end

View File

@ -0,0 +1,781 @@
# Copyright 2015 Google Inc.
#
# 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.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module TranslateV3
# Cloud Translation API
#
# Integrates text translation into your website or application.
#
# @example
# require 'google/apis/translate_v3'
#
# Translate = Google::Apis::TranslateV3 # Alias the module
# service = Translate::TranslateService.new
#
# @see https://cloud.google.com/translate/docs/quickstarts
class TranslateService < Google::Apis::Core::BaseService
# @return [String]
# API key. Your API key identifies your project and provides you with API access,
# quota, and reports. Required unless you provide an OAuth 2.0 token.
attr_accessor :key
# @return [String]
# 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.
attr_accessor :quota_user
def initialize
super('https://translation.googleapis.com/', '')
@batch_path = 'batch'
end
# Detects the language of text within a request.
# @param [String] parent
# Required. Project or location to make a call. Must refer to a caller's
# project.
# Format: `projects/`project-number-or-id`/locations/`location-id`` or
# `projects/`project-number-or-id``.
# For global calls, use `projects/`project-number-or-id`/locations/global` or
# `projects/`project-number-or-id``.
# Only models within the same region (has same location-id) can be used.
# Otherwise an INVALID_ARGUMENT (400) error is returned.
# @param [Google::Apis::TranslateV3::DetectLanguageRequest] detect_language_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::TranslateV3::DetectLanguageResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::DetectLanguageResponse]
#
# @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 detect_project_language(parent, detect_language_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+parent}:detectLanguage', options)
command.request_representation = Google::Apis::TranslateV3::DetectLanguageRequest::Representation
command.request_object = detect_language_request_object
command.response_representation = Google::Apis::TranslateV3::DetectLanguageResponse::Representation
command.response_class = Google::Apis::TranslateV3::DetectLanguageResponse
command.params['parent'] = parent unless parent.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 a list of supported languages for translation.
# @param [String] parent
# Required. Project or location to make a call. Must refer to a caller's
# project.
# Format: `projects/`project-number-or-id`` or
# `projects/`project-number-or-id`/locations/`location-id``.
# For global calls, use `projects/`project-number-or-id`/locations/global` or
# `projects/`project-number-or-id``.
# Non-global location is required for AutoML models.
# Only models within the same region (have same location-id) can be used,
# otherwise an INVALID_ARGUMENT (400) error is returned.
# @param [String] display_language_code
# Optional. The language to use to return localized, human readable names
# of supported languages. If missing, then display names are not returned
# in a response.
# @param [String] model
# Optional. Get supported languages of this model.
# The format depends on model type:
# - AutoML Translation models:
# `projects/`project-number-or-id`/locations/`location-id`/models/`model-id``
# - General (built-in) models:
# `projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
# `projects/`project-number-or-id`/locations/`location-id`/models/general/base`
# Returns languages supported by the specified model.
# If missing, we get supported languages of Google general base (PBMT) model.
# @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::TranslateV3::SupportedLanguages] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::SupportedLanguages]
#
# @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_supported_languages(parent, display_language_code: nil, model: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+parent}/supportedLanguages', options)
command.response_representation = Google::Apis::TranslateV3::SupportedLanguages::Representation
command.response_class = Google::Apis::TranslateV3::SupportedLanguages
command.params['parent'] = parent unless parent.nil?
command.query['displayLanguageCode'] = display_language_code unless display_language_code.nil?
command.query['model'] = model unless model.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Translates input text and returns translated text.
# @param [String] parent
# Required. Project or location to make a call. Must refer to a caller's
# project.
# Format: `projects/`project-number-or-id`` or
# `projects/`project-number-or-id`/locations/`location-id``.
# For global calls, use `projects/`project-number-or-id`/locations/global` or
# `projects/`project-number-or-id``.
# Non-global location is required for requests using AutoML models or
# custom glossaries.
# Models and glossaries must be within the same region (have same
# location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
# @param [Google::Apis::TranslateV3::TranslateTextRequest] translate_text_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::TranslateV3::TranslateTextResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::TranslateTextResponse]
#
# @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 translate_project_text(parent, translate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+parent}:translateText', options)
command.request_representation = Google::Apis::TranslateV3::TranslateTextRequest::Representation
command.request_object = translate_text_request_object
command.response_representation = Google::Apis::TranslateV3::TranslateTextResponse::Representation
command.response_class = Google::Apis::TranslateV3::TranslateTextResponse
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Translates a large volume of text in asynchronous batch mode.
# This function provides real-time output as the inputs are being processed.
# If caller cancels a request, the partial results (for an input file, it's
# all or nothing) may still be available on the specified output location.
# This call returns immediately and you can
# use google.longrunning.Operation.name to poll the status of the call.
# @param [String] parent
# Required. Location to make a call. Must refer to a caller's project.
# Format: `projects/`project-number-or-id`/locations/`location-id``.
# The `global` location is not supported for batch translation.
# Only AutoML Translation models or glossaries within the same region (have
# the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
# error is returned.
# @param [Google::Apis::TranslateV3::BatchTranslateTextRequest] batch_translate_text_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::TranslateV3::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Operation]
#
# @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_location_translate_text(parent, batch_translate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+parent}:batchTranslateText', options)
command.request_representation = Google::Apis::TranslateV3::BatchTranslateTextRequest::Representation
command.request_object = batch_translate_text_request_object
command.response_representation = Google::Apis::TranslateV3::Operation::Representation
command.response_class = Google::Apis::TranslateV3::Operation
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Detects the language of text within a request.
# @param [String] parent
# Required. Project or location to make a call. Must refer to a caller's
# project.
# Format: `projects/`project-number-or-id`/locations/`location-id`` or
# `projects/`project-number-or-id``.
# For global calls, use `projects/`project-number-or-id`/locations/global` or
# `projects/`project-number-or-id``.
# Only models within the same region (has same location-id) can be used.
# Otherwise an INVALID_ARGUMENT (400) error is returned.
# @param [Google::Apis::TranslateV3::DetectLanguageRequest] detect_language_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::TranslateV3::DetectLanguageResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::DetectLanguageResponse]
#
# @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 detect_location_language(parent, detect_language_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+parent}:detectLanguage', options)
command.request_representation = Google::Apis::TranslateV3::DetectLanguageRequest::Representation
command.request_object = detect_language_request_object
command.response_representation = Google::Apis::TranslateV3::DetectLanguageResponse::Representation
command.response_class = Google::Apis::TranslateV3::DetectLanguageResponse
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets information about a location.
# @param [String] name
# Resource name for the location.
# @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::TranslateV3::Location] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Location]
#
# @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_location(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+name}', options)
command.response_representation = Google::Apis::TranslateV3::Location::Representation
command.response_class = Google::Apis::TranslateV3::Location
command.params['name'] = name unless name.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 a list of supported languages for translation.
# @param [String] parent
# Required. Project or location to make a call. Must refer to a caller's
# project.
# Format: `projects/`project-number-or-id`` or
# `projects/`project-number-or-id`/locations/`location-id``.
# For global calls, use `projects/`project-number-or-id`/locations/global` or
# `projects/`project-number-or-id``.
# Non-global location is required for AutoML models.
# Only models within the same region (have same location-id) can be used,
# otherwise an INVALID_ARGUMENT (400) error is returned.
# @param [String] display_language_code
# Optional. The language to use to return localized, human readable names
# of supported languages. If missing, then display names are not returned
# in a response.
# @param [String] model
# Optional. Get supported languages of this model.
# The format depends on model type:
# - AutoML Translation models:
# `projects/`project-number-or-id`/locations/`location-id`/models/`model-id``
# - General (built-in) models:
# `projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
# `projects/`project-number-or-id`/locations/`location-id`/models/general/base`
# Returns languages supported by the specified model.
# If missing, we get supported languages of Google general base (PBMT) model.
# @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::TranslateV3::SupportedLanguages] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::SupportedLanguages]
#
# @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_location_supported_languages(parent, display_language_code: nil, model: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+parent}/supportedLanguages', options)
command.response_representation = Google::Apis::TranslateV3::SupportedLanguages::Representation
command.response_class = Google::Apis::TranslateV3::SupportedLanguages
command.params['parent'] = parent unless parent.nil?
command.query['displayLanguageCode'] = display_language_code unless display_language_code.nil?
command.query['model'] = model unless model.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 information about the supported locations for this service.
# @param [String] name
# The resource that owns the locations collection, if applicable.
# @param [String] filter
# The standard list filter.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
# The standard list page token.
# @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::TranslateV3::ListLocationsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::ListLocationsResponse]
#
# @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 list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+name}/locations', options)
command.response_representation = Google::Apis::TranslateV3::ListLocationsResponse::Representation
command.response_class = Google::Apis::TranslateV3::ListLocationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Translates input text and returns translated text.
# @param [String] parent
# Required. Project or location to make a call. Must refer to a caller's
# project.
# Format: `projects/`project-number-or-id`` or
# `projects/`project-number-or-id`/locations/`location-id``.
# For global calls, use `projects/`project-number-or-id`/locations/global` or
# `projects/`project-number-or-id``.
# Non-global location is required for requests using AutoML models or
# custom glossaries.
# Models and glossaries must be within the same region (have same
# location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
# @param [Google::Apis::TranslateV3::TranslateTextRequest] translate_text_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::TranslateV3::TranslateTextResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::TranslateTextResponse]
#
# @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 translate_location_text(parent, translate_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+parent}:translateText', options)
command.request_representation = Google::Apis::TranslateV3::TranslateTextRequest::Representation
command.request_object = translate_text_request_object
command.response_representation = Google::Apis::TranslateV3::TranslateTextResponse::Representation
command.response_class = Google::Apis::TranslateV3::TranslateTextResponse
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a glossary and returns the long-running operation. Returns
# NOT_FOUND, if the project doesn't exist.
# @param [String] parent
# Required. The project name.
# @param [Google::Apis::TranslateV3::Glossary] glossary_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::TranslateV3::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Operation]
#
# @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 create_project_location_glossary(parent, glossary_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+parent}/glossaries', options)
command.request_representation = Google::Apis::TranslateV3::Glossary::Representation
command.request_object = glossary_object
command.response_representation = Google::Apis::TranslateV3::Operation::Representation
command.response_class = Google::Apis::TranslateV3::Operation
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a glossary, or cancels glossary construction
# if the glossary isn't created yet.
# Returns NOT_FOUND, if the glossary doesn't exist.
# @param [String] name
# Required. The name of the glossary to delete.
# @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::TranslateV3::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Operation]
#
# @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 delete_project_location_glossary(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v3/{+name}', options)
command.response_representation = Google::Apis::TranslateV3::Operation::Representation
command.response_class = Google::Apis::TranslateV3::Operation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets a glossary. Returns NOT_FOUND, if the glossary doesn't
# exist.
# @param [String] name
# Required. The name of the glossary to retrieve.
# @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::TranslateV3::Glossary] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Glossary]
#
# @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_location_glossary(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+name}', options)
command.response_representation = Google::Apis::TranslateV3::Glossary::Representation
command.response_class = Google::Apis::TranslateV3::Glossary
command.params['name'] = name unless name.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 glossaries in a project. Returns NOT_FOUND, if the project doesn't
# exist.
# @param [String] parent
# Required. The name of the project from which to list all of the glossaries.
# @param [String] filter
# Optional. Filter specifying constraints of a list operation.
# Filtering is not supported yet, and the parameter currently has no effect.
# If missing, no filtering is performed.
# @param [Fixnum] page_size
# Optional. Requested page size. The server may return fewer glossaries than
# requested. If unspecified, the server picks an appropriate default.
# @param [String] page_token
# Optional. A token identifying a page of results the server should return.
# Typically, this is the value of [ListGlossariesResponse.next_page_token]
# returned from the previous call to `ListGlossaries` method.
# The first page is returned if `page_token`is empty or missing.
# @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::TranslateV3::ListGlossariesResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::ListGlossariesResponse]
#
# @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 list_project_location_glossaries(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+parent}/glossaries', options)
command.response_representation = Google::Apis::TranslateV3::ListGlossariesResponse::Representation
command.response_class = Google::Apis::TranslateV3::ListGlossariesResponse
command.params['parent'] = parent unless parent.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Starts asynchronous cancellation on a long-running operation. The server
# makes a best effort to cancel the operation, but success is not
# guaranteed. If the server doesn't support this method, it returns
# `google.rpc.Code.UNIMPLEMENTED`. Clients can use
# Operations.GetOperation or
# other methods to check whether the cancellation succeeded or whether the
# operation completed despite cancellation. On successful cancellation,
# the operation is not deleted; instead, it becomes an operation with
# an Operation.error value with a google.rpc.Status.code of 1,
# corresponding to `Code.CANCELLED`.
# @param [String] name
# The name of the operation resource to be cancelled.
# @param [Google::Apis::TranslateV3::CancelOperationRequest] cancel_operation_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::TranslateV3::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Empty]
#
# @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 cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+name}:cancel', options)
command.request_representation = Google::Apis::TranslateV3::CancelOperationRequest::Representation
command.request_object = cancel_operation_request_object
command.response_representation = Google::Apis::TranslateV3::Empty::Representation
command.response_class = Google::Apis::TranslateV3::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a long-running operation. This method indicates that the client is
# no longer interested in the operation result. It does not cancel the
# operation. If the server doesn't support this method, it returns
# `google.rpc.Code.UNIMPLEMENTED`.
# @param [String] name
# The name of the operation resource to be deleted.
# @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::TranslateV3::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Empty]
#
# @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 delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v3/{+name}', options)
command.response_representation = Google::Apis::TranslateV3::Empty::Representation
command.response_class = Google::Apis::TranslateV3::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the latest state of a long-running operation. Clients can use this
# method to poll the operation result at intervals as recommended by the API
# service.
# @param [String] name
# The name of the operation resource.
# @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::TranslateV3::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Operation]
#
# @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_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+name}', options)
command.response_representation = Google::Apis::TranslateV3::Operation::Representation
command.response_class = Google::Apis::TranslateV3::Operation
command.params['name'] = name unless name.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 operations that match the specified filter in the request. If the
# server doesn't support this method, it returns `UNIMPLEMENTED`.
# NOTE: the `name` binding allows API services to override the binding
# to use different resource name schemes, such as `users/*/operations`. To
# override the binding, API services can add a binding such as
# `"/v1/`name=users/*`/operations"` to their service configuration.
# For backwards compatibility, the default name includes the operations
# collection id, however overriding users must ensure the name binding
# is the parent resource, without the operations collection id.
# @param [String] name
# The name of the operation's parent resource.
# @param [String] filter
# The standard list filter.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
# The standard list page token.
# @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::TranslateV3::ListOperationsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::ListOperationsResponse]
#
# @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 list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v3/{+name}/operations', options)
command.response_representation = Google::Apis::TranslateV3::ListOperationsResponse::Representation
command.response_class = Google::Apis::TranslateV3::ListOperationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Waits for the specified long-running operation until it is done or reaches
# at most a specified timeout, returning the latest state. If the operation
# is already done, the latest state is immediately returned. If the timeout
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
# timeout is used. If the server does not support this method, it returns
# `google.rpc.Code.UNIMPLEMENTED`.
# Note that this method is on a best-effort basis. It may return the latest
# state before the specified timeout (including immediately), meaning even an
# immediate response is no guarantee that the operation is done.
# @param [String] name
# The name of the operation resource to wait on.
# @param [Google::Apis::TranslateV3::WaitOperationRequest] wait_operation_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::TranslateV3::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TranslateV3::Operation]
#
# @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 wait_operation(name, wait_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v3/{+name}:wait', options)
command.request_representation = Google::Apis::TranslateV3::WaitOperationRequest::Representation
command.request_object = wait_operation_request_object
command.response_representation = Google::Apis::TranslateV3::Operation::Representation
command.response_class = Google::Apis::TranslateV3::Operation
command.params['name'] = name unless name.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
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
end
end
end
end
end