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

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/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:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://smartdevicemanagement.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSmartDeviceManagementService

Returns a new instance of SmartDeviceManagementService.



48
49
50
51
52
53
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-smartdevicemanagement_v1',
        client_version: Google::Apis::SmartdevicemanagementV1::GEM_VERSION)
  @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.



41
42
43
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 41

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.



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

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



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 76

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



108
109
110
111
112
113
114
115
116
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 108

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



173
174
175
176
177
178
179
180
181
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 173

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



237
238
239
240
241
242
243
244
245
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 237

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, 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'

  • 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



141
142
143
144
145
146
147
148
149
150
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 141

def list_enterprise_devices(parent, filter: 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['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, 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".

  • 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



268
269
270
271
272
273
274
275
276
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 268

def list_enterprise_structure_rooms(parent, 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['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, 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.

  • 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



205
206
207
208
209
210
211
212
213
214
# File 'lib/google/apis/smartdevicemanagement_v1/service.rb', line 205

def list_enterprise_structures(parent, filter: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end