| 1 | package Paws::IoT1ClickDevices; | ||
| 2 | use Moose; | ||
| 3 | sub service { 'devices.iot1click' } | ||
| 4 | sub signing_name { 'iot1click' } | ||
| 5 | sub version { '2018-05-14' } | ||
| 6 | sub flattened_arrays { 0 } | ||
| 7 | has max_attempts => (is => 'ro', isa => 'Int', default => 5); | ||
| 8 | has retry => (is => 'ro', isa => 'HashRef', default => sub { | ||
| 9 | { base => 'rand', type => 'exponential', growth_factor => 2 } | ||
| 10 | }); | ||
| 11 | has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [ | ||
| 12 | ] }); | ||
| 13 | |||
| 14 | with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::RestJsonCaller'; | ||
| 15 | |||
| 16 | |||
| 17 | sub ClaimDevicesByClaimCode { | ||
| 18 | my $self = shift; | ||
| 19 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::ClaimDevicesByClaimCode', @_); | ||
| 20 | return $self->caller->do_call($self, $call_object); | ||
| 21 | } | ||
| 22 | sub DescribeDevice { | ||
| 23 | my $self = shift; | ||
| 24 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::DescribeDevice', @_); | ||
| 25 | return $self->caller->do_call($self, $call_object); | ||
| 26 | } | ||
| 27 | sub FinalizeDeviceClaim { | ||
| 28 | my $self = shift; | ||
| 29 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::FinalizeDeviceClaim', @_); | ||
| 30 | return $self->caller->do_call($self, $call_object); | ||
| 31 | } | ||
| 32 | sub GetDeviceMethods { | ||
| 33 | my $self = shift; | ||
| 34 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::GetDeviceMethods', @_); | ||
| 35 | return $self->caller->do_call($self, $call_object); | ||
| 36 | } | ||
| 37 | sub InitiateDeviceClaim { | ||
| 38 | my $self = shift; | ||
| 39 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::InitiateDeviceClaim', @_); | ||
| 40 | return $self->caller->do_call($self, $call_object); | ||
| 41 | } | ||
| 42 | sub InvokeDeviceMethod { | ||
| 43 | my $self = shift; | ||
| 44 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::InvokeDeviceMethod', @_); | ||
| 45 | return $self->caller->do_call($self, $call_object); | ||
| 46 | } | ||
| 47 | sub ListDeviceEvents { | ||
| 48 | my $self = shift; | ||
| 49 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::ListDeviceEvents', @_); | ||
| 50 | return $self->caller->do_call($self, $call_object); | ||
| 51 | } | ||
| 52 | sub ListDevices { | ||
| 53 | my $self = shift; | ||
| 54 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::ListDevices', @_); | ||
| 55 | return $self->caller->do_call($self, $call_object); | ||
| 56 | } | ||
| 57 | sub ListTagsForResource { | ||
| 58 | my $self = shift; | ||
| 59 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::ListTagsForResource', @_); | ||
| 60 | return $self->caller->do_call($self, $call_object); | ||
| 61 | } | ||
| 62 | sub TagResource { | ||
| 63 | my $self = shift; | ||
| 64 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::TagResource', @_); | ||
| 65 | return $self->caller->do_call($self, $call_object); | ||
| 66 | } | ||
| 67 | sub UnclaimDevice { | ||
| 68 | my $self = shift; | ||
| 69 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::UnclaimDevice', @_); | ||
| 70 | return $self->caller->do_call($self, $call_object); | ||
| 71 | } | ||
| 72 | sub UntagResource { | ||
| 73 | my $self = shift; | ||
| 74 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::UntagResource', @_); | ||
| 75 | return $self->caller->do_call($self, $call_object); | ||
| 76 | } | ||
| 77 | sub UpdateDeviceState { | ||
| 78 | my $self = shift; | ||
| 79 | my $call_object = $self->new_with_coercions('Paws::IoT1ClickDevices::UpdateDeviceState', @_); | ||
| 80 | return $self->caller->do_call($self, $call_object); | ||
| 81 | } | ||
| 82 | |||
| 83 | sub ListAllDeviceEvents { | ||
| 84 | my $self = shift; | ||
| 85 | |||
| 86 | my $callback = shift @_ if (ref($_[0]) eq 'CODE'); | ||
| 87 | my $result = $self->ListDeviceEvents(@_); | ||
| 88 | my $next_result = $result; | ||
| 89 | |||
| 90 | if (not defined $callback) { | ||
| 91 | while ($next_result->NextToken) { | ||
| 92 | $next_result = $self->ListDeviceEvents(@_, NextToken => $next_result->NextToken); | ||
| 93 | push @{ $result->Events }, @{ $next_result->Events }; | ||
| 94 | } | ||
| 95 | return $result; | ||
| 96 | } else { | ||
| 97 | while ($result->NextToken) { | ||
| 98 | $callback->($_ => 'Events') foreach (@{ $result->Events }); | ||
| 99 | $result = $self->ListDeviceEvents(@_, NextToken => $result->NextToken); | ||
| 100 | } | ||
| 101 | $callback->($_ => 'Events') foreach (@{ $result->Events }); | ||
| 102 | } | ||
| 103 | |||
| 104 | return undef | ||
| 105 | } | ||
| 106 | sub ListAllDevices { | ||
| 107 | my $self = shift; | ||
| 108 | |||
| 109 | my $callback = shift @_ if (ref($_[0]) eq 'CODE'); | ||
| 110 | my $result = $self->ListDevices(@_); | ||
| 111 | my $next_result = $result; | ||
| 112 | |||
| 113 | if (not defined $callback) { | ||
| 114 | while ($next_result->NextToken) { | ||
| 115 | $next_result = $self->ListDevices(@_, NextToken => $next_result->NextToken); | ||
| 116 | push @{ $result->Devices }, @{ $next_result->Devices }; | ||
| 117 | } | ||
| 118 | return $result; | ||
| 119 | } else { | ||
| 120 | while ($result->NextToken) { | ||
| 121 | $callback->($_ => 'Devices') foreach (@{ $result->Devices }); | ||
| 122 | $result = $self->ListDevices(@_, NextToken => $result->NextToken); | ||
| 123 | } | ||
| 124 | $callback->($_ => 'Devices') foreach (@{ $result->Devices }); | ||
| 125 | } | ||
| 126 | |||
| 127 | return undef | ||
| 128 | } | ||
| 129 | |||
| 130 | |||
| 131 | sub operations { qw/ClaimDevicesByClaimCode DescribeDevice FinalizeDeviceClaim GetDeviceMethods InitiateDeviceClaim InvokeDeviceMethod ListDeviceEvents ListDevices ListTagsForResource TagResource UnclaimDevice UntagResource UpdateDeviceState / } | ||
| 132 | |||
| 133 | 1; | ||
| 134 | |||
| 135 | ### main pod documentation begin ### | ||
| 136 | |||
| 137 | =head1 NAME | ||
| 138 | |||
| 139 | Paws::IoT1ClickDevices - Perl Interface to AWS AWS IoT 1-Click Devices Service | ||
| 140 | |||
| 141 | =head1 SYNOPSIS | ||
| 142 | |||
| 143 | use Paws; | ||
| 144 | |||
| 145 | my $obj = Paws->service('IoT1ClickDevices'); | ||
| 146 | my $res = $obj->Method( | ||
| 147 | Arg1 => $val1, | ||
| 148 | Arg2 => [ 'V1', 'V2' ], | ||
| 149 | # if Arg3 is an object, the HashRef will be used as arguments to the constructor | ||
| 150 | # of the arguments type | ||
| 151 | Arg3 => { Att1 => 'Val1' }, | ||
| 152 | # if Arg4 is an array of objects, the HashRefs will be passed as arguments to | ||
| 153 | # the constructor of the arguments type | ||
| 154 | Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ], | ||
| 155 | ); | ||
| 156 | |||
| 157 | =head1 DESCRIPTION | ||
| 158 | |||
| 159 | Describes all of the AWS IoT 1-Click device-related API operations for | ||
| 160 | the service. Also provides sample requests, responses, and errors for | ||
| 161 | the supported web services protocols. | ||
| 162 | |||
| 163 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/devices.iot1click-2018-05-14> | ||
| 164 | |||
| 165 | |||
| 166 | =head1 METHODS | ||
| 167 | |||
| 168 | =head2 ClaimDevicesByClaimCode | ||
| 169 | |||
| 170 | =over | ||
| 171 | |||
| 172 | =item ClaimCode => Str | ||
| 173 | |||
| 174 | |||
| 175 | =back | ||
| 176 | |||
| 177 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::ClaimDevicesByClaimCode> | ||
| 178 | |||
| 179 | Returns: a L<Paws::IoT1ClickDevices::ClaimDevicesByClaimCodeResponse> instance | ||
| 180 | |||
| 181 | Adds device(s) to your account (i.e., claim one or more devices) if and | ||
| 182 | only if you received a claim code with the device(s). | ||
| 183 | |||
| 184 | |||
| 185 | =head2 DescribeDevice | ||
| 186 | |||
| 187 | =over | ||
| 188 | |||
| 189 | =item DeviceId => Str | ||
| 190 | |||
| 191 | |||
| 192 | =back | ||
| 193 | |||
| 194 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::DescribeDevice> | ||
| 195 | |||
| 196 | Returns: a L<Paws::IoT1ClickDevices::DescribeDeviceResponse> instance | ||
| 197 | |||
| 198 | Given a device ID, returns a DescribeDeviceResponse object describing | ||
| 199 | the details of the device. | ||
| 200 | |||
| 201 | |||
| 202 | =head2 FinalizeDeviceClaim | ||
| 203 | |||
| 204 | =over | ||
| 205 | |||
| 206 | =item DeviceId => Str | ||
| 207 | |||
| 208 | =item [Tags => L<Paws::IoT1ClickDevices::__mapOf__string>] | ||
| 209 | |||
| 210 | |||
| 211 | =back | ||
| 212 | |||
| 213 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::FinalizeDeviceClaim> | ||
| 214 | |||
| 215 | Returns: a L<Paws::IoT1ClickDevices::FinalizeDeviceClaimResponse> instance | ||
| 216 | |||
| 217 | Given a device ID, finalizes the claim request for the associated | ||
| 218 | device. | ||
| 219 | |||
| 220 | Claiming a device consists of initiating a claim, then publishing a | ||
| 221 | device event, and finalizing the claim. For a device of type button, a | ||
| 222 | device event can be published by simply clicking the device. | ||
| 223 | |||
| 224 | |||
| 225 | =head2 GetDeviceMethods | ||
| 226 | |||
| 227 | =over | ||
| 228 | |||
| 229 | =item DeviceId => Str | ||
| 230 | |||
| 231 | |||
| 232 | =back | ||
| 233 | |||
| 234 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::GetDeviceMethods> | ||
| 235 | |||
| 236 | Returns: a L<Paws::IoT1ClickDevices::GetDeviceMethodsResponse> instance | ||
| 237 | |||
| 238 | Given a device ID, returns the invokable methods associated with the | ||
| 239 | device. | ||
| 240 | |||
| 241 | |||
| 242 | =head2 InitiateDeviceClaim | ||
| 243 | |||
| 244 | =over | ||
| 245 | |||
| 246 | =item DeviceId => Str | ||
| 247 | |||
| 248 | |||
| 249 | =back | ||
| 250 | |||
| 251 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::InitiateDeviceClaim> | ||
| 252 | |||
| 253 | Returns: a L<Paws::IoT1ClickDevices::InitiateDeviceClaimResponse> instance | ||
| 254 | |||
| 255 | Given a device ID, initiates a claim request for the associated device. | ||
| 256 | |||
| 257 | Claiming a device consists of initiating a claim, then publishing a | ||
| 258 | device event, and finalizing the claim. For a device of type button, a | ||
| 259 | device event can be published by simply clicking the device. | ||
| 260 | |||
| 261 | |||
| 262 | =head2 InvokeDeviceMethod | ||
| 263 | |||
| 264 | =over | ||
| 265 | |||
| 266 | =item DeviceId => Str | ||
| 267 | |||
| 268 | =item [DeviceMethod => L<Paws::IoT1ClickDevices::DeviceMethod>] | ||
| 269 | |||
| 270 | =item [DeviceMethodParameters => Str] | ||
| 271 | |||
| 272 | |||
| 273 | =back | ||
| 274 | |||
| 275 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::InvokeDeviceMethod> | ||
| 276 | |||
| 277 | Returns: a L<Paws::IoT1ClickDevices::InvokeDeviceMethodResponse> instance | ||
| 278 | |||
| 279 | Given a device ID, issues a request to invoke a named device method | ||
| 280 | (with possible parameters). See the "Example POST" code snippet below. | ||
| 281 | |||
| 282 | |||
| 283 | =head2 ListDeviceEvents | ||
| 284 | |||
| 285 | =over | ||
| 286 | |||
| 287 | =item DeviceId => Str | ||
| 288 | |||
| 289 | =item FromTimeStamp => Str | ||
| 290 | |||
| 291 | =item ToTimeStamp => Str | ||
| 292 | |||
| 293 | =item [MaxResults => Int] | ||
| 294 | |||
| 295 | =item [NextToken => Str] | ||
| 296 | |||
| 297 | |||
| 298 | =back | ||
| 299 | |||
| 300 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::ListDeviceEvents> | ||
| 301 | |||
| 302 | Returns: a L<Paws::IoT1ClickDevices::ListDeviceEventsResponse> instance | ||
| 303 | |||
| 304 | Using a device ID, returns a DeviceEventsResponse object containing an | ||
| 305 | array of events for the device. | ||
| 306 | |||
| 307 | |||
| 308 | =head2 ListDevices | ||
| 309 | |||
| 310 | =over | ||
| 311 | |||
| 312 | =item [DeviceType => Str] | ||
| 313 | |||
| 314 | =item [MaxResults => Int] | ||
| 315 | |||
| 316 | =item [NextToken => Str] | ||
| 317 | |||
| 318 | |||
| 319 | =back | ||
| 320 | |||
| 321 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::ListDevices> | ||
| 322 | |||
| 323 | Returns: a L<Paws::IoT1ClickDevices::ListDevicesResponse> instance | ||
| 324 | |||
| 325 | Lists the 1-Click compatible devices associated with your AWS account. | ||
| 326 | |||
| 327 | |||
| 328 | =head2 ListTagsForResource | ||
| 329 | |||
| 330 | =over | ||
| 331 | |||
| 332 | =item ResourceArn => Str | ||
| 333 | |||
| 334 | |||
| 335 | =back | ||
| 336 | |||
| 337 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::ListTagsForResource> | ||
| 338 | |||
| 339 | Returns: a L<Paws::IoT1ClickDevices::ListTagsForResourceResponse> instance | ||
| 340 | |||
| 341 | Lists the tags associated with the specified resource ARN. | ||
| 342 | |||
| 343 | |||
| 344 | =head2 TagResource | ||
| 345 | |||
| 346 | =over | ||
| 347 | |||
| 348 | =item ResourceArn => Str | ||
| 349 | |||
| 350 | =item Tags => L<Paws::IoT1ClickDevices::__mapOf__string> | ||
| 351 | |||
| 352 | |||
| 353 | =back | ||
| 354 | |||
| 355 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::TagResource> | ||
| 356 | |||
| 357 | Returns: nothing | ||
| 358 | |||
| 359 | Adds or updates the tags associated with the resource ARN. See AWS IoT | ||
| 360 | 1-Click Service Limits | ||
| 361 | (https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-appendix.html#1click-limits) | ||
| 362 | for the maximum number of tags allowed per resource. | ||
| 363 | |||
| 364 | |||
| 365 | =head2 UnclaimDevice | ||
| 366 | |||
| 367 | =over | ||
| 368 | |||
| 369 | =item DeviceId => Str | ||
| 370 | |||
| 371 | |||
| 372 | =back | ||
| 373 | |||
| 374 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::UnclaimDevice> | ||
| 375 | |||
| 376 | Returns: a L<Paws::IoT1ClickDevices::UnclaimDeviceResponse> instance | ||
| 377 | |||
| 378 | Disassociates a device from your AWS account using its device ID. | ||
| 379 | |||
| 380 | |||
| 381 | =head2 UntagResource | ||
| 382 | |||
| 383 | =over | ||
| 384 | |||
| 385 | =item ResourceArn => Str | ||
| 386 | |||
| 387 | =item TagKeys => ArrayRef[Str|Undef] | ||
| 388 | |||
| 389 | |||
| 390 | =back | ||
| 391 | |||
| 392 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::UntagResource> | ||
| 393 | |||
| 394 | Returns: nothing | ||
| 395 | |||
| 396 | Using tag keys, deletes the tags (key/value pairs) associated with the | ||
| 397 | specified resource ARN. | ||
| 398 | |||
| 399 | |||
| 400 | =head2 UpdateDeviceState | ||
| 401 | |||
| 402 | =over | ||
| 403 | |||
| 404 | =item DeviceId => Str | ||
| 405 | |||
| 406 | =item [Enabled => Bool] | ||
| 407 | |||
| 408 | |||
| 409 | =back | ||
| 410 | |||
| 411 | Each argument is described in detail in: L<Paws::IoT1ClickDevices::UpdateDeviceState> | ||
| 412 | |||
| 413 | Returns: a L<Paws::IoT1ClickDevices::UpdateDeviceStateResponse> instance | ||
| 414 | |||
| 415 | Using a Boolean value (true or false), this operation enables or | ||
| 416 | disables the device given a device ID. | ||
| 417 | |||
| 418 | |||
| 419 | |||
| 420 | |||
| 421 | =head1 PAGINATORS | ||
| 422 | |||
| 423 | Paginator methods are helpers that repetively call methods that return partial results | ||
| 424 | |||
| 425 | =head2 ListAllDeviceEvents(sub { },DeviceId => Str, FromTimeStamp => Str, ToTimeStamp => Str, [MaxResults => Int, NextToken => Str]) | ||
| 426 | |||
| 427 | =head2 ListAllDeviceEvents(DeviceId => Str, FromTimeStamp => Str, ToTimeStamp => Str, [MaxResults => Int, NextToken => Str]) | ||
| 428 | |||
| 429 | |||
| 430 | If passed a sub as first parameter, it will call the sub for each element found in : | ||
| 431 | |||
| 432 | - Events, passing the object as the first parameter, and the string 'Events' as the second parameter | ||
| 433 | |||
| 434 | If not, it will return a a L<Paws::IoT1ClickDevices::ListDeviceEventsResponse> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory. | ||
| 435 | |||
| 436 | |||
| 437 | =head2 ListAllDevices(sub { },[DeviceType => Str, MaxResults => Int, NextToken => Str]) | ||
| 438 | |||
| 439 | =head2 ListAllDevices([DeviceType => Str, MaxResults => Int, NextToken => Str]) | ||
| 440 | |||
| 441 | |||
| 442 | If passed a sub as first parameter, it will call the sub for each element found in : | ||
| 443 | |||
| 444 | - Devices, passing the object as the first parameter, and the string 'Devices' as the second parameter | ||
| 445 | |||
| 446 | If not, it will return a a L<Paws::IoT1ClickDevices::ListDevicesResponse> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory. | ||
| 447 | |||
| 448 | |||
| 449 | |||
| 450 | |||
| 451 | |||
| 452 | =head1 SEE ALSO | ||
| 453 | |||
| 454 | This service class forms part of L<Paws> | ||
| 455 | |||
| 456 | =head1 BUGS and CONTRIBUTIONS | ||
| 457 | |||
| 458 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 459 | |||
| 460 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 461 | |||
| 462 | =cut | ||
| 463 |