Class: Google::Apis::SmartdevicemanagementV1::SmartDeviceManagementService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
generated/google/apis/smartdevicemanagement_v1/service.rb

Overview

Smart Device Management API

Allow select enterprise partners to access, control, and manage Google and Nest devices programmatically.

Examples:

require 'google/apis/smartdevicemanagement_v1'

Smartdevicemanagement = Google::Apis::SmartdevicemanagementV1 # Alias the module
service = Smartdevicemanagement::SmartDeviceManagementService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSmartDeviceManagementService

Returns a new instance of SmartDeviceManagementService.



46
47
48
49
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 46

def initialize
  super('https://smartdevicemanagement.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns 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.

Returns:

  • (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.



39
40
41
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 39

def key
  @key
end

#quota_userString

Returns 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.

Returns:

  • (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.



44
45
46
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#execute_enterprise_device_command(name, google_home_enterprise_sdm_v1_execute_device_command_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandResponse

Executes a command to device managed by the enterprise.

Parameters:

  • name (String)

    The name of the device requested. For example: "enterprises/XYZ/devices/123"

  • google_home_enterprise_sdm_v1_execute_device_command_request_object (Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



72
73
74
75
76
77
78
79
80
81
82
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 72

def execute_enterprise_device_command(name, google_home_enterprise_sdm_v1_execute_device_command_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:executeCommand', options)
  command.request_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandRequest::Representation
  command.request_object = google_home_enterprise_sdm_v1_execute_device_command_request_object
  command.response_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandResponse::Representation
  command.response_class = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ExecuteDeviceCommandResponse
  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

#get_enterprise_device(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Device

Gets a device managed by the enterprise.

Parameters:

  • name (String)

    The name of the device requested. For example: "enterprises/XYZ/devices/123"

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



104
105
106
107
108
109
110
111
112
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 104

def get_enterprise_device(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Device::Representation
  command.response_class = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Device
  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

#get_enterprise_structure(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Structure

Gets a structure managed by the enterprise.

Parameters:

  • name (String)

    The name of the structure requested. For example: "enterprises/XYZ/structures/ ABC".

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



176
177
178
179
180
181
182
183
184
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 176

def get_enterprise_structure(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Structure::Representation
  command.response_class = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Structure
  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

#get_enterprise_structure_room(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Room

Gets a room managed by the enterprise.

Parameters:

  • name (String)

    The name of the room requested. For example: "enterprises/XYZ/structures/ABC/ rooms/123".

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



247
248
249
250
251
252
253
254
255
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 247

def get_enterprise_structure_room(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Room::Representation
  command.response_class = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1Room
  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

#list_enterprise_devices(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListDevicesResponse

Lists devices managed by the enterprise.

Parameters:

  • parent (String)

    The parent enterprise to list devices under. E.g. "enterprises/XYZ".

  • filter (String) (defaults to: nil)

    Optional filter to list devices. Filters can be done on: Device custom name ( substring match): 'customName=wing'

  • page_size (Fixnum) (defaults to: nil)

    Optional requested page size. Server may return fewer devices than requested. If unspecified, server will pick an appropriate default.

  • page_token (String) (defaults to: nil)

    Optional token of the page to retrieve.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



142
143
144
145
146
147
148
149
150
151
152
153
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 142

def list_enterprise_devices(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/devices', options)
  command.response_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListDevicesResponse::Representation
  command.response_class = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListDevicesResponse
  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

#list_enterprise_structure_rooms(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListRoomsResponse

Lists rooms managed by the enterprise.

Parameters:

  • parent (String)

    The parent resource name of the rooms requested. For example: "enterprises/XYZ/ structures/ABC".

  • page_size (Fixnum) (defaults to: nil)

    Requested page size. Server may return fewer rooms than requested. If unspecified, server will pick an appropriate default.

  • page_token (String) (defaults to: nil)

    The token of the page to retrieve.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



283
284
285
286
287
288
289
290
291
292
293
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 283

def list_enterprise_structure_rooms(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/rooms', options)
  command.response_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListRoomsResponse::Representation
  command.response_class = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListRoomsResponse
  command.params['parent'] = parent unless parent.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

#list_enterprise_structures(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListStructuresResponse

Lists structures managed by the enterprise.

Parameters:

  • parent (String)

    The parent enterprise to list structures under. E.g. "enterprises/XYZ".

  • filter (String) (defaults to: nil)

    Optional filter to list structures.

  • page_size (Fixnum) (defaults to: nil)

    Requested page size. Server may return fewer structures than requested. If unspecified, server will pick an appropriate default.

  • page_token (String) (defaults to: nil)

    The token of the page to retrieve.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



213
214
215
216
217
218
219
220
221
222
223
224
# File 'generated/google/apis/smartdevicemanagement_v1/service.rb', line 213

def list_enterprise_structures(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/structures', options)
  command.response_representation = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListStructuresResponse::Representation
  command.response_class = Google::Apis::SmartdevicemanagementV1::GoogleHomeEnterpriseSdmV1ListStructuresResponse
  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