You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::IoTDataPlane::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-iotdataplane/lib/aws-sdk-iotdataplane/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



142
143
144
# File 'gems/aws-sdk-iotdataplane/lib/aws-sdk-iotdataplane/client.rb', line 142

def initialize(*args)
  super
end

Instance Method Details

#delete_thing_shadow(params = {}) ⇒ Types::DeleteThingShadowResponse

Deletes the thing shadow for the specified thing.

For more information, see DeleteThingShadow in the AWS IoT Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.delete_thing_shadow({
  thing_name: "ThingName", # required
})

Response structure


resp.payload #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the thing.

Returns:



176
177
178
179
# File 'gems/aws-sdk-iotdataplane/lib/aws-sdk-iotdataplane/client.rb', line 176

def delete_thing_shadow(params = {}, options = {})
  req = build_request(:delete_thing_shadow, params)
  req.send_request(options)
end

#get_thing_shadow(params = {}) ⇒ Types::GetThingShadowResponse

Gets the thing shadow for the specified thing.

For more information, see GetThingShadow in the AWS IoT Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.get_thing_shadow({
  thing_name: "ThingName", # required
})

Response structure


resp.payload #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the thing.

Returns:



209
210
211
212
# File 'gems/aws-sdk-iotdataplane/lib/aws-sdk-iotdataplane/client.rb', line 209

def get_thing_shadow(params = {}, options = {})
  req = build_request(:get_thing_shadow, params)
  req.send_request(options)
end

#publish(params = {}) ⇒ Struct

Publishes state information.

For more information, see HTTP Protocol in the AWS IoT Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.publish({
  topic: "Topic", # required
  qos: 1,
  payload: "data",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :topic (required, String)

    The name of the MQTT topic.

  • :qos (Integer)

    The Quality of Service (QoS) level.

  • :payload (String, IO)

    The state information, in JSON format.

Returns:

  • (Struct)

    Returns an empty response.



244
245
246
247
# File 'gems/aws-sdk-iotdataplane/lib/aws-sdk-iotdataplane/client.rb', line 244

def publish(params = {}, options = {})
  req = build_request(:publish, params)
  req.send_request(options)
end

#update_thing_shadow(params = {}) ⇒ Types::UpdateThingShadowResponse

Updates the thing shadow for the specified thing.

For more information, see UpdateThingShadow in the AWS IoT Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.update_thing_shadow({
  thing_name: "ThingName", # required
  payload: "data", # required
})

Response structure


resp.payload #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the thing.

  • :payload (required, String, IO)

    The state information, in JSON format.

Returns:



281
282
283
284
# File 'gems/aws-sdk-iotdataplane/lib/aws-sdk-iotdataplane/client.rb', line 281

def update_thing_shadow(params = {}, options = {})
  req = build_request(:update_thing_shadow, params)
  req.send_request(options)
end