# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://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. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/errors" require "google/cloud/iot/v1/device_manager_pb" module Google module Cloud module Iot module V1 module DeviceManager ## # Client for the DeviceManager service. # # Internet of Things (IoT) service. Securely connect and manage IoT devices. # class Client include Paths # @private attr_reader :device_manager_stub ## # Configure the DeviceManager Client class. # # See {::Google::Cloud::Iot::V1::DeviceManager::Client::Configuration} # for a description of the configuration fields. # # ## Example # # To modify the configuration for all DeviceManager clients: # # ::Google::Cloud::Iot::V1::DeviceManager::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Iot", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.create_device_registry.timeout = 120.0 default_config.rpcs.get_device_registry.timeout = 120.0 default_config.rpcs.get_device_registry.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.update_device_registry.timeout = 120.0 default_config.rpcs.delete_device_registry.timeout = 120.0 default_config.rpcs.delete_device_registry.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_device_registries.timeout = 120.0 default_config.rpcs.list_device_registries.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.create_device.timeout = 120.0 default_config.rpcs.get_device.timeout = 120.0 default_config.rpcs.get_device.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.update_device.timeout = 120.0 default_config.rpcs.delete_device.timeout = 120.0 default_config.rpcs.delete_device.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_devices.timeout = 120.0 default_config.rpcs.list_devices.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.modify_cloud_to_device_config.timeout = 120.0 default_config.rpcs.modify_cloud_to_device_config.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4, 8] } default_config.rpcs.list_device_config_versions.timeout = 120.0 default_config.rpcs.list_device_config_versions.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_device_states.timeout = 120.0 default_config.rpcs.list_device_states.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.set_iam_policy.timeout = 120.0 default_config.rpcs.get_iam_policy.timeout = 120.0 default_config.rpcs.test_iam_permissions.timeout = 120.0 default_config.rpcs.send_command_to_device.timeout = 120.0 default_config.rpcs.send_command_to_device.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4, 8] } default_config.rpcs.bind_device_to_gateway.timeout = 120.0 default_config.rpcs.unbind_device_from_gateway.timeout = 120.0 default_config end yield @configure if block_given? @configure end ## # Configure the DeviceManager Client instance. # # The configuration is set to the derived mode, meaning that values can be changed, # but structural changes (adding new fields, etc.) are not allowed. Structural changes # should be made on {Client.configure}. # # See {::Google::Cloud::Iot::V1::DeviceManager::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # Create a new DeviceManager client object. # # ## Examples # # To create a new DeviceManager client with the default # configuration: # # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new # # To create a new DeviceManager client with a custom # configuration: # # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the DeviceManager client. # @yieldparam config [Client::Configuration] # def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/iot/v1/device_manager_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the scope and endpoint are unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.scope == Client.configure.scope && @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(String) || credentials.is_a?(Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @device_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Iot::V1::DeviceManager::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end # Service calls ## # Creates a device registry that contains devices. # # @overload create_device_registry(request, options = nil) # Pass arguments to `create_device_registry` via a request object, either of type # {::Google::Cloud::Iot::V1::CreateDeviceRegistryRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::CreateDeviceRegistryRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_device_registry(parent: nil, device_registry: nil) # Pass arguments to `create_device_registry` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and cloud region where this device registry must be created. # For example, `projects/example-project/locations/us-central1`. # @param device_registry [::Google::Cloud::Iot::V1::DeviceRegistry, ::Hash] # Required. The device registry. The field `name` must be empty. The server will # generate that field from the device registry `id` provided and the # `parent` field. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::DeviceRegistry] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::DeviceRegistry] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def create_device_registry request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::CreateDeviceRegistryRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_device_registry.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_device_registry.timeout, metadata: metadata, retry_policy: @config.rpcs.create_device_registry.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :create_device_registry, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets a device registry configuration. # # @overload get_device_registry(request, options = nil) # Pass arguments to `get_device_registry` via a request object, either of type # {::Google::Cloud::Iot::V1::GetDeviceRegistryRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::GetDeviceRegistryRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_device_registry(name: nil) # Pass arguments to `get_device_registry` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device registry. For example, # `projects/example-project/locations/us-central1/registries/my-registry`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::DeviceRegistry] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::DeviceRegistry] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def get_device_registry request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::GetDeviceRegistryRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_device_registry.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_device_registry.timeout, metadata: metadata, retry_policy: @config.rpcs.get_device_registry.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :get_device_registry, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates a device registry configuration. # # @overload update_device_registry(request, options = nil) # Pass arguments to `update_device_registry` via a request object, either of type # {::Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_device_registry(device_registry: nil, update_mask: nil) # Pass arguments to `update_device_registry` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param device_registry [::Google::Cloud::Iot::V1::DeviceRegistry, ::Hash] # Required. The new values for the device registry. The `id` field must be empty, and # the `name` field must indicate the path of the resource. For example, # `projects/example-project/locations/us-central1/registries/my-registry`. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Only updates the `device_registry` fields indicated by this mask. # The field mask must not be empty, and it must not contain fields that # are immutable or only set by the server. # Mutable top-level fields: `event_notification_config`, `http_config`, # `mqtt_config`, and `state_notification_config`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::DeviceRegistry] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::DeviceRegistry] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def update_device_registry request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_device_registry.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "device_registry.name" => request.device_registry.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_device_registry.timeout, metadata: metadata, retry_policy: @config.rpcs.update_device_registry.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :update_device_registry, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a device registry configuration. # # @overload delete_device_registry(request, options = nil) # Pass arguments to `delete_device_registry` via a request object, either of type # {::Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_device_registry(name: nil) # Pass arguments to `delete_device_registry` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device registry. For example, # `projects/example-project/locations/us-central1/registries/my-registry`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def delete_device_registry request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_device_registry.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_device_registry.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_device_registry.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :delete_device_registry, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists device registries. # # @overload list_device_registries(request, options = nil) # Pass arguments to `list_device_registries` via a request object, either of type # {::Google::Cloud::Iot::V1::ListDeviceRegistriesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::ListDeviceRegistriesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_device_registries(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_device_registries` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and cloud region path. For example, # `projects/example-project/locations/us-central1`. # @param page_size [::Integer] # The maximum number of registries to return in the response. If this value # is zero, the service will select a default size. A call may return fewer # objects than requested. A non-empty `next_page_token` in the response # indicates that more data is available. # @param page_token [::String] # The value returned by the last `ListDeviceRegistriesResponse`; indicates # that this is a continuation of a prior `ListDeviceRegistries` call and # the system should return the next page of data. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::DeviceRegistry>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::DeviceRegistry>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_device_registries request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDeviceRegistriesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_device_registries.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_device_registries.timeout, metadata: metadata, retry_policy: @config.rpcs.list_device_registries.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :list_device_registries, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @device_manager_stub, :list_device_registries, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a device in a device registry. # # @overload create_device(request, options = nil) # Pass arguments to `create_device` via a request object, either of type # {::Google::Cloud::Iot::V1::CreateDeviceRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::CreateDeviceRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_device(parent: nil, device: nil) # Pass arguments to `create_device` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The name of the device registry where this device should be created. # For example, # `projects/example-project/locations/us-central1/registries/my-registry`. # @param device [::Google::Cloud::Iot::V1::Device, ::Hash] # Required. The device registration details. The field `name` must be empty. The server # generates `name` from the device registry `id` and the # `parent` field. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::Device] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::Device] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def create_device request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::CreateDeviceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_device.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_device.timeout, metadata: metadata, retry_policy: @config.rpcs.create_device.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :create_device, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details about a device. # # @overload get_device(request, options = nil) # Pass arguments to `get_device` via a request object, either of type # {::Google::Cloud::Iot::V1::GetDeviceRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::GetDeviceRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_device(name: nil, field_mask: nil) # Pass arguments to `get_device` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device. For example, # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] # The fields of the `Device` resource to be returned in the response. If the # field mask is unset or empty, all fields are returned. Fields have to be # provided in snake_case format, for example: `last_heartbeat_time`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::Device] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::Device] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def get_device request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::GetDeviceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_device.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_device.timeout, metadata: metadata, retry_policy: @config.rpcs.get_device.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :get_device, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates a device. # # @overload update_device(request, options = nil) # Pass arguments to `update_device` via a request object, either of type # {::Google::Cloud::Iot::V1::UpdateDeviceRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::UpdateDeviceRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_device(device: nil, update_mask: nil) # Pass arguments to `update_device` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param device [::Google::Cloud::Iot::V1::Device, ::Hash] # Required. The new values for the device. The `id` and `num_id` fields must # be empty, and the field `name` must specify the name path. For example, # `projects/p0/locations/us-central1/registries/registry0/devices/device0`or # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Only updates the `device` fields indicated by this mask. # The field mask must not be empty, and it must not contain fields that # are immutable or only set by the server. # Mutable top-level fields: `credentials`, `blocked`, and `metadata` # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::Device] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::Device] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def update_device request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::UpdateDeviceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_device.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "device.name" => request.device.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_device.timeout, metadata: metadata, retry_policy: @config.rpcs.update_device.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :update_device, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a device. # # @overload delete_device(request, options = nil) # Pass arguments to `delete_device` via a request object, either of type # {::Google::Cloud::Iot::V1::DeleteDeviceRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::DeleteDeviceRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_device(name: nil) # Pass arguments to `delete_device` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device. For example, # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def delete_device request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::DeleteDeviceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_device.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_device.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_device.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :delete_device, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # List devices in a device registry. # # @overload list_devices(request, options = nil) # Pass arguments to `list_devices` via a request object, either of type # {::Google::Cloud::Iot::V1::ListDevicesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::ListDevicesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_devices(parent: nil, device_num_ids: nil, device_ids: nil, field_mask: nil, gateway_list_options: nil, page_size: nil, page_token: nil) # Pass arguments to `list_devices` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The device registry path. Required. For example, # `projects/my-project/locations/us-central1/registries/my-registry`. # @param device_num_ids [::Array<::Integer>] # A list of device numeric IDs. If empty, this field is ignored. Maximum # IDs: 10,000. # @param device_ids [::Array<::String>] # A list of device string IDs. For example, `['device0', 'device12']`. # If empty, this field is ignored. Maximum IDs: 10,000 # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] # The fields of the `Device` resource to be returned in the response. The # fields `id` and `num_id` are always returned, along with any # other fields specified in snake_case format, for example: # `last_heartbeat_time`. # @param gateway_list_options [::Google::Cloud::Iot::V1::GatewayListOptions, ::Hash] # Options related to gateways. # @param page_size [::Integer] # The maximum number of devices to return in the response. If this value # is zero, the service will select a default size. A call may return fewer # objects than requested. A non-empty `next_page_token` in the response # indicates that more data is available. # @param page_token [::String] # The value returned by the last `ListDevicesResponse`; indicates # that this is a continuation of a prior `ListDevices` call and # the system should return the next page of data. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::Device>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Iot::V1::Device>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_devices request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDevicesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_devices.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_devices.timeout, metadata: metadata, retry_policy: @config.rpcs.list_devices.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :list_devices, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @device_manager_stub, :list_devices, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Modifies the configuration for the device, which is eventually sent from # the Cloud IoT Core servers. Returns the modified configuration version and # its metadata. # # @overload modify_cloud_to_device_config(request, options = nil) # Pass arguments to `modify_cloud_to_device_config` via a request object, either of type # {::Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload modify_cloud_to_device_config(name: nil, version_to_update: nil, binary_data: nil) # Pass arguments to `modify_cloud_to_device_config` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device. For example, # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. # @param version_to_update [::Integer] # The version number to update. If this value is zero, it will not check the # version number of the server and will always update the current version; # otherwise, this update will fail if the version number found on the server # does not match this version number. This is used to support multiple # simultaneous updates without losing data. # @param binary_data [::String] # Required. The configuration data for the device. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::DeviceConfig] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::DeviceConfig] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def modify_cloud_to_device_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.modify_cloud_to_device_config.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.modify_cloud_to_device_config.timeout, metadata: metadata, retry_policy: @config.rpcs.modify_cloud_to_device_config.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :modify_cloud_to_device_config, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the last few versions of the device configuration in descending # order (i.e.: newest first). # # @overload list_device_config_versions(request, options = nil) # Pass arguments to `list_device_config_versions` via a request object, either of type # {::Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_device_config_versions(name: nil, num_versions: nil) # Pass arguments to `list_device_config_versions` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device. For example, # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. # @param num_versions [::Integer] # The number of versions to list. Versions are listed in decreasing order of # the version number. The maximum number of versions retained is 10. If this # value is zero, it will return all the versions available. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::ListDeviceConfigVersionsResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::ListDeviceConfigVersionsResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_device_config_versions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_device_config_versions.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_device_config_versions.timeout, metadata: metadata, retry_policy: @config.rpcs.list_device_config_versions.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :list_device_config_versions, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the last few versions of the device state in descending order (i.e.: # newest first). # # @overload list_device_states(request, options = nil) # Pass arguments to `list_device_states` via a request object, either of type # {::Google::Cloud::Iot::V1::ListDeviceStatesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::ListDeviceStatesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_device_states(name: nil, num_states: nil) # Pass arguments to `list_device_states` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device. For example, # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. # @param num_states [::Integer] # The number of states to list. States are listed in descending order of # update time. The maximum number of states retained is 10. If this # value is zero, it will return all the states available. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::ListDeviceStatesResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::ListDeviceStatesResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_device_states request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::ListDeviceStatesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_device_states.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_device_states.timeout, metadata: metadata, retry_policy: @config.rpcs.list_device_states.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :list_device_states, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Sets the access control policy on the specified resource. Replaces any # existing policy. # # @overload set_iam_policy(request, options = nil) # Pass arguments to `set_iam_policy` via a request object, either of type # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. # # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload set_iam_policy(resource: nil, policy: nil) # Pass arguments to `set_iam_policy` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param resource [::String] # REQUIRED: The resource for which the policy is being specified. # See the operation documentation for the appropriate value for this field. # @param policy [::Google::Iam::V1::Policy, ::Hash] # REQUIRED: The complete policy to be applied to the `resource`. The size of # the policy is limited to a few 10s of KB. An empty policy is a # valid policy but certain Cloud Platform services (such as Projects) # might reject them. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Iam::V1::Policy] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Iam::V1::Policy] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def set_iam_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.set_iam_policy.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "resource" => request.resource } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, metadata: metadata, retry_policy: @config.rpcs.set_iam_policy.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets the access control policy for a resource. # Returns an empty policy if the resource exists and does not have a policy # set. # # @overload get_iam_policy(request, options = nil) # Pass arguments to `get_iam_policy` via a request object, either of type # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. # # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_iam_policy(resource: nil, options: nil) # Pass arguments to `get_iam_policy` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param resource [::String] # REQUIRED: The resource for which the policy is being requested. # See the operation documentation for the appropriate value for this field. # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] # OPTIONAL: A `GetPolicyOptions` object for specifying options to # `GetIamPolicy`. This field is only used by Cloud IAM. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Iam::V1::Policy] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Iam::V1::Policy] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def get_iam_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_iam_policy.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "resource" => request.resource } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, metadata: metadata, retry_policy: @config.rpcs.get_iam_policy.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Returns permissions that a caller has on the specified resource. # If the resource does not exist, this will return an empty set of # permissions, not a NOT_FOUND error. # # @overload test_iam_permissions(request, options = nil) # Pass arguments to `test_iam_permissions` via a request object, either of type # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. # # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload test_iam_permissions(resource: nil, permissions: nil) # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param resource [::String] # REQUIRED: The resource for which the policy detail is being requested. # See the operation documentation for the appropriate value for this field. # @param permissions [::Array<::String>] # The set of permissions to check for the `resource`. Permissions with # wildcards (such as '*' or 'storage.*') are not allowed. For more # information see # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Iam::V1::TestIamPermissionsResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def test_iam_permissions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.test_iam_permissions.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "resource" => request.resource } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, metadata: metadata, retry_policy: @config.rpcs.test_iam_permissions.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Sends a command to the specified device. In order for a device to be able # to receive commands, it must: # 1) be connected to Cloud IoT Core using the MQTT protocol, and # 2) be subscribed to the group of MQTT topics specified by # /devices/\\{device-id}/commands/#. This subscription will receive commands # at the top-level topic /devices/\\{device-id}/commands as well as commands # for subfolders, like /devices/\\{device-id}/commands/subfolder. # Note that subscribing to specific subfolders is not supported. # If the command could not be delivered to the device, this method will # return an error; in particular, if the device is not subscribed, this # method will return FAILED_PRECONDITION. Otherwise, this method will # return OK. If the subscription is QoS 1, at least once delivery will be # guaranteed; for QoS 0, no acknowledgment will be expected from the device. # # @overload send_command_to_device(request, options = nil) # Pass arguments to `send_command_to_device` via a request object, either of type # {::Google::Cloud::Iot::V1::SendCommandToDeviceRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::SendCommandToDeviceRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload send_command_to_device(name: nil, binary_data: nil, subfolder: nil) # Pass arguments to `send_command_to_device` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. The name of the device. For example, # `projects/p0/locations/us-central1/registries/registry0/devices/device0` or # `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. # @param binary_data [::String] # Required. The command data to send to the device. # @param subfolder [::String] # Optional subfolder for the command. If empty, the command will be delivered # to the /devices/\\{device-id}/commands topic, otherwise it will be delivered # to the /devices/\\{device-id}/commands/\\{subfolder} topic. Multi-level # subfolders are allowed. This field must not have more than 256 characters, # and must not contain any MQTT wildcards ("+" or "#") or null characters. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::SendCommandToDeviceResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::SendCommandToDeviceResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def send_command_to_device request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::SendCommandToDeviceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.send_command_to_device.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.send_command_to_device.timeout, metadata: metadata, retry_policy: @config.rpcs.send_command_to_device.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :send_command_to_device, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Associates the device with the gateway. # # @overload bind_device_to_gateway(request, options = nil) # Pass arguments to `bind_device_to_gateway` via a request object, either of type # {::Google::Cloud::Iot::V1::BindDeviceToGatewayRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::BindDeviceToGatewayRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload bind_device_to_gateway(parent: nil, gateway_id: nil, device_id: nil) # Pass arguments to `bind_device_to_gateway` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The name of the registry. For example, # `projects/example-project/locations/us-central1/registries/my-registry`. # @param gateway_id [::String] # Required. The value of `gateway_id` can be either the device numeric ID or the # user-defined device identifier. # @param device_id [::String] # Required. The device to associate with the specified gateway. The value of # `device_id` can be either the device numeric ID or the user-defined device # identifier. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::BindDeviceToGatewayResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::BindDeviceToGatewayResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def bind_device_to_gateway request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::BindDeviceToGatewayRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.bind_device_to_gateway.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.bind_device_to_gateway.timeout, metadata: metadata, retry_policy: @config.rpcs.bind_device_to_gateway.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :bind_device_to_gateway, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes the association between the device and the gateway. # # @overload unbind_device_from_gateway(request, options = nil) # Pass arguments to `unbind_device_from_gateway` via a request object, either of type # {::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload unbind_device_from_gateway(parent: nil, gateway_id: nil, device_id: nil) # Pass arguments to `unbind_device_from_gateway` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The name of the registry. For example, # `projects/example-project/locations/us-central1/registries/my-registry`. # @param gateway_id [::String] # Required. The value of `gateway_id` can be either the device numeric ID or the # user-defined device identifier. # @param device_id [::String] # Required. The device to disassociate from the specified gateway. The value of # `device_id` can be either the device numeric ID or the user-defined device # identifier. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def unbind_device_from_gateway request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.unbind_device_from_gateway.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Iot::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.unbind_device_from_gateway.timeout, metadata: metadata, retry_policy: @config.rpcs.unbind_device_from_gateway.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @device_manager_stub.call_rpc :unbind_device_from_gateway, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the DeviceManager API. # # This class represents the configuration for DeviceManager, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::Iot::V1::DeviceManager::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # # Examples # # To modify the global config, setting the timeout for create_device_registry # to 20 seconds, and all remaining timeouts to 10 seconds: # # ::Google::Cloud::Iot::V1::DeviceManager::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.create_device_registry.timeout = 20.0 # end # # To apply the above configuration only to a new client: # # client = ::Google::Cloud::Iot::V1::DeviceManager::Client.new do |config| # config.timeout = 10.0 # config.rpcs.create_device_registry.timeout = 20.0 # end # # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `"cloudiot.googleapis.com"`. # @return [::String] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`String`) The path to a service account key file in JSON format # * (`Hash`) A service account key as a Hash # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) # * (`GRPC::Core::Channel`) a gRPC channel with included credentials # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object # * (`nil`) indicating no credentials # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] channel_args # Extra parameters passed to the gRPC channel. Note: this is ignored if a # `GRPC::Core::Channel` object is provided as the credential. # @return [::Hash] # @!attribute [rw] interceptors # An array of interceptors that are run before calls are executed. # @return [::Array<::GRPC::ClientInterceptor>] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional gRPC headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # class Configuration extend ::Gapic::Config config_attr :endpoint, "cloudiot.googleapis.com", ::String config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) config_attr :interceptors, nil, ::Array, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration RPC class for the DeviceManager API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `create_device_registry` # @return [::Gapic::Config::Method] # attr_reader :create_device_registry ## # RPC-specific configuration for `get_device_registry` # @return [::Gapic::Config::Method] # attr_reader :get_device_registry ## # RPC-specific configuration for `update_device_registry` # @return [::Gapic::Config::Method] # attr_reader :update_device_registry ## # RPC-specific configuration for `delete_device_registry` # @return [::Gapic::Config::Method] # attr_reader :delete_device_registry ## # RPC-specific configuration for `list_device_registries` # @return [::Gapic::Config::Method] # attr_reader :list_device_registries ## # RPC-specific configuration for `create_device` # @return [::Gapic::Config::Method] # attr_reader :create_device ## # RPC-specific configuration for `get_device` # @return [::Gapic::Config::Method] # attr_reader :get_device ## # RPC-specific configuration for `update_device` # @return [::Gapic::Config::Method] # attr_reader :update_device ## # RPC-specific configuration for `delete_device` # @return [::Gapic::Config::Method] # attr_reader :delete_device ## # RPC-specific configuration for `list_devices` # @return [::Gapic::Config::Method] # attr_reader :list_devices ## # RPC-specific configuration for `modify_cloud_to_device_config` # @return [::Gapic::Config::Method] # attr_reader :modify_cloud_to_device_config ## # RPC-specific configuration for `list_device_config_versions` # @return [::Gapic::Config::Method] # attr_reader :list_device_config_versions ## # RPC-specific configuration for `list_device_states` # @return [::Gapic::Config::Method] # attr_reader :list_device_states ## # RPC-specific configuration for `set_iam_policy` # @return [::Gapic::Config::Method] # attr_reader :set_iam_policy ## # RPC-specific configuration for `get_iam_policy` # @return [::Gapic::Config::Method] # attr_reader :get_iam_policy ## # RPC-specific configuration for `test_iam_permissions` # @return [::Gapic::Config::Method] # attr_reader :test_iam_permissions ## # RPC-specific configuration for `send_command_to_device` # @return [::Gapic::Config::Method] # attr_reader :send_command_to_device ## # RPC-specific configuration for `bind_device_to_gateway` # @return [::Gapic::Config::Method] # attr_reader :bind_device_to_gateway ## # RPC-specific configuration for `unbind_device_from_gateway` # @return [::Gapic::Config::Method] # attr_reader :unbind_device_from_gateway # @private def initialize parent_rpcs = nil create_device_registry_config = parent_rpcs.create_device_registry if parent_rpcs.respond_to? :create_device_registry @create_device_registry = ::Gapic::Config::Method.new create_device_registry_config get_device_registry_config = parent_rpcs.get_device_registry if parent_rpcs.respond_to? :get_device_registry @get_device_registry = ::Gapic::Config::Method.new get_device_registry_config update_device_registry_config = parent_rpcs.update_device_registry if parent_rpcs.respond_to? :update_device_registry @update_device_registry = ::Gapic::Config::Method.new update_device_registry_config delete_device_registry_config = parent_rpcs.delete_device_registry if parent_rpcs.respond_to? :delete_device_registry @delete_device_registry = ::Gapic::Config::Method.new delete_device_registry_config list_device_registries_config = parent_rpcs.list_device_registries if parent_rpcs.respond_to? :list_device_registries @list_device_registries = ::Gapic::Config::Method.new list_device_registries_config create_device_config = parent_rpcs.create_device if parent_rpcs.respond_to? :create_device @create_device = ::Gapic::Config::Method.new create_device_config get_device_config = parent_rpcs.get_device if parent_rpcs.respond_to? :get_device @get_device = ::Gapic::Config::Method.new get_device_config update_device_config = parent_rpcs.update_device if parent_rpcs.respond_to? :update_device @update_device = ::Gapic::Config::Method.new update_device_config delete_device_config = parent_rpcs.delete_device if parent_rpcs.respond_to? :delete_device @delete_device = ::Gapic::Config::Method.new delete_device_config list_devices_config = parent_rpcs.list_devices if parent_rpcs.respond_to? :list_devices @list_devices = ::Gapic::Config::Method.new list_devices_config modify_cloud_to_device_config_config = parent_rpcs.modify_cloud_to_device_config if parent_rpcs.respond_to? :modify_cloud_to_device_config @modify_cloud_to_device_config = ::Gapic::Config::Method.new modify_cloud_to_device_config_config list_device_config_versions_config = parent_rpcs.list_device_config_versions if parent_rpcs.respond_to? :list_device_config_versions @list_device_config_versions = ::Gapic::Config::Method.new list_device_config_versions_config list_device_states_config = parent_rpcs.list_device_states if parent_rpcs.respond_to? :list_device_states @list_device_states = ::Gapic::Config::Method.new list_device_states_config set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config send_command_to_device_config = parent_rpcs.send_command_to_device if parent_rpcs.respond_to? :send_command_to_device @send_command_to_device = ::Gapic::Config::Method.new send_command_to_device_config bind_device_to_gateway_config = parent_rpcs.bind_device_to_gateway if parent_rpcs.respond_to? :bind_device_to_gateway @bind_device_to_gateway = ::Gapic::Config::Method.new bind_device_to_gateway_config unbind_device_from_gateway_config = parent_rpcs.unbind_device_from_gateway if parent_rpcs.respond_to? :unbind_device_from_gateway @unbind_device_from_gateway = ::Gapic::Config::Method.new unbind_device_from_gateway_config yield self if block_given? end end end end end end end end end