From 4ddaaf73146f02d487013213377659c58c9968d4 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Wed, 1 Jun 2016 09:36:42 +0200 Subject: [PATCH 01/52] Fix deps conflict --- Godeps/Godeps.json | 1554 +++++ .../aws/aws-sdk-go/service/iot/api.go | 5368 +++++++++++++++++ .../aws/aws-sdk-go/service/iot/service.go | 94 + 3 files changed, 7016 insertions(+) create mode 100644 Godeps/Godeps.json create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iot/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/iot/service.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json new file mode 100644 index 000000000000..40e9bb18db11 --- /dev/null +++ b/Godeps/Godeps.json @@ -0,0 +1,1554 @@ +{ + "ImportPath": "github.com/hashicorp/terraform", + "GoVersion": "go1.6", + "GodepVersion": "v71", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/azure", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/date", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest/to", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/dgrijalva/jwt-go", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/pkcs12", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/golang.org/x/crypto/pkcs12/internal/rc2", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/cdn", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/compute", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/network", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/resources/resources", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/scheduler", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/storage", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/core/http", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/core/tls", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/affinitygroup", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/hostedservice", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/location", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/networksecuritygroup", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/osimage", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/sql", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/storageservice", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualmachine", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualmachinedisk", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualmachineimage", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/virtualnetwork", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/management/vmutils", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/Azure/azure-sdk-for-go/storage", + "Comment": "v1.2-315-g1cb9dff", + "Rev": "1cb9dff8c37b2918ad1ebd7b294d01100a153d27" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/aa", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/alert", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/api", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/dc", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/group", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/lb", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/server", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/status", + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" + }, + { + "ImportPath": "github.com/DreamItGetIT/statuscake", + "Rev": "8cbe86575f00210a6df2c19cb2f59b00cd181de3" + }, + { + "ImportPath": "github.com/Ensighten/udnssdk", + "Rev": "0290933f5e8afd933f2823fce32bf2847e6ea603" + }, + { + "ImportPath": "github.com/Unknwon/com", + "Rev": "28b053d5a2923b87ce8c5a08f3af779894a72758" + }, + { + "ImportPath": "github.com/Unknwon/macaron", + "Rev": "9b82b0372a4edf52f66fbc8feaa6aafe0123001d" + }, + { + "ImportPath": "github.com/Unknwon/macaron/inject", + "Rev": "9b82b0372a4edf52f66fbc8feaa6aafe0123001d" + }, + { + "ImportPath": "github.com/ajg/form", + "Rev": "c9e1c3ae1f869d211cdaa085d23c6af2f5f83866" + }, + { + "ImportPath": "github.com/apparentlymart/go-cidr/cidr", + "Rev": "a3ebdb999b831ecb6ab8a226e31b07b2b9061c47" + }, + { + "ImportPath": "github.com/apparentlymart/go-grafana-api", + "Rev": "d49f95c81c580a4e7a15244b9b12dce8f60750f4" + }, + { + "ImportPath": "github.com/apparentlymart/go-rundeck-api/rundeck", + "Comment": "v0.0.1-1-g43fcd8f", + "Rev": "43fcd8fbcf18fd5929258c044b4e3dd0643f875e" + }, + { + "ImportPath": "github.com/armon/circbuf", + "Rev": "bbbad097214e2918d8543d5201d12bfd7bca254d" + }, + { + "ImportPath": "github.com/armon/go-radix", + "Rev": "4239b77079c7b5d1243b7b4736304ce8ddb6f0f2" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/awserr", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/client", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/credentials", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/defaults", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/request", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/session", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/endpoints", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/restjson", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/restxml", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/waiter", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/apigateway", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/autoscaling", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/cloudformation", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/cloudfront", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/cloudtrail", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatch", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatchevents", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatchlogs", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/codecommit", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/codedeploy", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/directoryservice", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/dynamodb", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/ec2", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/ecr", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/ecs", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/efs", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/elasticache", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/elasticbeanstalk", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/elasticsearchservice", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/elb", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/emr", + "Comment": "v1.1.15", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/emr/emriface", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/firehose", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/glacier", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/iam", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/iot", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/kinesis", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/kms", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/lambda", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/opsworks", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/rds", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/redshift", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/route53", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/s3", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/sns", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/sqs", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/sts", + "Comment": "v1.1.23", + "Rev": "2cc71659118a868dc7544a7ef0808eb42d487011" + }, + { + "ImportPath": "github.com/bgentry/speakeasy", + "Rev": "36e9cfdd690967f4f690c6edcc9ffacd006014a0" + }, + { + "ImportPath": "github.com/cenkalti/backoff", + "Rev": "4dc77674aceaabba2c7e3da25d4c823edfb73f99" + }, + { + "ImportPath": "github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec", + "Comment": "v2.3.0-alpha.0-652-ge552791", + "Rev": "e5527914aa42cae3063f52892e1ca4518da0e4ae" + }, + { + "ImportPath": "github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context", + "Comment": "v2.3.0-alpha.0-652-ge552791", + "Rev": "e5527914aa42cae3063f52892e1ca4518da0e4ae" + }, + { + "ImportPath": "github.com/coreos/etcd/client", + "Comment": "v2.3.0-alpha.0-652-ge552791", + "Rev": "e5527914aa42cae3063f52892e1ca4518da0e4ae" + }, + { + "ImportPath": "github.com/coreos/etcd/pkg/pathutil", + "Comment": "v2.3.0-alpha.0-652-ge552791", + "Rev": "e5527914aa42cae3063f52892e1ca4518da0e4ae" + }, + { + "ImportPath": "github.com/coreos/etcd/pkg/types", + "Comment": "v2.3.0-alpha.0-652-ge552791", + "Rev": "e5527914aa42cae3063f52892e1ca4518da0e4ae" + }, + { + "ImportPath": "github.com/cyberdelia/heroku-go/v3", + "Rev": "81c5afa1abcf69cc18ccc24fa3716b5a455c9208" + }, + { + "ImportPath": "github.com/davecgh/go-spew/spew", + "Rev": "5215b55f46b2b919f50a1df0eaa5886afe4e3b3d" + }, + { + "ImportPath": "github.com/digitalocean/godo", + "Comment": "v0.9.0-20-gf75d769", + "Rev": "f75d769b07edce8a73682dcf325b4404f366ab3d" + }, + { + "ImportPath": "github.com/dylanmei/iso8601", + "Rev": "2075bf119b58e5576c6ed9f867b8f3d17f2e54d4" + }, + { + "ImportPath": "github.com/dylanmei/winrmtest", + "Rev": "025617847eb2cf9bd1d851bc3b22ed28e6245ce5" + }, + { + "ImportPath": "github.com/fatih/structs", + "Rev": "73c4e3dc02a78deaba8640d5f3a8c236ec1352bf" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/go-units", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/net/context", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/go-chef/chef", + "Comment": "0.0.1-42-gea19666", + "Rev": "ea196660dd8700ad18911681b223fe6bfc29cd69" + }, + { + "ImportPath": "github.com/go-ini/ini", + "Comment": "v1.8.6", + "Rev": "afbd495e5aaea13597b5e14fe514ddeaa4d76fc3" + }, + { + "ImportPath": "github.com/golang/protobuf/proto", + "Rev": "34a5f244f1c01cdfee8e60324258cfbb97a42aec" + }, + { + "ImportPath": "github.com/google/go-github/github", + "Rev": "ac4445ca1c9dfacf5c0bbf34b712b23a3bb59b6c" + }, + { + "ImportPath": "github.com/google/go-querystring/query", + "Rev": "2a60fc2ba6c19de80291203597d752e9ba58e4c0" + }, + { + "ImportPath": "github.com/gosimple/slug", + "Rev": "ea39c588e0a5b1064e0f98d7307e6c2f286f32e8" + }, + { + "ImportPath": "github.com/grafana/grafana/pkg/api/dtos", + "Comment": "v2.6.0-179-gc0cf0cb", + "Rev": "c0cf0cb802adad24252ce1307c4c896edd566870" + }, + { + "ImportPath": "github.com/grafana/grafana/pkg/log", + "Comment": "v2.6.0-179-gc0cf0cb", + "Rev": "c0cf0cb802adad24252ce1307c4c896edd566870" + }, + { + "ImportPath": "github.com/grafana/grafana/pkg/models", + "Comment": "v2.6.0-179-gc0cf0cb", + "Rev": "c0cf0cb802adad24252ce1307c4c896edd566870" + }, + { + "ImportPath": "github.com/grafana/grafana/pkg/setting", + "Comment": "v2.6.0-179-gc0cf0cb", + "Rev": "c0cf0cb802adad24252ce1307c4c896edd566870" + }, + { + "ImportPath": "github.com/grafana/grafana/pkg/util", + "Comment": "v2.6.0-179-gc0cf0cb", + "Rev": "c0cf0cb802adad24252ce1307c4c896edd566870" + }, + { + "ImportPath": "github.com/hashicorp/atlas-go/archive", + "Comment": "20141209094003-92-g95fa852", + "Rev": "95fa852edca41c06c4ce526af4bb7dec4eaad434" + }, + { + "ImportPath": "github.com/hashicorp/atlas-go/v1", + "Comment": "20141209094003-92-g95fa852", + "Rev": "95fa852edca41c06c4ce526af4bb7dec4eaad434" + }, + { + "ImportPath": "github.com/hashicorp/consul/api", + "Comment": "v0.6.3-28-g3215b87", + "Rev": "3215b8727f44c778dd7045dcfd5ac42735c581a9" + }, + { + "ImportPath": "github.com/hashicorp/errwrap", + "Rev": "7554cd9344cec97297fa6649b055a8c98c2a1e55" + }, + { + "ImportPath": "github.com/hashicorp/go-checkpoint", + "Rev": "e4b2dc34c0f698ee04750bf2035d8b9384233e1b" + }, + { + "ImportPath": "github.com/hashicorp/go-cleanhttp", + "Rev": "875fb671b3ddc66f8e2f0acc33829c8cb989a38d" + }, + { + "ImportPath": "github.com/hashicorp/go-getter", + "Rev": "2822987a64e0df1236ac29dd277ddf79f4871f9a" + }, + { + "ImportPath": "github.com/hashicorp/go-getter/helper/url", + "Rev": "2822987a64e0df1236ac29dd277ddf79f4871f9a" + }, + { + "ImportPath": "github.com/hashicorp/go-multierror", + "Rev": "d30f09973e19c1dfcd120b2d9c4f168e68d6b5d5" + }, + { + "ImportPath": "github.com/hashicorp/go-plugin", + "Rev": "cccb4a1328abbb89898f3ecf4311a05bddc4de6d" + }, + { + "ImportPath": "github.com/hashicorp/go-retryablehttp", + "Rev": "5ec125ef739293cb4d57c3456dd92ba9af29ed6e" + }, + { + "ImportPath": "github.com/hashicorp/go-rootcerts", + "Rev": "6bb64b370b90e7ef1fa532be9e591a81c3493e00" + }, + { + "ImportPath": "github.com/hashicorp/go-uuid", + "Rev": "36289988d83ca270bc07c234c36f364b0dd9c9a7" + }, + { + "ImportPath": "github.com/hashicorp/go-version", + "Rev": "7e3c02b30806fa5779d3bdfc152ce4c6f40e7b38" + }, + { + "ImportPath": "github.com/hashicorp/hcl", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/ast", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/fmtcmd", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/parser", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/printer", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/scanner", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/strconv", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/hcl/token", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/json/parser", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/json/scanner", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hcl/json/token", + "Rev": "9a905a34e6280ce905da1a32344b25e81011197a" + }, + { + "ImportPath": "github.com/hashicorp/hil", + "Rev": "01dc167cd239b7ccab78a683b866536cd5904719" + }, + { + "ImportPath": "github.com/hashicorp/hil/ast", + "Rev": "01dc167cd239b7ccab78a683b866536cd5904719" + }, + { + "ImportPath": "github.com/hashicorp/logutils", + "Rev": "0dc08b1671f34c4250ce212759ebd880f743d883" + }, + { + "ImportPath": "github.com/hashicorp/serf/coordinate", + "Comment": "v0.7.0-12-ge4ec8cc", + "Rev": "e4ec8cc423bbe20d26584b96efbeb9102e16d05f" + }, + { + "ImportPath": "github.com/hashicorp/yamux", + "Rev": "df949784da9ed028ee76df44652e42d37a09d7e4" + }, + { + "ImportPath": "github.com/henrikhodne/go-librato/librato", + "Rev": "613abdebf4922c4d9d46bcb4bcf14ee18c08d7de" + }, + { + "ImportPath": "github.com/hmrc/vmware-govcd", + "Comment": "v0.0.2-37-g5cd82f0", + "Rev": "5cd82f01aa1c97afa9b23ef6f4f42a60f3106003" + }, + { + "ImportPath": "github.com/hmrc/vmware-govcd/types/v56", + "Comment": "v0.0.2-37-g5cd82f0", + "Rev": "5cd82f01aa1c97afa9b23ef6f4f42a60f3106003" + }, + { + "ImportPath": "github.com/imdario/mergo", + "Comment": "0.2.1-3-gb1859b1", + "Rev": "b1859b199a7171589445bdea9fa8c19362613f80" + }, + { + "ImportPath": "github.com/influxdata/influxdb/client", + "Comment": "v0.10.0-617-gf233a8b", + "Rev": "f233a8bac88d1f2dc282a98186f5a3363b806181" + }, + { + "ImportPath": "github.com/influxdata/influxdb/models", + "Comment": "v0.10.0-617-gf233a8b", + "Rev": "f233a8bac88d1f2dc282a98186f5a3363b806181" + }, + { + "ImportPath": "github.com/influxdata/influxdb/pkg/escape", + "Comment": "v0.10.0-617-gf233a8b", + "Rev": "f233a8bac88d1f2dc282a98186f5a3363b806181" + }, + { + "ImportPath": "github.com/jen20/riviera/azure", + "Rev": "70dac624f9d3e37295dfa4012040106e5f7b1add" + }, + { + "ImportPath": "github.com/jen20/riviera/dns", + "Rev": "70dac624f9d3e37295dfa4012040106e5f7b1add" + }, + { + "ImportPath": "github.com/jen20/riviera/search", + "Rev": "70dac624f9d3e37295dfa4012040106e5f7b1add" + }, + { + "ImportPath": "github.com/jen20/riviera/sql", + "Rev": "70dac624f9d3e37295dfa4012040106e5f7b1add" + }, + { + "ImportPath": "github.com/jmespath/go-jmespath", + "Comment": "0.2.2-2-gc01cf91", + "Rev": "c01cf91b011868172fdcd9f41838e80c9d716264" + }, + { + "ImportPath": "github.com/joyent/gocommon", + "Rev": "ade826b8b54e81a779ccb29d358a45ba24b7809c" + }, + { + "ImportPath": "github.com/joyent/gocommon/client", + "Rev": "ade826b8b54e81a779ccb29d358a45ba24b7809c" + }, + { + "ImportPath": "github.com/joyent/gocommon/errors", + "Rev": "ade826b8b54e81a779ccb29d358a45ba24b7809c" + }, + { + "ImportPath": "github.com/joyent/gocommon/http", + "Rev": "ade826b8b54e81a779ccb29d358a45ba24b7809c" + }, + { + "ImportPath": "github.com/joyent/gocommon/jpc", + "Rev": "ade826b8b54e81a779ccb29d358a45ba24b7809c" + }, + { + "ImportPath": "github.com/joyent/gosdc/cloudapi", + "Rev": "0697a5c4f39a71a4f9e3b154380b47dbfcc3da6e" + }, + { + "ImportPath": "github.com/joyent/gosign/auth", + "Rev": "a1f3aa7d52213987117e47d721bcc9a499994d5f" + }, + { + "ImportPath": "github.com/jtopjian/cobblerclient", + "Comment": "v0.3.0-33-g53d1c0a", + "Rev": "53d1c0a0b003aabfa7ecfa848d856606cb481196" + }, + { + "ImportPath": "github.com/kardianos/osext", + "Rev": "29ae4ffbc9a6fe9fb2bc5029050ce6996ea1d3bc" + }, + { + "ImportPath": "github.com/kolo/xmlrpc", + "Rev": "0826b98aaa29c0766956cb40d45cf7482a597671" + }, + { + "ImportPath": "github.com/lib/pq", + "Comment": "go1.0-cutoff-74-g8ad2b29", + "Rev": "8ad2b298cadd691a77015666a5372eae5dbfac8f" + }, + { + "ImportPath": "github.com/lib/pq/oid", + "Comment": "go1.0-cutoff-74-g8ad2b29", + "Rev": "8ad2b298cadd691a77015666a5372eae5dbfac8f" + }, + { + "ImportPath": "github.com/lusis/go-artifactory/src/artifactory.v401", + "Rev": "7e4ce345df825841661d1b3ffbb1327083d4a22f" + }, + { + "ImportPath": "github.com/macaron-contrib/session", + "Rev": "d392059301313eee8059c85a4e698f22c664ef78" + }, + { + "ImportPath": "github.com/masterzen/simplexml/dom", + "Rev": "95ba30457eb1121fa27753627c774c7cd4e90083" + }, + { + "ImportPath": "github.com/masterzen/winrm/soap", + "Rev": "54ea5d01478cfc2afccec1504bd0dfcd8c260cfa" + }, + { + "ImportPath": "github.com/masterzen/winrm/winrm", + "Rev": "54ea5d01478cfc2afccec1504bd0dfcd8c260cfa" + }, + { + "ImportPath": "github.com/masterzen/xmlpath", + "Rev": "13f4951698adc0fa9c1dda3e275d489a24201161" + }, + { + "ImportPath": "github.com/mattn/go-colorable", + "Rev": "9cbef7c35391cca05f15f8181dc0b18bc9736dbb" + }, + { + "ImportPath": "github.com/mattn/go-isatty", + "Rev": "56b76bdf51f7708750eac80fa38b952bb9f32639" + }, + { + "ImportPath": "github.com/maximilien/softlayer-go/client", + "Comment": "v0.6.0", + "Rev": "85659debe44fab5792fc92cf755c04b115b9dc19" + }, + { + "ImportPath": "github.com/maximilien/softlayer-go/common", + "Comment": "v0.6.0", + "Rev": "85659debe44fab5792fc92cf755c04b115b9dc19" + }, + { + "ImportPath": "github.com/maximilien/softlayer-go/data_types", + "Comment": "v0.6.0", + "Rev": "85659debe44fab5792fc92cf755c04b115b9dc19" + }, + { + "ImportPath": "github.com/maximilien/softlayer-go/services", + "Comment": "v0.6.0", + "Rev": "85659debe44fab5792fc92cf755c04b115b9dc19" + }, + { + "ImportPath": "github.com/maximilien/softlayer-go/softlayer", + "Comment": "v0.6.0", + "Rev": "85659debe44fab5792fc92cf755c04b115b9dc19" + }, + { + "ImportPath": "github.com/mitchellh/cli", + "Rev": "83f97d41cf100ee5f33944a8815c167d5e4aa272" + }, + { + "ImportPath": "github.com/mitchellh/cloudflare-go", + "Rev": "84c7a0993a06d555dbfddd2b32f5fa9b92fa1dc1" + }, + { + "ImportPath": "github.com/mitchellh/colorstring", + "Rev": "8631ce90f28644f54aeedcb3e389a85174e067d1" + }, + { + "ImportPath": "github.com/mitchellh/copystructure", + "Rev": "80adcec1955ee4e97af357c30dee61aadcc02c10" + }, + { + "ImportPath": "github.com/mitchellh/go-homedir", + "Rev": "d682a8f0cf139663a984ff12528da460ca963de9" + }, + { + "ImportPath": "github.com/mitchellh/go-linereader", + "Rev": "07bab5fdd9580500aea6ada0e09df4aa28e68abd" + }, + { + "ImportPath": "github.com/mitchellh/hashstructure", + "Rev": "6b17d669fac5e2f71c16658d781ec3fdd3802b69" + }, + { + "ImportPath": "github.com/mitchellh/mapstructure", + "Rev": "281073eb9eb092240d33ef253c404f1cca550309" + }, + { + "ImportPath": "github.com/mitchellh/packer/common/uuid", + "Comment": "v0.8.6-411-g314aad3", + "Rev": "314aad379a39f6ad5bcca278e6757d9abbb3a52e" + }, + { + "ImportPath": "github.com/mitchellh/panicwrap", + "Rev": "a1e50bc201f387747a45ffff020f1af2d8759e88" + }, + { + "ImportPath": "github.com/mitchellh/prefixedio", + "Rev": "6e6954073784f7ee67b28f2d22749d6479151ed7" + }, + { + "ImportPath": "github.com/mitchellh/reflectwalk", + "Rev": "eecf4c70c626c7cfbb95c90195bc34d386c74ac6" + }, + { + "ImportPath": "github.com/nesv/go-dynect/dynect", + "Comment": "v0.2.0-8-g841842b", + "Rev": "841842b16b39cf2b5007278956976d7d909bd98b" + }, + { + "ImportPath": "github.com/nu7hatch/gouuid", + "Rev": "179d4d0c4d8d407a32af483c2354df1d2c91e6c3" + }, + { + "ImportPath": "github.com/packer-community/winrmcp/winrmcp", + "Rev": "3d184cea22ee1c41ec1697e0d830ff0c78f7ea97" + }, + { + "ImportPath": "github.com/packethost/packngo", + "Rev": "f03d7dc788a8b57b62d301ccb98c950c325756f8" + }, + { + "ImportPath": "github.com/pborman/uuid", + "Rev": "dee7705ef7b324f27ceb85a121c61f2c2e8ce988" + }, + { + "ImportPath": "github.com/pearkes/dnsimple", + "Rev": "78996265f576c7580ff75d0cb2c606a61883ceb8" + }, + { + "ImportPath": "github.com/pearkes/mailgun", + "Rev": "b88605989c4141d22a6d874f78800399e5bb7ac2" + }, + { + "ImportPath": "github.com/pkg/errors", + "Comment": "v0.3.0", + "Rev": "42fa80f2ac6ed17a977ce826074bd3009593fa9d" + }, + { + "ImportPath": "github.com/rackspace/gophercloud", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/blockstorage/v2/volumes", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/flavors", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/images", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/servers", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v2/tenants", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v2/tokens", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v3/tokens", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/floatingips", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/members", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/monitors", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/vips", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/groups", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/security/rules", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/networks", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/ports", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/subnets", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/utils", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/pagination", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/testhelper", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/testhelper/client", + "Comment": "v1.0.0-905-gadc2065", + "Rev": "adc206589ed49d18cecc9890ab93534704b04702" + }, + { + "ImportPath": "github.com/rainycape/unidecode", + "Rev": "cb7f23ec59bec0d61b19c56cd88cee3d0cc1870c" + }, + { + "ImportPath": "github.com/satori/go.uuid", + "Rev": "d41af8bb6a7704f00bc3b7cba9355ae6a5a80048" + }, + { + "ImportPath": "github.com/sethvargo/go-fastly", + "Rev": "6566b161e807516f4a45bc3054eac291a120e217" + }, + { + "ImportPath": "github.com/soniah/dnsmadeeasy", + "Comment": "v1.1-2-g5578a8c", + "Rev": "5578a8c15e33958c61cf7db720b6181af65f4a9e" + }, + { + "ImportPath": "github.com/sthulb/mime/multipart", + "Rev": "698462dc9685d7743511c26da726c1b0c1cfb111" + }, + { + "ImportPath": "github.com/tent/http-link-go", + "Rev": "ac974c61c2f990f4115b119354b5e0b47550e888" + }, + { + "ImportPath": "github.com/vmware/govmomi", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/find", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/list", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/object", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/property", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/session", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/task", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/debug", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/methods", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/mo", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/progress", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/soap", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/types", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/xml", + "Comment": "v0.6.2", + "Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a" + }, + { + "ImportPath": "github.com/xanzy/go-cloudstack/cloudstack", + "Comment": "2.0.0-6-g5686bcd", + "Rev": "5686bcde5af20565d8c7a3f66b5441430ac54186" + }, + { + "ImportPath": "github.com/xanzy/ssh-agent", + "Rev": "ba9c9e33906f58169366275e3450db66139a31a9" + }, + { + "ImportPath": "github.com/ziutek/mymysql/mysql", + "Comment": "v1.5.4-13-g75ce5fb", + "Rev": "75ce5fbba34b1912a3641adbd58cf317d7315821" + }, + { + "ImportPath": "github.com/ziutek/mymysql/native", + "Comment": "v1.5.4-13-g75ce5fb", + "Rev": "75ce5fbba34b1912a3641adbd58cf317d7315821" + }, + { + "ImportPath": "github.com/ziutek/mymysql/thrsafe", + "Comment": "v1.5.4-13-g75ce5fb", + "Rev": "75ce5fbba34b1912a3641adbd58cf317d7315821" + }, + { + "ImportPath": "github.com/zorkian/go-datadog-api", + "Rev": "af9919d4fd020eba6daada1cbba9310f5d7b44a8" + }, + { + "ImportPath": "golang.org/x/crypto/curve25519", + "Rev": "1f22c0103821b9390939b6776727195525381532" + }, + { + "ImportPath": "golang.org/x/crypto/ssh", + "Rev": "1f22c0103821b9390939b6776727195525381532" + }, + { + "ImportPath": "golang.org/x/crypto/ssh/agent", + "Rev": "1f22c0103821b9390939b6776727195525381532" + }, + { + "ImportPath": "golang.org/x/net/context", + "Rev": "04b9de9b512f58addf28c9853d50ebef61c3953e" + }, + { + "ImportPath": "golang.org/x/net/context/ctxhttp", + "Rev": "04b9de9b512f58addf28c9853d50ebef61c3953e" + }, + { + "ImportPath": "golang.org/x/oauth2", + "Rev": "2897dcade18a126645f1368de827f1e613a60049" + }, + { + "ImportPath": "golang.org/x/oauth2/google", + "Rev": "2897dcade18a126645f1368de827f1e613a60049" + }, + { + "ImportPath": "golang.org/x/oauth2/internal", + "Rev": "2897dcade18a126645f1368de827f1e613a60049" + }, + { + "ImportPath": "golang.org/x/oauth2/jws", + "Rev": "2897dcade18a126645f1368de827f1e613a60049" + }, + { + "ImportPath": "golang.org/x/oauth2/jwt", + "Rev": "2897dcade18a126645f1368de827f1e613a60049" + }, + { + "ImportPath": "golang.org/x/sys/unix", + "Rev": "5eaf0df67e70d6997a9fe0ed24383fa1b01638d3" + }, + { + "ImportPath": "google.golang.org/api/compute/v1", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/container/v1", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/dns/v1", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/gensupport", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/googleapi", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/googleapi/internal/uritemplates", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/pubsub/v1", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/sqladmin/v1beta4", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/api/storage/v1", + "Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4" + }, + { + "ImportPath": "google.golang.org/appengine", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/app_identity", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/base", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/datastore", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/log", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/modules", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/appengine/internal/remote_api", + "Rev": "b667a5000b082e49c6c6d16867d376a12e9490cd" + }, + { + "ImportPath": "google.golang.org/cloud/compute/metadata", + "Rev": "fb10e8da373d97f6ba5e648299a10b3b91f14cd5" + }, + { + "ImportPath": "google.golang.org/cloud/internal", + "Rev": "fb10e8da373d97f6ba5e648299a10b3b91f14cd5" + }, + { + "ImportPath": "gopkg.in/ini.v1", + "Comment": "v1.8.5", + "Rev": "77178f22699a4ecafce485fb8d86b7afeb7e3e28" + } + ] +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/iot/api.go b/vendor/github.com/aws/aws-sdk-go/service/iot/api.go new file mode 100644 index 000000000000..3054a094b00a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iot/api.go @@ -0,0 +1,5368 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +// Package iot provides a client for AWS IoT. +package iot + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +const opAcceptCertificateTransfer = "AcceptCertificateTransfer" + +// AcceptCertificateTransferRequest generates a request for the AcceptCertificateTransfer operation. +func (c *IoT) AcceptCertificateTransferRequest(input *AcceptCertificateTransferInput) (req *request.Request, output *AcceptCertificateTransferOutput) { + op := &request.Operation{ + Name: opAcceptCertificateTransfer, + HTTPMethod: "PATCH", + HTTPPath: "/accept-certificate-transfer/{certificateId}", + } + + if input == nil { + input = &AcceptCertificateTransferInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &AcceptCertificateTransferOutput{} + req.Data = output + return +} + +// Accepts a pending certificate transfer. The default state of the certificate +// is INACTIVE. +// +// To check for pending certificate transfers, call ListCertificates to enumerate +// your certificates. +func (c *IoT) AcceptCertificateTransfer(input *AcceptCertificateTransferInput) (*AcceptCertificateTransferOutput, error) { + req, out := c.AcceptCertificateTransferRequest(input) + err := req.Send() + return out, err +} + +const opAttachPrincipalPolicy = "AttachPrincipalPolicy" + +// AttachPrincipalPolicyRequest generates a request for the AttachPrincipalPolicy operation. +func (c *IoT) AttachPrincipalPolicyRequest(input *AttachPrincipalPolicyInput) (req *request.Request, output *AttachPrincipalPolicyOutput) { + op := &request.Operation{ + Name: opAttachPrincipalPolicy, + HTTPMethod: "PUT", + HTTPPath: "/principal-policies/{policyName}", + } + + if input == nil { + input = &AttachPrincipalPolicyInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &AttachPrincipalPolicyOutput{} + req.Data = output + return +} + +// Attaches the specified policy to the specified principal (certificate or +// other credential). +func (c *IoT) AttachPrincipalPolicy(input *AttachPrincipalPolicyInput) (*AttachPrincipalPolicyOutput, error) { + req, out := c.AttachPrincipalPolicyRequest(input) + err := req.Send() + return out, err +} + +const opAttachThingPrincipal = "AttachThingPrincipal" + +// AttachThingPrincipalRequest generates a request for the AttachThingPrincipal operation. +func (c *IoT) AttachThingPrincipalRequest(input *AttachThingPrincipalInput) (req *request.Request, output *AttachThingPrincipalOutput) { + op := &request.Operation{ + Name: opAttachThingPrincipal, + HTTPMethod: "PUT", + HTTPPath: "/things/{thingName}/principals", + } + + if input == nil { + input = &AttachThingPrincipalInput{} + } + + req = c.newRequest(op, input, output) + output = &AttachThingPrincipalOutput{} + req.Data = output + return +} + +// Attaches the specified principal to the specified thing. +func (c *IoT) AttachThingPrincipal(input *AttachThingPrincipalInput) (*AttachThingPrincipalOutput, error) { + req, out := c.AttachThingPrincipalRequest(input) + err := req.Send() + return out, err +} + +const opCancelCertificateTransfer = "CancelCertificateTransfer" + +// CancelCertificateTransferRequest generates a request for the CancelCertificateTransfer operation. +func (c *IoT) CancelCertificateTransferRequest(input *CancelCertificateTransferInput) (req *request.Request, output *CancelCertificateTransferOutput) { + op := &request.Operation{ + Name: opCancelCertificateTransfer, + HTTPMethod: "PATCH", + HTTPPath: "/cancel-certificate-transfer/{certificateId}", + } + + if input == nil { + input = &CancelCertificateTransferInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &CancelCertificateTransferOutput{} + req.Data = output + return +} + +// Cancels a pending transfer for the specified certificate. +// +// Note Only the transfer source account can use this operation to cancel a +// transfer. (Transfer destinations can use RejectCertificateTransfer instead.) +// After transfer, AWS IoT returns the certificate to the source account in +// the INACTIVE state. After the destination account has accepted the transfer, +// the transfer cannot be cancelled. +// +// After a certificate transfer is cancelled, the status of the certificate +// changes from PENDING_TRANSFER to INACTIVE. +func (c *IoT) CancelCertificateTransfer(input *CancelCertificateTransferInput) (*CancelCertificateTransferOutput, error) { + req, out := c.CancelCertificateTransferRequest(input) + err := req.Send() + return out, err +} + +const opCreateCertificateFromCsr = "CreateCertificateFromCsr" + +// CreateCertificateFromCsrRequest generates a request for the CreateCertificateFromCsr operation. +func (c *IoT) CreateCertificateFromCsrRequest(input *CreateCertificateFromCsrInput) (req *request.Request, output *CreateCertificateFromCsrOutput) { + op := &request.Operation{ + Name: opCreateCertificateFromCsr, + HTTPMethod: "POST", + HTTPPath: "/certificates", + } + + if input == nil { + input = &CreateCertificateFromCsrInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateCertificateFromCsrOutput{} + req.Data = output + return +} + +// Creates an X.509 certificate using the specified certificate signing request. +// +// Note Reusing the same certificate signing request (CSR) results in a distinct +// certificate. +// +// You can create multiple certificates in a batch by creating a directory, +// copying multiple .csr files into that directory, and then specifying that +// directory on the command line. The following commands show how to create +// a batch of certificates given a batch of CSRs. +// +// Assuming a set of CSRs are located inside of the directory my-csr-directory: +// +// > On Linux and OS X, the command is: +// +// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr +// --certificate-signing-request file://my-csr-directory/{} +// +// This command lists all of the CSRs in my-csr-directory and pipes each CSR +// file name to the aws iot create-certificate-from-csr AWS CLI command to create +// a certificate for the corresponding CSR. +// +// The aws iot create-certificate-from-csr part of the command can also be +// run in parallel to speed up the certificate creation process: +// +// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr +// --certificate-signing-request file://my-csr-directory/{} +// +// On Windows PowerShell, the command to create certificates for all CSRs +// in my-csr-directory is: +// +// > ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request +// file://my-csr-directory/$_} +// +// On a Windows command prompt, the command to create certificates for all +// CSRs in my-csr-directory is: +// +// > forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr +// --certificate-signing-request file://@path" +func (c *IoT) CreateCertificateFromCsr(input *CreateCertificateFromCsrInput) (*CreateCertificateFromCsrOutput, error) { + req, out := c.CreateCertificateFromCsrRequest(input) + err := req.Send() + return out, err +} + +const opCreateKeysAndCertificate = "CreateKeysAndCertificate" + +// CreateKeysAndCertificateRequest generates a request for the CreateKeysAndCertificate operation. +func (c *IoT) CreateKeysAndCertificateRequest(input *CreateKeysAndCertificateInput) (req *request.Request, output *CreateKeysAndCertificateOutput) { + op := &request.Operation{ + Name: opCreateKeysAndCertificate, + HTTPMethod: "POST", + HTTPPath: "/keys-and-certificate", + } + + if input == nil { + input = &CreateKeysAndCertificateInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateKeysAndCertificateOutput{} + req.Data = output + return +} + +// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the +// issued public key. +// +// Note This is the only time AWS IoT issues the private key for this certificate, +// so it is important to keep it in a secure location. +func (c *IoT) CreateKeysAndCertificate(input *CreateKeysAndCertificateInput) (*CreateKeysAndCertificateOutput, error) { + req, out := c.CreateKeysAndCertificateRequest(input) + err := req.Send() + return out, err +} + +const opCreatePolicy = "CreatePolicy" + +// CreatePolicyRequest generates a request for the CreatePolicy operation. +func (c *IoT) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput) { + op := &request.Operation{ + Name: opCreatePolicy, + HTTPMethod: "POST", + HTTPPath: "/policies/{policyName}", + } + + if input == nil { + input = &CreatePolicyInput{} + } + + req = c.newRequest(op, input, output) + output = &CreatePolicyOutput{} + req.Data = output + return +} + +// Creates an AWS IoT policy. +// +// The created policy is the default version for the policy. This operation +// creates a policy version with a version identifier of 1 and sets 1 as the +// policy's default version. +func (c *IoT) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { + req, out := c.CreatePolicyRequest(input) + err := req.Send() + return out, err +} + +const opCreatePolicyVersion = "CreatePolicyVersion" + +// CreatePolicyVersionRequest generates a request for the CreatePolicyVersion operation. +func (c *IoT) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req *request.Request, output *CreatePolicyVersionOutput) { + op := &request.Operation{ + Name: opCreatePolicyVersion, + HTTPMethod: "POST", + HTTPPath: "/policies/{policyName}/version", + } + + if input == nil { + input = &CreatePolicyVersionInput{} + } + + req = c.newRequest(op, input, output) + output = &CreatePolicyVersionOutput{} + req.Data = output + return +} + +// Creates a new version of the specified AWS IoT policy. To update a policy, +// create a new policy version. A managed policy can have up to five versions. +// If the policy has five versions, you must use DeletePolicyVersion to delete +// an existing version before you create a new one. +// +// Optionally, you can set the new version as the policy's default version. +// The default version is the operative version (that is, the version that is +// in effect for the certificates to which the policy is attached). +func (c *IoT) CreatePolicyVersion(input *CreatePolicyVersionInput) (*CreatePolicyVersionOutput, error) { + req, out := c.CreatePolicyVersionRequest(input) + err := req.Send() + return out, err +} + +const opCreateThing = "CreateThing" + +// CreateThingRequest generates a request for the CreateThing operation. +func (c *IoT) CreateThingRequest(input *CreateThingInput) (req *request.Request, output *CreateThingOutput) { + op := &request.Operation{ + Name: opCreateThing, + HTTPMethod: "POST", + HTTPPath: "/things/{thingName}", + } + + if input == nil { + input = &CreateThingInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateThingOutput{} + req.Data = output + return +} + +// Creates a thing in the Thing Registry. +func (c *IoT) CreateThing(input *CreateThingInput) (*CreateThingOutput, error) { + req, out := c.CreateThingRequest(input) + err := req.Send() + return out, err +} + +const opCreateTopicRule = "CreateTopicRule" + +// CreateTopicRuleRequest generates a request for the CreateTopicRule operation. +func (c *IoT) CreateTopicRuleRequest(input *CreateTopicRuleInput) (req *request.Request, output *CreateTopicRuleOutput) { + op := &request.Operation{ + Name: opCreateTopicRule, + HTTPMethod: "POST", + HTTPPath: "/rules/{ruleName}", + } + + if input == nil { + input = &CreateTopicRuleInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &CreateTopicRuleOutput{} + req.Data = output + return +} + +// Creates a rule. Creating rules is an administrator-level action. Any user +// who has permission to create rules will be able to access data processed +// by the rule. +func (c *IoT) CreateTopicRule(input *CreateTopicRuleInput) (*CreateTopicRuleOutput, error) { + req, out := c.CreateTopicRuleRequest(input) + err := req.Send() + return out, err +} + +const opDeleteCACertificate = "DeleteCACertificate" + +// DeleteCACertificateRequest generates a request for the DeleteCACertificate operation. +func (c *IoT) DeleteCACertificateRequest(input *DeleteCACertificateInput) (req *request.Request, output *DeleteCACertificateOutput) { + op := &request.Operation{ + Name: opDeleteCACertificate, + HTTPMethod: "DELETE", + HTTPPath: "/cacertificate/{certificateId}", + } + + if input == nil { + input = &DeleteCACertificateInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteCACertificateOutput{} + req.Data = output + return +} + +// Deletes a registered CA certificate. +func (c *IoT) DeleteCACertificate(input *DeleteCACertificateInput) (*DeleteCACertificateOutput, error) { + req, out := c.DeleteCACertificateRequest(input) + err := req.Send() + return out, err +} + +const opDeleteCertificate = "DeleteCertificate" + +// DeleteCertificateRequest generates a request for the DeleteCertificate operation. +func (c *IoT) DeleteCertificateRequest(input *DeleteCertificateInput) (req *request.Request, output *DeleteCertificateOutput) { + op := &request.Operation{ + Name: opDeleteCertificate, + HTTPMethod: "DELETE", + HTTPPath: "/certificates/{certificateId}", + } + + if input == nil { + input = &DeleteCertificateInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &DeleteCertificateOutput{} + req.Data = output + return +} + +// Deletes the specified certificate. +// +// A certificate cannot be deleted if it has a policy attached to it or if +// its status is set to ACTIVE. To delete a certificate, first use the DetachPrincipalPolicy +// API to detach all policies. Next, use the UpdateCertificate API to set the +// certificate to the INACTIVE status. +func (c *IoT) DeleteCertificate(input *DeleteCertificateInput) (*DeleteCertificateOutput, error) { + req, out := c.DeleteCertificateRequest(input) + err := req.Send() + return out, err +} + +const opDeletePolicy = "DeletePolicy" + +// DeletePolicyRequest generates a request for the DeletePolicy operation. +func (c *IoT) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { + op := &request.Operation{ + Name: opDeletePolicy, + HTTPMethod: "DELETE", + HTTPPath: "/policies/{policyName}", + } + + if input == nil { + input = &DeletePolicyInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &DeletePolicyOutput{} + req.Data = output + return +} + +// Deletes the specified policy. +// +// A policy cannot be deleted if it has non-default versions or it is attached +// to any certificate. +// +// To delete a policy, use the DeletePolicyVersion API to delete all non-default +// versions of the policy; use the DetachPrincipalPolicy API to detach the policy +// from any certificate; and then use the DeletePolicy API to delete the policy. +// +// When a policy is deleted using DeletePolicy, its default version is deleted +// with it. +func (c *IoT) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { + req, out := c.DeletePolicyRequest(input) + err := req.Send() + return out, err +} + +const opDeletePolicyVersion = "DeletePolicyVersion" + +// DeletePolicyVersionRequest generates a request for the DeletePolicyVersion operation. +func (c *IoT) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) (req *request.Request, output *DeletePolicyVersionOutput) { + op := &request.Operation{ + Name: opDeletePolicyVersion, + HTTPMethod: "DELETE", + HTTPPath: "/policies/{policyName}/version/{policyVersionId}", + } + + if input == nil { + input = &DeletePolicyVersionInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &DeletePolicyVersionOutput{} + req.Data = output + return +} + +// Deletes the specified version of the specified policy. You cannot delete +// the default version of a policy using this API. To delete the default version +// of a policy, use DeletePolicy. To find out which version of a policy is marked +// as the default version, use ListPolicyVersions. +func (c *IoT) DeletePolicyVersion(input *DeletePolicyVersionInput) (*DeletePolicyVersionOutput, error) { + req, out := c.DeletePolicyVersionRequest(input) + err := req.Send() + return out, err +} + +const opDeleteRegistrationCode = "DeleteRegistrationCode" + +// DeleteRegistrationCodeRequest generates a request for the DeleteRegistrationCode operation. +func (c *IoT) DeleteRegistrationCodeRequest(input *DeleteRegistrationCodeInput) (req *request.Request, output *DeleteRegistrationCodeOutput) { + op := &request.Operation{ + Name: opDeleteRegistrationCode, + HTTPMethod: "DELETE", + HTTPPath: "/registrationcode", + } + + if input == nil { + input = &DeleteRegistrationCodeInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteRegistrationCodeOutput{} + req.Data = output + return +} + +// Deletes a CA certificate registration code. +func (c *IoT) DeleteRegistrationCode(input *DeleteRegistrationCodeInput) (*DeleteRegistrationCodeOutput, error) { + req, out := c.DeleteRegistrationCodeRequest(input) + err := req.Send() + return out, err +} + +const opDeleteThing = "DeleteThing" + +// DeleteThingRequest generates a request for the DeleteThing operation. +func (c *IoT) DeleteThingRequest(input *DeleteThingInput) (req *request.Request, output *DeleteThingOutput) { + op := &request.Operation{ + Name: opDeleteThing, + HTTPMethod: "DELETE", + HTTPPath: "/things/{thingName}", + } + + if input == nil { + input = &DeleteThingInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteThingOutput{} + req.Data = output + return +} + +// Deletes the specified thing from the Thing Registry. +func (c *IoT) DeleteThing(input *DeleteThingInput) (*DeleteThingOutput, error) { + req, out := c.DeleteThingRequest(input) + err := req.Send() + return out, err +} + +const opDeleteTopicRule = "DeleteTopicRule" + +// DeleteTopicRuleRequest generates a request for the DeleteTopicRule operation. +func (c *IoT) DeleteTopicRuleRequest(input *DeleteTopicRuleInput) (req *request.Request, output *DeleteTopicRuleOutput) { + op := &request.Operation{ + Name: opDeleteTopicRule, + HTTPMethod: "DELETE", + HTTPPath: "/rules/{ruleName}", + } + + if input == nil { + input = &DeleteTopicRuleInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &DeleteTopicRuleOutput{} + req.Data = output + return +} + +// Deletes the specified rule. +func (c *IoT) DeleteTopicRule(input *DeleteTopicRuleInput) (*DeleteTopicRuleOutput, error) { + req, out := c.DeleteTopicRuleRequest(input) + err := req.Send() + return out, err +} + +const opDescribeCACertificate = "DescribeCACertificate" + +// DescribeCACertificateRequest generates a request for the DescribeCACertificate operation. +func (c *IoT) DescribeCACertificateRequest(input *DescribeCACertificateInput) (req *request.Request, output *DescribeCACertificateOutput) { + op := &request.Operation{ + Name: opDescribeCACertificate, + HTTPMethod: "GET", + HTTPPath: "/cacertificate/{certificateId}", + } + + if input == nil { + input = &DescribeCACertificateInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeCACertificateOutput{} + req.Data = output + return +} + +// Describes a registered CA certificate. +func (c *IoT) DescribeCACertificate(input *DescribeCACertificateInput) (*DescribeCACertificateOutput, error) { + req, out := c.DescribeCACertificateRequest(input) + err := req.Send() + return out, err +} + +const opDescribeCertificate = "DescribeCertificate" + +// DescribeCertificateRequest generates a request for the DescribeCertificate operation. +func (c *IoT) DescribeCertificateRequest(input *DescribeCertificateInput) (req *request.Request, output *DescribeCertificateOutput) { + op := &request.Operation{ + Name: opDescribeCertificate, + HTTPMethod: "GET", + HTTPPath: "/certificates/{certificateId}", + } + + if input == nil { + input = &DescribeCertificateInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeCertificateOutput{} + req.Data = output + return +} + +// Gets information about the specified certificate. +func (c *IoT) DescribeCertificate(input *DescribeCertificateInput) (*DescribeCertificateOutput, error) { + req, out := c.DescribeCertificateRequest(input) + err := req.Send() + return out, err +} + +const opDescribeEndpoint = "DescribeEndpoint" + +// DescribeEndpointRequest generates a request for the DescribeEndpoint operation. +func (c *IoT) DescribeEndpointRequest(input *DescribeEndpointInput) (req *request.Request, output *DescribeEndpointOutput) { + op := &request.Operation{ + Name: opDescribeEndpoint, + HTTPMethod: "GET", + HTTPPath: "/endpoint", + } + + if input == nil { + input = &DescribeEndpointInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeEndpointOutput{} + req.Data = output + return +} + +// Returns a unique endpoint specific to the AWS account making the call. You +// specify the following URI when updating state information for your thing: +// https://endpoint/things/thingName/shadow. +func (c *IoT) DescribeEndpoint(input *DescribeEndpointInput) (*DescribeEndpointOutput, error) { + req, out := c.DescribeEndpointRequest(input) + err := req.Send() + return out, err +} + +const opDescribeThing = "DescribeThing" + +// DescribeThingRequest generates a request for the DescribeThing operation. +func (c *IoT) DescribeThingRequest(input *DescribeThingInput) (req *request.Request, output *DescribeThingOutput) { + op := &request.Operation{ + Name: opDescribeThing, + HTTPMethod: "GET", + HTTPPath: "/things/{thingName}", + } + + if input == nil { + input = &DescribeThingInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeThingOutput{} + req.Data = output + return +} + +// Gets information about the specified thing. +func (c *IoT) DescribeThing(input *DescribeThingInput) (*DescribeThingOutput, error) { + req, out := c.DescribeThingRequest(input) + err := req.Send() + return out, err +} + +const opDetachPrincipalPolicy = "DetachPrincipalPolicy" + +// DetachPrincipalPolicyRequest generates a request for the DetachPrincipalPolicy operation. +func (c *IoT) DetachPrincipalPolicyRequest(input *DetachPrincipalPolicyInput) (req *request.Request, output *DetachPrincipalPolicyOutput) { + op := &request.Operation{ + Name: opDetachPrincipalPolicy, + HTTPMethod: "DELETE", + HTTPPath: "/principal-policies/{policyName}", + } + + if input == nil { + input = &DetachPrincipalPolicyInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &DetachPrincipalPolicyOutput{} + req.Data = output + return +} + +// Removes the specified policy from the specified certificate. +func (c *IoT) DetachPrincipalPolicy(input *DetachPrincipalPolicyInput) (*DetachPrincipalPolicyOutput, error) { + req, out := c.DetachPrincipalPolicyRequest(input) + err := req.Send() + return out, err +} + +const opDetachThingPrincipal = "DetachThingPrincipal" + +// DetachThingPrincipalRequest generates a request for the DetachThingPrincipal operation. +func (c *IoT) DetachThingPrincipalRequest(input *DetachThingPrincipalInput) (req *request.Request, output *DetachThingPrincipalOutput) { + op := &request.Operation{ + Name: opDetachThingPrincipal, + HTTPMethod: "DELETE", + HTTPPath: "/things/{thingName}/principals", + } + + if input == nil { + input = &DetachThingPrincipalInput{} + } + + req = c.newRequest(op, input, output) + output = &DetachThingPrincipalOutput{} + req.Data = output + return +} + +// Detaches the specified principal from the specified thing. +func (c *IoT) DetachThingPrincipal(input *DetachThingPrincipalInput) (*DetachThingPrincipalOutput, error) { + req, out := c.DetachThingPrincipalRequest(input) + err := req.Send() + return out, err +} + +const opDisableTopicRule = "DisableTopicRule" + +// DisableTopicRuleRequest generates a request for the DisableTopicRule operation. +func (c *IoT) DisableTopicRuleRequest(input *DisableTopicRuleInput) (req *request.Request, output *DisableTopicRuleOutput) { + op := &request.Operation{ + Name: opDisableTopicRule, + HTTPMethod: "POST", + HTTPPath: "/rules/{ruleName}/disable", + } + + if input == nil { + input = &DisableTopicRuleInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &DisableTopicRuleOutput{} + req.Data = output + return +} + +// Disables the specified rule. +func (c *IoT) DisableTopicRule(input *DisableTopicRuleInput) (*DisableTopicRuleOutput, error) { + req, out := c.DisableTopicRuleRequest(input) + err := req.Send() + return out, err +} + +const opEnableTopicRule = "EnableTopicRule" + +// EnableTopicRuleRequest generates a request for the EnableTopicRule operation. +func (c *IoT) EnableTopicRuleRequest(input *EnableTopicRuleInput) (req *request.Request, output *EnableTopicRuleOutput) { + op := &request.Operation{ + Name: opEnableTopicRule, + HTTPMethod: "POST", + HTTPPath: "/rules/{ruleName}/enable", + } + + if input == nil { + input = &EnableTopicRuleInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &EnableTopicRuleOutput{} + req.Data = output + return +} + +// Enables the specified rule. +func (c *IoT) EnableTopicRule(input *EnableTopicRuleInput) (*EnableTopicRuleOutput, error) { + req, out := c.EnableTopicRuleRequest(input) + err := req.Send() + return out, err +} + +const opGetLoggingOptions = "GetLoggingOptions" + +// GetLoggingOptionsRequest generates a request for the GetLoggingOptions operation. +func (c *IoT) GetLoggingOptionsRequest(input *GetLoggingOptionsInput) (req *request.Request, output *GetLoggingOptionsOutput) { + op := &request.Operation{ + Name: opGetLoggingOptions, + HTTPMethod: "GET", + HTTPPath: "/loggingOptions", + } + + if input == nil { + input = &GetLoggingOptionsInput{} + } + + req = c.newRequest(op, input, output) + output = &GetLoggingOptionsOutput{} + req.Data = output + return +} + +// Gets the logging options. +func (c *IoT) GetLoggingOptions(input *GetLoggingOptionsInput) (*GetLoggingOptionsOutput, error) { + req, out := c.GetLoggingOptionsRequest(input) + err := req.Send() + return out, err +} + +const opGetPolicy = "GetPolicy" + +// GetPolicyRequest generates a request for the GetPolicy operation. +func (c *IoT) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput) { + op := &request.Operation{ + Name: opGetPolicy, + HTTPMethod: "GET", + HTTPPath: "/policies/{policyName}", + } + + if input == nil { + input = &GetPolicyInput{} + } + + req = c.newRequest(op, input, output) + output = &GetPolicyOutput{} + req.Data = output + return +} + +// Gets information about the specified policy with the policy document of the +// default version. +func (c *IoT) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { + req, out := c.GetPolicyRequest(input) + err := req.Send() + return out, err +} + +const opGetPolicyVersion = "GetPolicyVersion" + +// GetPolicyVersionRequest generates a request for the GetPolicyVersion operation. +func (c *IoT) GetPolicyVersionRequest(input *GetPolicyVersionInput) (req *request.Request, output *GetPolicyVersionOutput) { + op := &request.Operation{ + Name: opGetPolicyVersion, + HTTPMethod: "GET", + HTTPPath: "/policies/{policyName}/version/{policyVersionId}", + } + + if input == nil { + input = &GetPolicyVersionInput{} + } + + req = c.newRequest(op, input, output) + output = &GetPolicyVersionOutput{} + req.Data = output + return +} + +// Gets information about the specified policy version. +func (c *IoT) GetPolicyVersion(input *GetPolicyVersionInput) (*GetPolicyVersionOutput, error) { + req, out := c.GetPolicyVersionRequest(input) + err := req.Send() + return out, err +} + +const opGetRegistrationCode = "GetRegistrationCode" + +// GetRegistrationCodeRequest generates a request for the GetRegistrationCode operation. +func (c *IoT) GetRegistrationCodeRequest(input *GetRegistrationCodeInput) (req *request.Request, output *GetRegistrationCodeOutput) { + op := &request.Operation{ + Name: opGetRegistrationCode, + HTTPMethod: "GET", + HTTPPath: "/registrationcode", + } + + if input == nil { + input = &GetRegistrationCodeInput{} + } + + req = c.newRequest(op, input, output) + output = &GetRegistrationCodeOutput{} + req.Data = output + return +} + +// Gets a registration code used to register a CA certificate with AWS IoT. +func (c *IoT) GetRegistrationCode(input *GetRegistrationCodeInput) (*GetRegistrationCodeOutput, error) { + req, out := c.GetRegistrationCodeRequest(input) + err := req.Send() + return out, err +} + +const opGetTopicRule = "GetTopicRule" + +// GetTopicRuleRequest generates a request for the GetTopicRule operation. +func (c *IoT) GetTopicRuleRequest(input *GetTopicRuleInput) (req *request.Request, output *GetTopicRuleOutput) { + op := &request.Operation{ + Name: opGetTopicRule, + HTTPMethod: "GET", + HTTPPath: "/rules/{ruleName}", + } + + if input == nil { + input = &GetTopicRuleInput{} + } + + req = c.newRequest(op, input, output) + output = &GetTopicRuleOutput{} + req.Data = output + return +} + +// Gets information about the specified rule. +func (c *IoT) GetTopicRule(input *GetTopicRuleInput) (*GetTopicRuleOutput, error) { + req, out := c.GetTopicRuleRequest(input) + err := req.Send() + return out, err +} + +const opListCACertificates = "ListCACertificates" + +// ListCACertificatesRequest generates a request for the ListCACertificates operation. +func (c *IoT) ListCACertificatesRequest(input *ListCACertificatesInput) (req *request.Request, output *ListCACertificatesOutput) { + op := &request.Operation{ + Name: opListCACertificates, + HTTPMethod: "GET", + HTTPPath: "/cacertificates", + } + + if input == nil { + input = &ListCACertificatesInput{} + } + + req = c.newRequest(op, input, output) + output = &ListCACertificatesOutput{} + req.Data = output + return +} + +// Lists the CA certificates registered for your AWS account. +// +// The results are paginated with a default page size of 25. You can use the +// returned marker to retrieve additional results. +func (c *IoT) ListCACertificates(input *ListCACertificatesInput) (*ListCACertificatesOutput, error) { + req, out := c.ListCACertificatesRequest(input) + err := req.Send() + return out, err +} + +const opListCertificates = "ListCertificates" + +// ListCertificatesRequest generates a request for the ListCertificates operation. +func (c *IoT) ListCertificatesRequest(input *ListCertificatesInput) (req *request.Request, output *ListCertificatesOutput) { + op := &request.Operation{ + Name: opListCertificates, + HTTPMethod: "GET", + HTTPPath: "/certificates", + } + + if input == nil { + input = &ListCertificatesInput{} + } + + req = c.newRequest(op, input, output) + output = &ListCertificatesOutput{} + req.Data = output + return +} + +// Lists the certificates registered in your AWS account. +// +// The results are paginated with a default page size of 25. You can use the +// returned marker to retrieve additional results. +func (c *IoT) ListCertificates(input *ListCertificatesInput) (*ListCertificatesOutput, error) { + req, out := c.ListCertificatesRequest(input) + err := req.Send() + return out, err +} + +const opListCertificatesByCA = "ListCertificatesByCA" + +// ListCertificatesByCARequest generates a request for the ListCertificatesByCA operation. +func (c *IoT) ListCertificatesByCARequest(input *ListCertificatesByCAInput) (req *request.Request, output *ListCertificatesByCAOutput) { + op := &request.Operation{ + Name: opListCertificatesByCA, + HTTPMethod: "GET", + HTTPPath: "/certificates-by-ca/{caCertificateId}", + } + + if input == nil { + input = &ListCertificatesByCAInput{} + } + + req = c.newRequest(op, input, output) + output = &ListCertificatesByCAOutput{} + req.Data = output + return +} + +// List the device certificates signed by the specified CA certificate. +func (c *IoT) ListCertificatesByCA(input *ListCertificatesByCAInput) (*ListCertificatesByCAOutput, error) { + req, out := c.ListCertificatesByCARequest(input) + err := req.Send() + return out, err +} + +const opListPolicies = "ListPolicies" + +// ListPoliciesRequest generates a request for the ListPolicies operation. +func (c *IoT) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Request, output *ListPoliciesOutput) { + op := &request.Operation{ + Name: opListPolicies, + HTTPMethod: "GET", + HTTPPath: "/policies", + } + + if input == nil { + input = &ListPoliciesInput{} + } + + req = c.newRequest(op, input, output) + output = &ListPoliciesOutput{} + req.Data = output + return +} + +// Lists your policies. +func (c *IoT) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { + req, out := c.ListPoliciesRequest(input) + err := req.Send() + return out, err +} + +const opListPolicyVersions = "ListPolicyVersions" + +// ListPolicyVersionsRequest generates a request for the ListPolicyVersions operation. +func (c *IoT) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) (req *request.Request, output *ListPolicyVersionsOutput) { + op := &request.Operation{ + Name: opListPolicyVersions, + HTTPMethod: "GET", + HTTPPath: "/policies/{policyName}/version", + } + + if input == nil { + input = &ListPolicyVersionsInput{} + } + + req = c.newRequest(op, input, output) + output = &ListPolicyVersionsOutput{} + req.Data = output + return +} + +// Lists the versions of the specified policy, and identifies the default version. +func (c *IoT) ListPolicyVersions(input *ListPolicyVersionsInput) (*ListPolicyVersionsOutput, error) { + req, out := c.ListPolicyVersionsRequest(input) + err := req.Send() + return out, err +} + +const opListPrincipalPolicies = "ListPrincipalPolicies" + +// ListPrincipalPoliciesRequest generates a request for the ListPrincipalPolicies operation. +func (c *IoT) ListPrincipalPoliciesRequest(input *ListPrincipalPoliciesInput) (req *request.Request, output *ListPrincipalPoliciesOutput) { + op := &request.Operation{ + Name: opListPrincipalPolicies, + HTTPMethod: "GET", + HTTPPath: "/principal-policies", + } + + if input == nil { + input = &ListPrincipalPoliciesInput{} + } + + req = c.newRequest(op, input, output) + output = &ListPrincipalPoliciesOutput{} + req.Data = output + return +} + +// Lists the policies attached to the specified principal. If you use an Cognito +// identity, the ID must be in AmazonCognito Identity format (http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html#API_GetCredentialsForIdentity_RequestSyntax). +func (c *IoT) ListPrincipalPolicies(input *ListPrincipalPoliciesInput) (*ListPrincipalPoliciesOutput, error) { + req, out := c.ListPrincipalPoliciesRequest(input) + err := req.Send() + return out, err +} + +const opListPrincipalThings = "ListPrincipalThings" + +// ListPrincipalThingsRequest generates a request for the ListPrincipalThings operation. +func (c *IoT) ListPrincipalThingsRequest(input *ListPrincipalThingsInput) (req *request.Request, output *ListPrincipalThingsOutput) { + op := &request.Operation{ + Name: opListPrincipalThings, + HTTPMethod: "GET", + HTTPPath: "/principals/things", + } + + if input == nil { + input = &ListPrincipalThingsInput{} + } + + req = c.newRequest(op, input, output) + output = &ListPrincipalThingsOutput{} + req.Data = output + return +} + +// Lists the things associated with the specified principal. +func (c *IoT) ListPrincipalThings(input *ListPrincipalThingsInput) (*ListPrincipalThingsOutput, error) { + req, out := c.ListPrincipalThingsRequest(input) + err := req.Send() + return out, err +} + +const opListThingPrincipals = "ListThingPrincipals" + +// ListThingPrincipalsRequest generates a request for the ListThingPrincipals operation. +func (c *IoT) ListThingPrincipalsRequest(input *ListThingPrincipalsInput) (req *request.Request, output *ListThingPrincipalsOutput) { + op := &request.Operation{ + Name: opListThingPrincipals, + HTTPMethod: "GET", + HTTPPath: "/things/{thingName}/principals", + } + + if input == nil { + input = &ListThingPrincipalsInput{} + } + + req = c.newRequest(op, input, output) + output = &ListThingPrincipalsOutput{} + req.Data = output + return +} + +// Lists the principals associated with the specified thing. +func (c *IoT) ListThingPrincipals(input *ListThingPrincipalsInput) (*ListThingPrincipalsOutput, error) { + req, out := c.ListThingPrincipalsRequest(input) + err := req.Send() + return out, err +} + +const opListThings = "ListThings" + +// ListThingsRequest generates a request for the ListThings operation. +func (c *IoT) ListThingsRequest(input *ListThingsInput) (req *request.Request, output *ListThingsOutput) { + op := &request.Operation{ + Name: opListThings, + HTTPMethod: "GET", + HTTPPath: "/things", + } + + if input == nil { + input = &ListThingsInput{} + } + + req = c.newRequest(op, input, output) + output = &ListThingsOutput{} + req.Data = output + return +} + +// Lists your things. You can pass an AttributeName or AttributeValue to filter +// your things (for example, "ListThings where AttributeName=Color and AttributeValue=Red"). +func (c *IoT) ListThings(input *ListThingsInput) (*ListThingsOutput, error) { + req, out := c.ListThingsRequest(input) + err := req.Send() + return out, err +} + +const opListTopicRules = "ListTopicRules" + +// ListTopicRulesRequest generates a request for the ListTopicRules operation. +func (c *IoT) ListTopicRulesRequest(input *ListTopicRulesInput) (req *request.Request, output *ListTopicRulesOutput) { + op := &request.Operation{ + Name: opListTopicRules, + HTTPMethod: "GET", + HTTPPath: "/rules", + } + + if input == nil { + input = &ListTopicRulesInput{} + } + + req = c.newRequest(op, input, output) + output = &ListTopicRulesOutput{} + req.Data = output + return +} + +// Lists the rules for the specific topic. +func (c *IoT) ListTopicRules(input *ListTopicRulesInput) (*ListTopicRulesOutput, error) { + req, out := c.ListTopicRulesRequest(input) + err := req.Send() + return out, err +} + +const opRegisterCACertificate = "RegisterCACertificate" + +// RegisterCACertificateRequest generates a request for the RegisterCACertificate operation. +func (c *IoT) RegisterCACertificateRequest(input *RegisterCACertificateInput) (req *request.Request, output *RegisterCACertificateOutput) { + op := &request.Operation{ + Name: opRegisterCACertificate, + HTTPMethod: "POST", + HTTPPath: "/cacertificate", + } + + if input == nil { + input = &RegisterCACertificateInput{} + } + + req = c.newRequest(op, input, output) + output = &RegisterCACertificateOutput{} + req.Data = output + return +} + +// Registers a CA certificate with AWS IoT. This CA certificate can then be +// used to sign device certificates, which can be then registered with AWS IoT. +// You can register up to 10 CA certificates per AWS account that have the same +// subject field and public key. This enables you to have up to 10 certificate +// authorities sign your device certificates. If you have more than one CA certificate +// registered, make sure you pass the CA certificate when you register your +// device certificates with the RegisterCertificate API. +func (c *IoT) RegisterCACertificate(input *RegisterCACertificateInput) (*RegisterCACertificateOutput, error) { + req, out := c.RegisterCACertificateRequest(input) + err := req.Send() + return out, err +} + +const opRegisterCertificate = "RegisterCertificate" + +// RegisterCertificateRequest generates a request for the RegisterCertificate operation. +func (c *IoT) RegisterCertificateRequest(input *RegisterCertificateInput) (req *request.Request, output *RegisterCertificateOutput) { + op := &request.Operation{ + Name: opRegisterCertificate, + HTTPMethod: "POST", + HTTPPath: "/certificate/register", + } + + if input == nil { + input = &RegisterCertificateInput{} + } + + req = c.newRequest(op, input, output) + output = &RegisterCertificateOutput{} + req.Data = output + return +} + +// Registers a device certificate with AWS IoT. If you have more than one CA +// certificate that has the same subject field, you must specify the CA certificate +// that was used to sign the device certificate being registered. +func (c *IoT) RegisterCertificate(input *RegisterCertificateInput) (*RegisterCertificateOutput, error) { + req, out := c.RegisterCertificateRequest(input) + err := req.Send() + return out, err +} + +const opRejectCertificateTransfer = "RejectCertificateTransfer" + +// RejectCertificateTransferRequest generates a request for the RejectCertificateTransfer operation. +func (c *IoT) RejectCertificateTransferRequest(input *RejectCertificateTransferInput) (req *request.Request, output *RejectCertificateTransferOutput) { + op := &request.Operation{ + Name: opRejectCertificateTransfer, + HTTPMethod: "PATCH", + HTTPPath: "/reject-certificate-transfer/{certificateId}", + } + + if input == nil { + input = &RejectCertificateTransferInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &RejectCertificateTransferOutput{} + req.Data = output + return +} + +// Rejects a pending certificate transfer. After AWS IoT rejects a certificate +// transfer, the certificate status changes from PENDING_TRANSFER to INACTIVE. +// +// To check for pending certificate transfers, call ListCertificates to enumerate +// your certificates. +// +// This operation can only be called by the transfer destination. After it +// is called, the certificate will be returned to the source's account in the +// INACTIVE state. +func (c *IoT) RejectCertificateTransfer(input *RejectCertificateTransferInput) (*RejectCertificateTransferOutput, error) { + req, out := c.RejectCertificateTransferRequest(input) + err := req.Send() + return out, err +} + +const opReplaceTopicRule = "ReplaceTopicRule" + +// ReplaceTopicRuleRequest generates a request for the ReplaceTopicRule operation. +func (c *IoT) ReplaceTopicRuleRequest(input *ReplaceTopicRuleInput) (req *request.Request, output *ReplaceTopicRuleOutput) { + op := &request.Operation{ + Name: opReplaceTopicRule, + HTTPMethod: "PATCH", + HTTPPath: "/rules/{ruleName}", + } + + if input == nil { + input = &ReplaceTopicRuleInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &ReplaceTopicRuleOutput{} + req.Data = output + return +} + +// Replaces the specified rule. You must specify all parameters for the new +// rule. Creating rules is an administrator-level action. Any user who has permission +// to create rules will be able to access data processed by the rule. +func (c *IoT) ReplaceTopicRule(input *ReplaceTopicRuleInput) (*ReplaceTopicRuleOutput, error) { + req, out := c.ReplaceTopicRuleRequest(input) + err := req.Send() + return out, err +} + +const opSetDefaultPolicyVersion = "SetDefaultPolicyVersion" + +// SetDefaultPolicyVersionRequest generates a request for the SetDefaultPolicyVersion operation. +func (c *IoT) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput) (req *request.Request, output *SetDefaultPolicyVersionOutput) { + op := &request.Operation{ + Name: opSetDefaultPolicyVersion, + HTTPMethod: "PATCH", + HTTPPath: "/policies/{policyName}/version/{policyVersionId}", + } + + if input == nil { + input = &SetDefaultPolicyVersionInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &SetDefaultPolicyVersionOutput{} + req.Data = output + return +} + +// Sets the specified version of the specified policy as the policy's default +// (operative) version. This action affects all certificates to which the policy +// is attached. To list the principals the policy is attached to, use the ListPrincipalPolicy +// API. +func (c *IoT) SetDefaultPolicyVersion(input *SetDefaultPolicyVersionInput) (*SetDefaultPolicyVersionOutput, error) { + req, out := c.SetDefaultPolicyVersionRequest(input) + err := req.Send() + return out, err +} + +const opSetLoggingOptions = "SetLoggingOptions" + +// SetLoggingOptionsRequest generates a request for the SetLoggingOptions operation. +func (c *IoT) SetLoggingOptionsRequest(input *SetLoggingOptionsInput) (req *request.Request, output *SetLoggingOptionsOutput) { + op := &request.Operation{ + Name: opSetLoggingOptions, + HTTPMethod: "POST", + HTTPPath: "/loggingOptions", + } + + if input == nil { + input = &SetLoggingOptionsInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &SetLoggingOptionsOutput{} + req.Data = output + return +} + +// Sets the logging options. +func (c *IoT) SetLoggingOptions(input *SetLoggingOptionsInput) (*SetLoggingOptionsOutput, error) { + req, out := c.SetLoggingOptionsRequest(input) + err := req.Send() + return out, err +} + +const opTransferCertificate = "TransferCertificate" + +// TransferCertificateRequest generates a request for the TransferCertificate operation. +func (c *IoT) TransferCertificateRequest(input *TransferCertificateInput) (req *request.Request, output *TransferCertificateOutput) { + op := &request.Operation{ + Name: opTransferCertificate, + HTTPMethod: "PATCH", + HTTPPath: "/transfer-certificate/{certificateId}", + } + + if input == nil { + input = &TransferCertificateInput{} + } + + req = c.newRequest(op, input, output) + output = &TransferCertificateOutput{} + req.Data = output + return +} + +// Transfers the specified certificate to the specified AWS account. +// +// You can cancel the transfer until it is acknowledged by the recipient. +// +// No notification is sent to the transfer destination's account. It is up +// to the caller to notify the transfer target. +// +// The certificate being transferred must not be in the ACTIVE state. You can +// use the UpdateCertificate API to deactivate it. +// +// The certificate must not have any policies attached to it. You can use the +// DetachPrincipalPolicy API to detach them. +func (c *IoT) TransferCertificate(input *TransferCertificateInput) (*TransferCertificateOutput, error) { + req, out := c.TransferCertificateRequest(input) + err := req.Send() + return out, err +} + +const opUpdateCACertificate = "UpdateCACertificate" + +// UpdateCACertificateRequest generates a request for the UpdateCACertificate operation. +func (c *IoT) UpdateCACertificateRequest(input *UpdateCACertificateInput) (req *request.Request, output *UpdateCACertificateOutput) { + op := &request.Operation{ + Name: opUpdateCACertificate, + HTTPMethod: "PUT", + HTTPPath: "/cacertificate/{certificateId}", + } + + if input == nil { + input = &UpdateCACertificateInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &UpdateCACertificateOutput{} + req.Data = output + return +} + +// Updates a registered CA certificate. +func (c *IoT) UpdateCACertificate(input *UpdateCACertificateInput) (*UpdateCACertificateOutput, error) { + req, out := c.UpdateCACertificateRequest(input) + err := req.Send() + return out, err +} + +const opUpdateCertificate = "UpdateCertificate" + +// UpdateCertificateRequest generates a request for the UpdateCertificate operation. +func (c *IoT) UpdateCertificateRequest(input *UpdateCertificateInput) (req *request.Request, output *UpdateCertificateOutput) { + op := &request.Operation{ + Name: opUpdateCertificate, + HTTPMethod: "PUT", + HTTPPath: "/certificates/{certificateId}", + } + + if input == nil { + input = &UpdateCertificateInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &UpdateCertificateOutput{} + req.Data = output + return +} + +// Updates the status of the specified certificate. This operation is idempotent. +// +// Moving a certificate from the ACTIVE state (including REVOKED) will not +// disconnect currently connected devices, but these devices will be unable +// to reconnect. +// +// The ACTIVE state is required to authenticate devices connecting to AWS IoT +// using a certificate. +func (c *IoT) UpdateCertificate(input *UpdateCertificateInput) (*UpdateCertificateOutput, error) { + req, out := c.UpdateCertificateRequest(input) + err := req.Send() + return out, err +} + +const opUpdateThing = "UpdateThing" + +// UpdateThingRequest generates a request for the UpdateThing operation. +func (c *IoT) UpdateThingRequest(input *UpdateThingInput) (req *request.Request, output *UpdateThingOutput) { + op := &request.Operation{ + Name: opUpdateThing, + HTTPMethod: "PATCH", + HTTPPath: "/things/{thingName}", + } + + if input == nil { + input = &UpdateThingInput{} + } + + req = c.newRequest(op, input, output) + output = &UpdateThingOutput{} + req.Data = output + return +} + +// Updates the data for a thing. +func (c *IoT) UpdateThing(input *UpdateThingInput) (*UpdateThingOutput, error) { + req, out := c.UpdateThingRequest(input) + err := req.Send() + return out, err +} + +// The input for the AcceptCertificateTransfer operation. +type AcceptCertificateTransferInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` + + // Specifies whether the certificate is active. + SetAsActive *bool `location:"querystring" locationName:"setAsActive" type:"boolean"` +} + +// String returns the string representation +func (s AcceptCertificateTransferInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptCertificateTransferInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AcceptCertificateTransferInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AcceptCertificateTransferInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type AcceptCertificateTransferOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AcceptCertificateTransferOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptCertificateTransferOutput) GoString() string { + return s.String() +} + +// Describes the actions associated with a rule. +type Action struct { + _ struct{} `type:"structure"` + + // Change the state of a CloudWatch alarm. + CloudwatchAlarm *CloudwatchAlarmAction `locationName:"cloudwatchAlarm" type:"structure"` + + // Capture a CloudWatch metric. + CloudwatchMetric *CloudwatchMetricAction `locationName:"cloudwatchMetric" type:"structure"` + + // Write to a DynamoDB table. + DynamoDB *DynamoDBAction `locationName:"dynamoDB" type:"structure"` + + // Write data to an Amazon Elasticsearch Service; domain. + Elasticsearch *ElasticsearchAction `locationName:"elasticsearch" type:"structure"` + + // Write to an Amazon Kinesis Firehose stream. + Firehose *FirehoseAction `locationName:"firehose" type:"structure"` + + // Write data to an Amazon Kinesis stream. + Kinesis *KinesisAction `locationName:"kinesis" type:"structure"` + + // Invoke a Lambda function. + Lambda *LambdaAction `locationName:"lambda" type:"structure"` + + // Publish to another MQTT topic. + Republish *RepublishAction `locationName:"republish" type:"structure"` + + // Write to an Amazon S3 bucket. + S3 *S3Action `locationName:"s3" type:"structure"` + + // Publish to an Amazon SNS topic. + Sns *SnsAction `locationName:"sns" type:"structure"` + + // Publish to an Amazon SQS queue. + Sqs *SqsAction `locationName:"sqs" type:"structure"` +} + +// String returns the string representation +func (s Action) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Action) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Action) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Action"} + if s.CloudwatchAlarm != nil { + if err := s.CloudwatchAlarm.Validate(); err != nil { + invalidParams.AddNested("CloudwatchAlarm", err.(request.ErrInvalidParams)) + } + } + if s.CloudwatchMetric != nil { + if err := s.CloudwatchMetric.Validate(); err != nil { + invalidParams.AddNested("CloudwatchMetric", err.(request.ErrInvalidParams)) + } + } + if s.DynamoDB != nil { + if err := s.DynamoDB.Validate(); err != nil { + invalidParams.AddNested("DynamoDB", err.(request.ErrInvalidParams)) + } + } + if s.Elasticsearch != nil { + if err := s.Elasticsearch.Validate(); err != nil { + invalidParams.AddNested("Elasticsearch", err.(request.ErrInvalidParams)) + } + } + if s.Firehose != nil { + if err := s.Firehose.Validate(); err != nil { + invalidParams.AddNested("Firehose", err.(request.ErrInvalidParams)) + } + } + if s.Kinesis != nil { + if err := s.Kinesis.Validate(); err != nil { + invalidParams.AddNested("Kinesis", err.(request.ErrInvalidParams)) + } + } + if s.Lambda != nil { + if err := s.Lambda.Validate(); err != nil { + invalidParams.AddNested("Lambda", err.(request.ErrInvalidParams)) + } + } + if s.Republish != nil { + if err := s.Republish.Validate(); err != nil { + invalidParams.AddNested("Republish", err.(request.ErrInvalidParams)) + } + } + if s.S3 != nil { + if err := s.S3.Validate(); err != nil { + invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) + } + } + if s.Sns != nil { + if err := s.Sns.Validate(); err != nil { + invalidParams.AddNested("Sns", err.(request.ErrInvalidParams)) + } + } + if s.Sqs != nil { + if err := s.Sqs.Validate(); err != nil { + invalidParams.AddNested("Sqs", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The input for the AttachPrincipalPolicy operation. +type AttachPrincipalPolicyInput struct { + _ struct{} `type:"structure"` + + // The policy name. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` + + // The principal, which can be a certificate ARN (as returned from the CreateCertificate + // operation) or an Amazon Cognito ID. + Principal *string `location:"header" locationName:"x-amzn-iot-principal" type:"string" required:"true"` +} + +// String returns the string representation +func (s AttachPrincipalPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachPrincipalPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachPrincipalPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachPrincipalPolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.Principal == nil { + invalidParams.Add(request.NewErrParamRequired("Principal")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type AttachPrincipalPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachPrincipalPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachPrincipalPolicyOutput) GoString() string { + return s.String() +} + +// The input for the AttachThingPrincipal operation. +type AttachThingPrincipalInput struct { + _ struct{} `type:"structure"` + + // The principal (certificate or other credential). + Principal *string `location:"header" locationName:"x-amzn-principal" type:"string" required:"true"` + + // The name of the thing. + ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AttachThingPrincipalInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachThingPrincipalInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttachThingPrincipalInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachThingPrincipalInput"} + if s.Principal == nil { + invalidParams.Add(request.NewErrParamRequired("Principal")) + } + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the AttachThingPrincipal operation. +type AttachThingPrincipalOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AttachThingPrincipalOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachThingPrincipalOutput) GoString() string { + return s.String() +} + +// The attribute payload, a JSON string containing up to three key-value pairs +// (for example, {\"attributes\":{\"string1\":\"string2\"}}). +type AttributePayload struct { + _ struct{} `type:"structure"` + + // A JSON string containing up to three key-value pair in JSON format (for example, + // {\"attributes\":{\"string1\":\"string2\"}}). + Attributes map[string]*string `locationName:"attributes" type:"map"` +} + +// String returns the string representation +func (s AttributePayload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttributePayload) GoString() string { + return s.String() +} + +// A CA certificate. +type CACertificate struct { + _ struct{} `type:"structure"` + + // The ARN of the CA certificate. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The ID of the CA certificate. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` + + // The date the CA certificate was created. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"` + + // The status of the CA certificate. + Status *string `locationName:"status" type:"string" enum:"CACertificateStatus"` +} + +// String returns the string representation +func (s CACertificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CACertificate) GoString() string { + return s.String() +} + +// Describes a CA certificate. +type CACertificateDescription struct { + _ struct{} `type:"structure"` + + // The CA certificate ARN. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The CA certificate ID. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` + + // The CA certificate data, in PEM format. + CertificatePem *string `locationName:"certificatePem" min:"1" type:"string"` + + // The date the CA certificate was created. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"` + + // The owner of the CA certificate. + OwnedBy *string `locationName:"ownedBy" type:"string"` + + // The status of a CA certificate. + Status *string `locationName:"status" type:"string" enum:"CACertificateStatus"` +} + +// String returns the string representation +func (s CACertificateDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CACertificateDescription) GoString() string { + return s.String() +} + +// The input for the CancelCertificateTransfer operation. +type CancelCertificateTransferInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` +} + +// String returns the string representation +func (s CancelCertificateTransferInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelCertificateTransferInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelCertificateTransferInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelCertificateTransferInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type CancelCertificateTransferOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CancelCertificateTransferOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelCertificateTransferOutput) GoString() string { + return s.String() +} + +// Information about a certificate. +type Certificate struct { + _ struct{} `type:"structure"` + + // The ARN of the certificate. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The ID of the certificate. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` + + // The date and time the certificate was created. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"` + + // The status of the certificate. + Status *string `locationName:"status" type:"string" enum:"CertificateStatus"` +} + +// String returns the string representation +func (s Certificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Certificate) GoString() string { + return s.String() +} + +// Describes a certificate. +type CertificateDescription struct { + _ struct{} `type:"structure"` + + // The certificate ID of the CA certificate used to sign this certificate. + CaCertificateId *string `locationName:"caCertificateId" min:"64" type:"string"` + + // The ARN of the certificate. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The ID of the certificate. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` + + // The certificate data, in PEM format. + CertificatePem *string `locationName:"certificatePem" min:"1" type:"string"` + + // The date and time the certificate was created. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"unix"` + + // The date and time the certificate was last modified. + LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp" timestampFormat:"unix"` + + // The ID of the AWS account that owns the certificate. + OwnedBy *string `locationName:"ownedBy" type:"string"` + + // The ID of the AWS account of the previous owner of the certificate. + PreviousOwnedBy *string `locationName:"previousOwnedBy" type:"string"` + + // The status of the certificate. + Status *string `locationName:"status" type:"string" enum:"CertificateStatus"` + + // The transfer data. + TransferData *TransferData `locationName:"transferData" type:"structure"` +} + +// String returns the string representation +func (s CertificateDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CertificateDescription) GoString() string { + return s.String() +} + +// Describes an action that updates a CloudWatch alarm. +type CloudwatchAlarmAction struct { + _ struct{} `type:"structure"` + + // The CloudWatch alarm name. + AlarmName *string `locationName:"alarmName" type:"string" required:"true"` + + // The IAM role that allows access to the CloudWatch alarm. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The reason for the alarm change. + StateReason *string `locationName:"stateReason" type:"string" required:"true"` + + // The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA. + StateValue *string `locationName:"stateValue" type:"string" required:"true"` +} + +// String returns the string representation +func (s CloudwatchAlarmAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudwatchAlarmAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CloudwatchAlarmAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CloudwatchAlarmAction"} + if s.AlarmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlarmName")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.StateReason == nil { + invalidParams.Add(request.NewErrParamRequired("StateReason")) + } + if s.StateValue == nil { + invalidParams.Add(request.NewErrParamRequired("StateValue")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Describes an action that captures a CloudWatch metric. +type CloudwatchMetricAction struct { + _ struct{} `type:"structure"` + + // The CloudWatch metric name. + MetricName *string `locationName:"metricName" type:"string" required:"true"` + + // The CloudWatch metric namespace name. + MetricNamespace *string `locationName:"metricNamespace" type:"string" required:"true"` + + // An optional Unix timestamp (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp). + MetricTimestamp *string `locationName:"metricTimestamp" type:"string"` + + // The metric unit (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#Unit) + // supported by CloudWatch. + MetricUnit *string `locationName:"metricUnit" type:"string" required:"true"` + + // The CloudWatch metric value. + MetricValue *string `locationName:"metricValue" type:"string" required:"true"` + + // The IAM role that allows access to the CloudWatch metric. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s CloudwatchMetricAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudwatchMetricAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CloudwatchMetricAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CloudwatchMetricAction"} + if s.MetricName == nil { + invalidParams.Add(request.NewErrParamRequired("MetricName")) + } + if s.MetricNamespace == nil { + invalidParams.Add(request.NewErrParamRequired("MetricNamespace")) + } + if s.MetricUnit == nil { + invalidParams.Add(request.NewErrParamRequired("MetricUnit")) + } + if s.MetricValue == nil { + invalidParams.Add(request.NewErrParamRequired("MetricValue")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The input for the CreateCertificateFromCsr operation. +type CreateCertificateFromCsrInput struct { + _ struct{} `type:"structure"` + + // The certificate signing request (CSR). + CertificateSigningRequest *string `locationName:"certificateSigningRequest" min:"1" type:"string" required:"true"` + + // Specifies whether the certificate is active. + SetAsActive *bool `location:"querystring" locationName:"setAsActive" type:"boolean"` +} + +// String returns the string representation +func (s CreateCertificateFromCsrInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCertificateFromCsrInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCertificateFromCsrInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCertificateFromCsrInput"} + if s.CertificateSigningRequest == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateSigningRequest")) + } + if s.CertificateSigningRequest != nil && len(*s.CertificateSigningRequest) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateSigningRequest", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the CreateCertificateFromCsr operation. +type CreateCertificateFromCsrOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the certificate. You can use the ARN as + // a principal for policy operations. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The ID of the certificate. Certificate management operations only take a + // certificateId. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` + + // The certificate data, in PEM format. + CertificatePem *string `locationName:"certificatePem" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateCertificateFromCsrOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCertificateFromCsrOutput) GoString() string { + return s.String() +} + +// The input for the CreateKeysAndCertificate operation. +type CreateKeysAndCertificateInput struct { + _ struct{} `type:"structure"` + + // Specifies whether the certificate is active. + SetAsActive *bool `location:"querystring" locationName:"setAsActive" type:"boolean"` +} + +// String returns the string representation +func (s CreateKeysAndCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateKeysAndCertificateInput) GoString() string { + return s.String() +} + +// The output of the CreateKeysAndCertificate operation. +type CreateKeysAndCertificateOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the certificate. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The ID of the certificate. AWS IoT issues a default subject name for the + // certificate (for example, AWS IoT Certificate). + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` + + // The certificate data, in PEM format. + CertificatePem *string `locationName:"certificatePem" min:"1" type:"string"` + + // The generated key pair. + KeyPair *KeyPair `locationName:"keyPair" type:"structure"` +} + +// String returns the string representation +func (s CreateKeysAndCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateKeysAndCertificateOutput) GoString() string { + return s.String() +} + +// The input for the CreatePolicy operation. +type CreatePolicyInput struct { + _ struct{} `type:"structure"` + + // The JSON document that describes the policy. policyDocument must have a minimum + // length of 1, with a maximum length of 2048, excluding whitespace. + PolicyDocument *string `locationName:"policyDocument" type:"string" required:"true"` + + // The policy name. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePolicyInput"} + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the CreatePolicy operation. +type CreatePolicyOutput struct { + _ struct{} `type:"structure"` + + // The policy ARN. + PolicyArn *string `locationName:"policyArn" type:"string"` + + // The JSON document that describes the policy. + PolicyDocument *string `locationName:"policyDocument" type:"string"` + + // The policy name. + PolicyName *string `locationName:"policyName" min:"1" type:"string"` + + // The policy version ID. + PolicyVersionId *string `locationName:"policyVersionId" type:"string"` +} + +// String returns the string representation +func (s CreatePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyOutput) GoString() string { + return s.String() +} + +// The input for the CreatePolicyVersion operation. +type CreatePolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The JSON document that describes the policy. Minimum length of 1. Maximum + // length of 2048, excluding whitespaces + PolicyDocument *string `locationName:"policyDocument" type:"string" required:"true"` + + // The policy name. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` + + // Specifies whether the policy version is set as the default. When this parameter + // is true, the new policy version becomes the operative version (that is, the + // version that is in effect for the certificates to which the policy is attached). + SetAsDefault *bool `location:"querystring" locationName:"setAsDefault" type:"boolean"` +} + +// String returns the string representation +func (s CreatePolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePolicyVersionInput"} + if s.PolicyDocument == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyDocument")) + } + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output of the CreatePolicyVersion operation. +type CreatePolicyVersionOutput struct { + _ struct{} `type:"structure"` + + // Specifies whether the policy version is the default. + IsDefaultVersion *bool `locationName:"isDefaultVersion" type:"boolean"` + + // The policy ARN. + PolicyArn *string `locationName:"policyArn" type:"string"` + + // The JSON document that describes the policy. + PolicyDocument *string `locationName:"policyDocument" type:"string"` + + // The policy version ID. + PolicyVersionId *string `locationName:"policyVersionId" type:"string"` +} + +// String returns the string representation +func (s CreatePolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePolicyVersionOutput) GoString() string { + return s.String() +} + +// The input for the CreateThing operation. +type CreateThingInput struct { + _ struct{} `type:"structure"` + + // The attribute payload, which consists of up to 3 name/value pairs in a JSON + // document (for example, {\"attributes\":{\"string1\":\"string2\"}}). + AttributePayload *AttributePayload `locationName:"attributePayload" type:"structure"` + + // The name of the thing. + ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateThingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateThingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateThingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateThingInput"} + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output of the CreateThing operation. +type CreateThingOutput struct { + _ struct{} `type:"structure"` + + // The thing ARN. + ThingArn *string `locationName:"thingArn" type:"string"` + + // The name of the thing. + ThingName *string `locationName:"thingName" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateThingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateThingOutput) GoString() string { + return s.String() +} + +// The input for the CreateTopicRule operation. +type CreateTopicRuleInput struct { + _ struct{} `type:"structure" payload:"TopicRulePayload"` + + // The name of the rule. + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` + + // The rule payload. + TopicRulePayload *TopicRulePayload `locationName:"topicRulePayload" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateTopicRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTopicRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTopicRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTopicRuleInput"} + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.TopicRulePayload == nil { + invalidParams.Add(request.NewErrParamRequired("TopicRulePayload")) + } + if s.TopicRulePayload != nil { + if err := s.TopicRulePayload.Validate(); err != nil { + invalidParams.AddNested("TopicRulePayload", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type CreateTopicRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateTopicRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTopicRuleOutput) GoString() string { + return s.String() +} + +// Input for the DeleteCACertificate operation. +type DeleteCACertificateInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate to delete. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteCACertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCACertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCACertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCACertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output for the DeleteCACertificate operation. +type DeleteCACertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteCACertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCACertificateOutput) GoString() string { + return s.String() +} + +// The input for the DeleteCertificate operation. +type DeleteCertificateInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type DeleteCertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCertificateOutput) GoString() string { + return s.String() +} + +// The input for the DeletePolicy operation. +type DeletePolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the policy to delete. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type DeletePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyOutput) GoString() string { + return s.String() +} + +// The input for the DeletePolicyVersion operation. +type DeletePolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The name of the policy. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` + + // The policy version ID. + PolicyVersionId *string `location:"uri" locationName:"policyVersionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePolicyVersionInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.PolicyVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyVersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type DeletePolicyVersionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePolicyVersionOutput) GoString() string { + return s.String() +} + +// The input for the DeleteRegistrationCode operation. +type DeleteRegistrationCodeInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRegistrationCodeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRegistrationCodeInput) GoString() string { + return s.String() +} + +// The output for the DeleteRegistrationCode operation. +type DeleteRegistrationCodeOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRegistrationCodeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRegistrationCodeOutput) GoString() string { + return s.String() +} + +// The input for the DeleteThing operation. +type DeleteThingInput struct { + _ struct{} `type:"structure"` + + // The thing name. + ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteThingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteThingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteThingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteThingInput"} + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output of the DeleteThing operation. +type DeleteThingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteThingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteThingOutput) GoString() string { + return s.String() +} + +// The input for the DeleteTopicRule operation. +type DeleteTopicRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the rule. + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTopicRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTopicRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTopicRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTopicRuleInput"} + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type DeleteTopicRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteTopicRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTopicRuleOutput) GoString() string { + return s.String() +} + +// The input for the DescribeCACertificate operation. +type DescribeCACertificateInput struct { + _ struct{} `type:"structure"` + + // The CA certificate identifier. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeCACertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCACertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCACertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCACertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the DescribeCACertificate operation. +type DescribeCACertificateOutput struct { + _ struct{} `type:"structure"` + + // The CA certificate description. + CertificateDescription *CACertificateDescription `locationName:"certificateDescription" type:"structure"` +} + +// String returns the string representation +func (s DescribeCACertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCACertificateOutput) GoString() string { + return s.String() +} + +// The input for the DescribeCertificate operation. +type DescribeCertificateInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output of the DescribeCertificate operation. +type DescribeCertificateOutput struct { + _ struct{} `type:"structure"` + + // The description of the certificate. + CertificateDescription *CertificateDescription `locationName:"certificateDescription" type:"structure"` +} + +// String returns the string representation +func (s DescribeCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCertificateOutput) GoString() string { + return s.String() +} + +// The input for the DescribeEndpoint operation. +type DescribeEndpointInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DescribeEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointInput) GoString() string { + return s.String() +} + +// The output from the DescribeEndpoint operation. +type DescribeEndpointOutput struct { + _ struct{} `type:"structure"` + + // The endpoint. The format of the endpoint is as follows: identifier.iot.region.amazonaws.com. + EndpointAddress *string `locationName:"endpointAddress" type:"string"` +} + +// String returns the string representation +func (s DescribeEndpointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointOutput) GoString() string { + return s.String() +} + +// The input for the DescribeThing operation. +type DescribeThingInput struct { + _ struct{} `type:"structure"` + + // The name of the thing. + ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeThingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeThingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeThingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeThingInput"} + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the DescribeThing operation. +type DescribeThingOutput struct { + _ struct{} `type:"structure"` + + // The attributes, which are name/value pairs in JSON format (for example: {\"attributes\":{\"some-name1\":\"some-value1\"}, + // {\"some-name2\":\"some-value2\"}, {\"some-name3\":\"some-value3\"}}) + Attributes map[string]*string `locationName:"attributes" type:"map"` + + // The default client ID. + DefaultClientId *string `locationName:"defaultClientId" type:"string"` + + // The name of the thing. + ThingName *string `locationName:"thingName" min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeThingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeThingOutput) GoString() string { + return s.String() +} + +// The input for the DetachPrincipalPolicy operation. +type DetachPrincipalPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the policy to detach. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` + + // The principal. + // + // If the principal is a certificate, specify the certificate ARN. If the principal + // is an Amazon Cognito identity, specify the identity ID. + Principal *string `location:"header" locationName:"x-amzn-iot-principal" type:"string" required:"true"` +} + +// String returns the string representation +func (s DetachPrincipalPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachPrincipalPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachPrincipalPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachPrincipalPolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.Principal == nil { + invalidParams.Add(request.NewErrParamRequired("Principal")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type DetachPrincipalPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DetachPrincipalPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachPrincipalPolicyOutput) GoString() string { + return s.String() +} + +// The input for the DetachThingPrincipal operation. +type DetachThingPrincipalInput struct { + _ struct{} `type:"structure"` + + // The principal. + Principal *string `location:"header" locationName:"x-amzn-principal" type:"string" required:"true"` + + // The name of the thing. + ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DetachThingPrincipalInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachThingPrincipalInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetachThingPrincipalInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetachThingPrincipalInput"} + if s.Principal == nil { + invalidParams.Add(request.NewErrParamRequired("Principal")) + } + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the DetachThingPrincipal operation. +type DetachThingPrincipalOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DetachThingPrincipalOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetachThingPrincipalOutput) GoString() string { + return s.String() +} + +// The input for the DisableTopicRuleRequest operation. +type DisableTopicRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the rule to disable. + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DisableTopicRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableTopicRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisableTopicRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisableTopicRuleInput"} + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type DisableTopicRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisableTopicRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableTopicRuleOutput) GoString() string { + return s.String() +} + +// Describes an action to write to a DynamoDB table. +// +// The tableName, hashKeyField, and rangeKeyField values must match the values +// used when you created the table. +// +// The hashKeyValue and rangeKeyvalue fields use a substitution template syntax. +// These templates provide data at runtime. The syntax is as follows: ${sql-expression}. +// +// You can specify any valid expression in a WHERE or SELECT clause, including +// JSON properties, comparisons, calculations, and functions. For example, the +// following field uses the third level of the topic: +// +// "hashKeyValue": "${topic(3)}" +// +// The following field uses the timestamp: +// +// "rangeKeyValue": "${timestamp()}" +type DynamoDBAction struct { + _ struct{} `type:"structure"` + + // The hash key name. + HashKeyField *string `locationName:"hashKeyField" type:"string" required:"true"` + + // The hash key value. + HashKeyValue *string `locationName:"hashKeyValue" type:"string" required:"true"` + + // The action payload. This name can be customized. + PayloadField *string `locationName:"payloadField" type:"string"` + + // The range key name. + RangeKeyField *string `locationName:"rangeKeyField" type:"string" required:"true"` + + // The range key value. + RangeKeyValue *string `locationName:"rangeKeyValue" type:"string" required:"true"` + + // The ARN of the IAM role that grants access to the DynamoDB table. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The name of the DynamoDB table. + TableName *string `locationName:"tableName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DynamoDBAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DynamoDBAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DynamoDBAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DynamoDBAction"} + if s.HashKeyField == nil { + invalidParams.Add(request.NewErrParamRequired("HashKeyField")) + } + if s.HashKeyValue == nil { + invalidParams.Add(request.NewErrParamRequired("HashKeyValue")) + } + if s.RangeKeyField == nil { + invalidParams.Add(request.NewErrParamRequired("RangeKeyField")) + } + if s.RangeKeyValue == nil { + invalidParams.Add(request.NewErrParamRequired("RangeKeyValue")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.TableName == nil { + invalidParams.Add(request.NewErrParamRequired("TableName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Describes an action that writes data to an Amazon Elasticsearch Service; +// domain. +type ElasticsearchAction struct { + _ struct{} `type:"structure"` + + // The endpoint of your Elasticsearch domain. + Endpoint *string `locationName:"endpoint" type:"string" required:"true"` + + // The unique identifier for the document you are storing. + Id *string `locationName:"id" type:"string" required:"true"` + + // The Elasticsearch index where you want to store your data. + Index *string `locationName:"index" type:"string" required:"true"` + + // The IAM role ARN that has access to Elasticsearch. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The type of document you are storing. + Type *string `locationName:"type" type:"string" required:"true"` +} + +// String returns the string representation +func (s ElasticsearchAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ElasticsearchAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ElasticsearchAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ElasticsearchAction"} + if s.Endpoint == nil { + invalidParams.Add(request.NewErrParamRequired("Endpoint")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Index == nil { + invalidParams.Add(request.NewErrParamRequired("Index")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The input for the EnableTopicRuleRequest operation. +type EnableTopicRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the topic rule to enable. + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s EnableTopicRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableTopicRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableTopicRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableTopicRuleInput"} + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type EnableTopicRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s EnableTopicRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableTopicRuleOutput) GoString() string { + return s.String() +} + +// Describes an action that writes data to an Amazon Kinesis Firehose stream. +type FirehoseAction struct { + _ struct{} `type:"structure"` + + // The delivery stream name. + DeliveryStreamName *string `locationName:"deliveryStreamName" type:"string" required:"true"` + + // The IAM role that grants access to the Amazon Kinesis Firehost stream. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s FirehoseAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FirehoseAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FirehoseAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FirehoseAction"} + if s.DeliveryStreamName == nil { + invalidParams.Add(request.NewErrParamRequired("DeliveryStreamName")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The input for the GetLoggingOptions operation. +type GetLoggingOptionsInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetLoggingOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggingOptionsInput) GoString() string { + return s.String() +} + +// The output from the GetLoggingOptions operation. +type GetLoggingOptionsOutput struct { + _ struct{} `type:"structure"` + + // The logging level. + LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` + + // The ARN of the IAM role that grants access. + RoleArn *string `locationName:"roleArn" type:"string"` +} + +// String returns the string representation +func (s GetLoggingOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggingOptionsOutput) GoString() string { + return s.String() +} + +// The input for the GetPolicy operation. +type GetPolicyInput struct { + _ struct{} `type:"structure"` + + // The name of the policy. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPolicyInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the GetPolicy operation. +type GetPolicyOutput struct { + _ struct{} `type:"structure"` + + // The default policy version ID. + DefaultVersionId *string `locationName:"defaultVersionId" type:"string"` + + // The policy ARN. + PolicyArn *string `locationName:"policyArn" type:"string"` + + // The JSON document that describes the policy. + PolicyDocument *string `locationName:"policyDocument" type:"string"` + + // The policy name. + PolicyName *string `locationName:"policyName" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyOutput) GoString() string { + return s.String() +} + +// The input for the GetPolicyVersion operation. +type GetPolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The name of the policy. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` + + // The policy version ID. + PolicyVersionId *string `location:"uri" locationName:"policyVersionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPolicyVersionInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.PolicyVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyVersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the GetPolicyVersion operation. +type GetPolicyVersionOutput struct { + _ struct{} `type:"structure"` + + // Specifies whether the policy version is the default. + IsDefaultVersion *bool `locationName:"isDefaultVersion" type:"boolean"` + + // The policy ARN. + PolicyArn *string `locationName:"policyArn" type:"string"` + + // The JSON document that describes the policy. + PolicyDocument *string `locationName:"policyDocument" type:"string"` + + // The policy name. + PolicyName *string `locationName:"policyName" min:"1" type:"string"` + + // The policy version ID. + PolicyVersionId *string `locationName:"policyVersionId" type:"string"` +} + +// String returns the string representation +func (s GetPolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPolicyVersionOutput) GoString() string { + return s.String() +} + +// The input to the GetRegistrationCode operation. +type GetRegistrationCodeInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetRegistrationCodeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRegistrationCodeInput) GoString() string { + return s.String() +} + +// The output from the GetRegistrationCode operation. +type GetRegistrationCodeOutput struct { + _ struct{} `type:"structure"` + + // The CA certificate registration code. + RegistrationCode *string `locationName:"registrationCode" min:"64" type:"string"` +} + +// String returns the string representation +func (s GetRegistrationCodeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRegistrationCodeOutput) GoString() string { + return s.String() +} + +// The input for the GetTopicRule operation. +type GetTopicRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the rule. + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTopicRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTopicRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTopicRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTopicRuleInput"} + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the GetTopicRule operation. +type GetTopicRuleOutput struct { + _ struct{} `type:"structure"` + + // The rule. + Rule *TopicRule `locationName:"rule" type:"structure"` + + // The rule ARN. + RuleArn *string `locationName:"ruleArn" type:"string"` +} + +// String returns the string representation +func (s GetTopicRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTopicRuleOutput) GoString() string { + return s.String() +} + +// Describes a key pair. +type KeyPair struct { + _ struct{} `type:"structure"` + + // The private key. + PrivateKey *string `min:"1" type:"string"` + + // The public key. + PublicKey *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s KeyPair) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KeyPair) GoString() string { + return s.String() +} + +// Describes an action to write data to an Amazon Kinesis stream. +type KinesisAction struct { + _ struct{} `type:"structure"` + + // The partition key. + PartitionKey *string `locationName:"partitionKey" type:"string"` + + // The ARN of the IAM role that grants access to the Amazon Kinesis stream. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The name of the Amazon Kinesis stream. + StreamName *string `locationName:"streamName" type:"string" required:"true"` +} + +// String returns the string representation +func (s KinesisAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KinesisAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *KinesisAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "KinesisAction"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.StreamName == nil { + invalidParams.Add(request.NewErrParamRequired("StreamName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Describes an action to invoke a Lambda function. +type LambdaAction struct { + _ struct{} `type:"structure"` + + // The ARN of the Lambda function. + FunctionArn *string `locationName:"functionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s LambdaAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LambdaAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LambdaAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LambdaAction"} + if s.FunctionArn == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Input for the ListCACertificates operation. +type ListCACertificatesInput struct { + _ struct{} `type:"structure"` + + // Determines the order of the results. + AscendingOrder *bool `location:"querystring" locationName:"isAscendingOrder" type:"boolean"` + + // The marker for the next set of results. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The result page size. + PageSize *int64 `location:"querystring" locationName:"pageSize" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListCACertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCACertificatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCACertificatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCACertificatesInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListCACertificates operation. +type ListCACertificatesOutput struct { + _ struct{} `type:"structure"` + + // The CA certificates registered in your AWS account. + Certificates []*CACertificate `locationName:"certificates" type:"list"` + + // The current position within the list of CA certificates. + NextMarker *string `locationName:"nextMarker" type:"string"` +} + +// String returns the string representation +func (s ListCACertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCACertificatesOutput) GoString() string { + return s.String() +} + +// The input to the ListCertificatesByCA operation. +type ListCertificatesByCAInput struct { + _ struct{} `type:"structure"` + + // Specifies the order for results. If True, the results are returned in ascending + // order, based on the creation date. + AscendingOrder *bool `location:"querystring" locationName:"isAscendingOrder" type:"boolean"` + + // The ID of the CA certificate. This operation will list all registered device + // certificate that were signed by this CA certificate. + CaCertificateId *string `location:"uri" locationName:"caCertificateId" min:"64" type:"string" required:"true"` + + // The marker for the next set of results. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The result page size. + PageSize *int64 `location:"querystring" locationName:"pageSize" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListCertificatesByCAInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCertificatesByCAInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCertificatesByCAInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCertificatesByCAInput"} + if s.CaCertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CaCertificateId")) + } + if s.CaCertificateId != nil && len(*s.CaCertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CaCertificateId", 64)) + } + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output of the ListCertificatesByCA operation. +type ListCertificatesByCAOutput struct { + _ struct{} `type:"structure"` + + // The device certificates signed by the specified CA certificate. + Certificates []*Certificate `locationName:"certificates" type:"list"` + + // The marker for the next set of results, or null if there are no additional + // results. + NextMarker *string `locationName:"nextMarker" type:"string"` +} + +// String returns the string representation +func (s ListCertificatesByCAOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCertificatesByCAOutput) GoString() string { + return s.String() +} + +// The input for the ListCertificates operation. +type ListCertificatesInput struct { + _ struct{} `type:"structure"` + + // Specifies the order for results. If True, the results are returned in ascending + // order, based on the creation date. + AscendingOrder *bool `location:"querystring" locationName:"isAscendingOrder" type:"boolean"` + + // The marker for the next set of results. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The result page size. + PageSize *int64 `location:"querystring" locationName:"pageSize" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListCertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCertificatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCertificatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCertificatesInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output of the ListCertificates operation. +type ListCertificatesOutput struct { + _ struct{} `type:"structure"` + + // The descriptions of the certificates. + Certificates []*Certificate `locationName:"certificates" type:"list"` + + // The marker for the next set of results, or null if there are no additional + // results. + NextMarker *string `locationName:"nextMarker" type:"string"` +} + +// String returns the string representation +func (s ListCertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCertificatesOutput) GoString() string { + return s.String() +} + +// The input for the ListPolicies operation. +type ListPoliciesInput struct { + _ struct{} `type:"structure"` + + // Specifies the order for results. If true, the results are returned in ascending + // creation order. + AscendingOrder *bool `location:"querystring" locationName:"isAscendingOrder" type:"boolean"` + + // The marker for the next set of results. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The result page size. + PageSize *int64 `location:"querystring" locationName:"pageSize" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPoliciesInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListPolicies operation. +type ListPoliciesOutput struct { + _ struct{} `type:"structure"` + + // The marker for the next set of results, or null if there are no additional + // results. + NextMarker *string `locationName:"nextMarker" type:"string"` + + // The descriptions of the policies. + Policies []*Policy `locationName:"policies" type:"list"` +} + +// String returns the string representation +func (s ListPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPoliciesOutput) GoString() string { + return s.String() +} + +// The input for the ListPolicyVersions operation. +type ListPolicyVersionsInput struct { + _ struct{} `type:"structure"` + + // The policy name. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListPolicyVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPolicyVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPolicyVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPolicyVersionsInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListPolicyVersions operation. +type ListPolicyVersionsOutput struct { + _ struct{} `type:"structure"` + + // The policy versions. + PolicyVersions []*PolicyVersion `locationName:"policyVersions" type:"list"` +} + +// String returns the string representation +func (s ListPolicyVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPolicyVersionsOutput) GoString() string { + return s.String() +} + +// The input for the ListPrincipalPolicies operation. +type ListPrincipalPoliciesInput struct { + _ struct{} `type:"structure"` + + // Specifies the order for results. If true, results are returned in ascending + // creation order. + AscendingOrder *bool `location:"querystring" locationName:"isAscendingOrder" type:"boolean"` + + // The marker for the next set of results. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The result page size. + PageSize *int64 `location:"querystring" locationName:"pageSize" min:"1" type:"integer"` + + // The principal. + Principal *string `location:"header" locationName:"x-amzn-iot-principal" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListPrincipalPoliciesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPrincipalPoliciesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPrincipalPoliciesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPrincipalPoliciesInput"} + if s.PageSize != nil && *s.PageSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) + } + if s.Principal == nil { + invalidParams.Add(request.NewErrParamRequired("Principal")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListPrincipalPolicies operation. +type ListPrincipalPoliciesOutput struct { + _ struct{} `type:"structure"` + + // The marker for the next set of results, or null if there are no additional + // results. + NextMarker *string `locationName:"nextMarker" type:"string"` + + // The policies. + Policies []*Policy `locationName:"policies" type:"list"` +} + +// String returns the string representation +func (s ListPrincipalPoliciesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPrincipalPoliciesOutput) GoString() string { + return s.String() +} + +// The input for the ListPrincipalThings operation. +type ListPrincipalThingsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of principals to return. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // A token used to retrieve the next value. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + // The principal. + Principal *string `location:"header" locationName:"x-amzn-principal" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListPrincipalThingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPrincipalThingsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPrincipalThingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPrincipalThingsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.Principal == nil { + invalidParams.Add(request.NewErrParamRequired("Principal")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListPrincipalThings operation. +type ListPrincipalThingsOutput struct { + _ struct{} `type:"structure"` + + // A token used to retrieve the next value. + NextToken *string `locationName:"nextToken" type:"string"` + + // The things. + Things []*string `locationName:"things" type:"list"` +} + +// String returns the string representation +func (s ListPrincipalThingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPrincipalThingsOutput) GoString() string { + return s.String() +} + +// The input for the ListThingPrincipal operation. +type ListThingPrincipalsInput struct { + _ struct{} `type:"structure"` + + // The name of the thing. + ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListThingPrincipalsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListThingPrincipalsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListThingPrincipalsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListThingPrincipalsInput"} + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListThingPrincipals operation. +type ListThingPrincipalsOutput struct { + _ struct{} `type:"structure"` + + // The principals. + Principals []*string `locationName:"principals" type:"list"` +} + +// String returns the string representation +func (s ListThingPrincipalsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListThingPrincipalsOutput) GoString() string { + return s.String() +} + +// The input for the ListThings operation. +type ListThingsInput struct { + _ struct{} `type:"structure"` + + // The attribute name. + AttributeName *string `location:"querystring" locationName:"attributeName" type:"string"` + + // The attribute value. + AttributeValue *string `location:"querystring" locationName:"attributeValue" type:"string"` + + // The maximum number of results. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The token for the next value. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListThingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListThingsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListThingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListThingsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListThings operation. +type ListThingsOutput struct { + _ struct{} `type:"structure"` + + // A token used to retrieve the next value. + NextToken *string `locationName:"nextToken" type:"string"` + + // The things. + Things []*ThingAttribute `locationName:"things" type:"list"` +} + +// String returns the string representation +func (s ListThingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListThingsOutput) GoString() string { + return s.String() +} + +// The input for the ListTopicRules operation. +type ListTopicRulesInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // A token used to retrieve the next value. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + // Specifies whether the rule is disabled. + RuleDisabled *bool `location:"querystring" locationName:"ruleDisabled" type:"boolean"` + + // The topic. + Topic *string `location:"querystring" locationName:"topic" type:"string"` +} + +// String returns the string representation +func (s ListTopicRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTopicRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTopicRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTopicRulesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the ListTopicRules operation. +type ListTopicRulesOutput struct { + _ struct{} `type:"structure"` + + // A token used to retrieve the next value. + NextToken *string `locationName:"nextToken" type:"string"` + + // The rules. + Rules []*TopicRuleListItem `locationName:"rules" type:"list"` +} + +// String returns the string representation +func (s ListTopicRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTopicRulesOutput) GoString() string { + return s.String() +} + +// Describes the logging options payload. +type LoggingOptionsPayload struct { + _ struct{} `type:"structure"` + + // The logging level. + LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` + + // The ARN of the IAM role that grants access. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s LoggingOptionsPayload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoggingOptionsPayload) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LoggingOptionsPayload) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoggingOptionsPayload"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Describes an AWS IoT policy. +type Policy struct { + _ struct{} `type:"structure"` + + // The policy ARN. + PolicyArn *string `locationName:"policyArn" type:"string"` + + // The policy name. + PolicyName *string `locationName:"policyName" min:"1" type:"string"` +} + +// String returns the string representation +func (s Policy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Policy) GoString() string { + return s.String() +} + +// Describes a policy version. +type PolicyVersion struct { + _ struct{} `type:"structure"` + + // The date and time the policy was created. + CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"unix"` + + // Specifies whether the policy version is the default. + IsDefaultVersion *bool `locationName:"isDefaultVersion" type:"boolean"` + + // The policy version ID. + VersionId *string `locationName:"versionId" type:"string"` +} + +// String returns the string representation +func (s PolicyVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyVersion) GoString() string { + return s.String() +} + +// The input to the RegisterCACertificate operation. +type RegisterCACertificateInput struct { + _ struct{} `type:"structure"` + + // The CA certificate. + CaCertificate *string `locationName:"caCertificate" min:"1" type:"string" required:"true"` + + // A boolean value that specifies if the CA certificate is set to active. + SetAsActive *bool `location:"querystring" locationName:"setAsActive" type:"boolean"` + + // The private key verification certificate. + VerificationCertificate *string `locationName:"verificationCertificate" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s RegisterCACertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterCACertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterCACertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterCACertificateInput"} + if s.CaCertificate == nil { + invalidParams.Add(request.NewErrParamRequired("CaCertificate")) + } + if s.CaCertificate != nil && len(*s.CaCertificate) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CaCertificate", 1)) + } + if s.VerificationCertificate == nil { + invalidParams.Add(request.NewErrParamRequired("VerificationCertificate")) + } + if s.VerificationCertificate != nil && len(*s.VerificationCertificate) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VerificationCertificate", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the RegisterCACertificateResponse operation. +type RegisterCACertificateOutput struct { + _ struct{} `type:"structure"` + + // The CA certificate ARN. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The CA certificate identifier. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` +} + +// String returns the string representation +func (s RegisterCACertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterCACertificateOutput) GoString() string { + return s.String() +} + +// The input to the RegisterCertificate operation. +type RegisterCertificateInput struct { + _ struct{} `type:"structure"` + + // The CA certificate used to sign the device certificate being registered. + CaCertificatePem *string `locationName:"caCertificatePem" min:"1" type:"string"` + + // The certificate data, in PEM format. + CertificatePem *string `locationName:"certificatePem" min:"1" type:"string" required:"true"` + + // A boolean value that specifies if the CA certificate is set to active. + SetAsActive *bool `location:"querystring" locationName:"setAsActive" type:"boolean"` +} + +// String returns the string representation +func (s RegisterCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterCertificateInput"} + if s.CaCertificatePem != nil && len(*s.CaCertificatePem) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CaCertificatePem", 1)) + } + if s.CertificatePem == nil { + invalidParams.Add(request.NewErrParamRequired("CertificatePem")) + } + if s.CertificatePem != nil && len(*s.CertificatePem) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificatePem", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the RegisterCertificate operation. +type RegisterCertificateOutput struct { + _ struct{} `type:"structure"` + + // The certificate ARN. + CertificateArn *string `locationName:"certificateArn" type:"string"` + + // The certificate identifier. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` +} + +// String returns the string representation +func (s RegisterCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterCertificateOutput) GoString() string { + return s.String() +} + +// The input for the RejectCertificateTransfer operation. +type RejectCertificateTransferInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` + + // The reason the certificate transfer was rejected. + RejectReason *string `locationName:"rejectReason" type:"string"` +} + +// String returns the string representation +func (s RejectCertificateTransferInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectCertificateTransferInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RejectCertificateTransferInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RejectCertificateTransferInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type RejectCertificateTransferOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RejectCertificateTransferOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectCertificateTransferOutput) GoString() string { + return s.String() +} + +// The input for the ReplaceTopicRule operation. +type ReplaceTopicRuleInput struct { + _ struct{} `type:"structure" payload:"TopicRulePayload"` + + // The name of the rule. + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` + + // The rule payload. + TopicRulePayload *TopicRulePayload `locationName:"topicRulePayload" type:"structure" required:"true"` +} + +// String returns the string representation +func (s ReplaceTopicRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceTopicRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplaceTopicRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplaceTopicRuleInput"} + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.TopicRulePayload == nil { + invalidParams.Add(request.NewErrParamRequired("TopicRulePayload")) + } + if s.TopicRulePayload != nil { + if err := s.TopicRulePayload.Validate(); err != nil { + invalidParams.AddNested("TopicRulePayload", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type ReplaceTopicRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ReplaceTopicRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceTopicRuleOutput) GoString() string { + return s.String() +} + +// Describes an action to republish to another topic. +type RepublishAction struct { + _ struct{} `type:"structure"` + + // The ARN of the IAM role that grants access. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The name of the MQTT topic. + Topic *string `locationName:"topic" type:"string" required:"true"` +} + +// String returns the string representation +func (s RepublishAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RepublishAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RepublishAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RepublishAction"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.Topic == nil { + invalidParams.Add(request.NewErrParamRequired("Topic")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Describes an action to write data to an Amazon S3 bucket. +type S3Action struct { + _ struct{} `type:"structure"` + + // The Amazon S3 bucket. + BucketName *string `locationName:"bucketName" type:"string" required:"true"` + + // The object key. + Key *string `locationName:"key" type:"string" required:"true"` + + // The ARN of the IAM role that grants access. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s S3Action) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3Action) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3Action) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3Action"} + if s.BucketName == nil { + invalidParams.Add(request.NewErrParamRequired("BucketName")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The input for the SetDefaultPolicyVersion operation. +type SetDefaultPolicyVersionInput struct { + _ struct{} `type:"structure"` + + // The policy name. + PolicyName *string `location:"uri" locationName:"policyName" min:"1" type:"string" required:"true"` + + // The policy version ID. + PolicyVersionId *string `location:"uri" locationName:"policyVersionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s SetDefaultPolicyVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDefaultPolicyVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetDefaultPolicyVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetDefaultPolicyVersionInput"} + if s.PolicyName == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyName")) + } + if s.PolicyName != nil && len(*s.PolicyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) + } + if s.PolicyVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyVersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type SetDefaultPolicyVersionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetDefaultPolicyVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetDefaultPolicyVersionOutput) GoString() string { + return s.String() +} + +// The input for the SetLoggingOptions operation. +type SetLoggingOptionsInput struct { + _ struct{} `type:"structure" payload:"LoggingOptionsPayload"` + + // The logging options payload. + LoggingOptionsPayload *LoggingOptionsPayload `locationName:"loggingOptionsPayload" type:"structure" required:"true"` +} + +// String returns the string representation +func (s SetLoggingOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoggingOptionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetLoggingOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetLoggingOptionsInput"} + if s.LoggingOptionsPayload == nil { + invalidParams.Add(request.NewErrParamRequired("LoggingOptionsPayload")) + } + if s.LoggingOptionsPayload != nil { + if err := s.LoggingOptionsPayload.Validate(); err != nil { + invalidParams.AddNested("LoggingOptionsPayload", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type SetLoggingOptionsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetLoggingOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetLoggingOptionsOutput) GoString() string { + return s.String() +} + +// Describes an action to publish to an Amazon SNS topic. +type SnsAction struct { + _ struct{} `type:"structure"` + + // The message format of the message to publish. Optional. Accepted values are + // "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this + // setting to determine if the payload should be parsed and relevant platform-specific + // bits of the payload should be extracted. To read more about SNS message formats, + // see refer to their official documentation. + MessageFormat *string `locationName:"messageFormat" type:"string" enum:"MessageFormat"` + + // The ARN of the IAM role that grants access. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The ARN of the SNS topic. + TargetArn *string `locationName:"targetArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s SnsAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SnsAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SnsAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SnsAction"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.TargetArn == nil { + invalidParams.Add(request.NewErrParamRequired("TargetArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Describes an action to publish data to an Amazon SQS queue. +type SqsAction struct { + _ struct{} `type:"structure"` + + // The URL of the Amazon SQS queue. + QueueUrl *string `locationName:"queueUrl" type:"string" required:"true"` + + // The ARN of the IAM role that grants access. + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // Specifies whether to use Base64 encoding. + UseBase64 *bool `locationName:"useBase64" type:"boolean"` +} + +// String returns the string representation +func (s SqsAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SqsAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SqsAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SqsAction"} + if s.QueueUrl == nil { + invalidParams.Add(request.NewErrParamRequired("QueueUrl")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// Describes a thing attribute. +type ThingAttribute struct { + _ struct{} `type:"structure"` + + // The attributes. + Attributes map[string]*string `locationName:"attributes" type:"map"` + + // The name of the thing. + ThingName *string `locationName:"thingName" min:"1" type:"string"` +} + +// String returns the string representation +func (s ThingAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThingAttribute) GoString() string { + return s.String() +} + +// Describes a rule. +type TopicRule struct { + _ struct{} `type:"structure"` + + // The actions associated with the rule. + Actions []*Action `locationName:"actions" type:"list"` + + // The version of the SQL rules engine to use when evaluating the rule. + AwsIotSqlVersion *string `locationName:"awsIotSqlVersion" type:"string"` + + // The date and time the rule was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` + + // The description of the rule. + Description *string `locationName:"description" type:"string"` + + // Specifies whether the rule is disabled. + RuleDisabled *bool `locationName:"ruleDisabled" type:"boolean"` + + // The name of the rule. + RuleName *string `locationName:"ruleName" min:"1" type:"string"` + + // The SQL statement used to query the topic. When using a SQL query with multiple + // lines, be sure to escape the newline characters. + Sql *string `locationName:"sql" type:"string"` +} + +// String returns the string representation +func (s TopicRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicRule) GoString() string { + return s.String() +} + +// Describes a rule. +type TopicRuleListItem struct { + _ struct{} `type:"structure"` + + // The date and time the rule was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` + + // The rule ARN. + RuleArn *string `locationName:"ruleArn" type:"string"` + + // Specifies whether the rule is disabled. + RuleDisabled *bool `locationName:"ruleDisabled" type:"boolean"` + + // The name of the rule. + RuleName *string `locationName:"ruleName" min:"1" type:"string"` + + // The pattern for the topic names that apply. + TopicPattern *string `locationName:"topicPattern" type:"string"` +} + +// String returns the string representation +func (s TopicRuleListItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicRuleListItem) GoString() string { + return s.String() +} + +// Describes a rule. +type TopicRulePayload struct { + _ struct{} `type:"structure"` + + // The actions associated with the rule. + Actions []*Action `locationName:"actions" type:"list" required:"true"` + + // The version of the SQL rules engine to use when evaluating the rule. + AwsIotSqlVersion *string `locationName:"awsIotSqlVersion" type:"string"` + + // The description of the rule. + Description *string `locationName:"description" type:"string"` + + // Specifies whether the rule is disabled. + RuleDisabled *bool `locationName:"ruleDisabled" type:"boolean"` + + // The SQL statement used to query the topic. For more information, see AWS + // IoT SQL Reference (http://docs.aws.amazon.com/iot/latest/developerguide/iot-rules.html#aws-iot-sql-reference) + // in the AWS IoT Developer Guide. + Sql *string `locationName:"sql" type:"string" required:"true"` +} + +// String returns the string representation +func (s TopicRulePayload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicRulePayload) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TopicRulePayload) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TopicRulePayload"} + if s.Actions == nil { + invalidParams.Add(request.NewErrParamRequired("Actions")) + } + if s.Sql == nil { + invalidParams.Add(request.NewErrParamRequired("Sql")) + } + if s.Actions != nil { + for i, v := range s.Actions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The input for the TransferCertificate operation. +type TransferCertificateInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` + + // The AWS account. + TargetAwsAccount *string `location:"querystring" locationName:"targetAwsAccount" type:"string" required:"true"` + + // The transfer message. + TransferMessage *string `locationName:"transferMessage" type:"string"` +} + +// String returns the string representation +func (s TransferCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransferCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TransferCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransferCertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + if s.TargetAwsAccount == nil { + invalidParams.Add(request.NewErrParamRequired("TargetAwsAccount")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the TransferCertificate operation. +type TransferCertificateOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the certificate. + TransferredCertificateArn *string `locationName:"transferredCertificateArn" type:"string"` +} + +// String returns the string representation +func (s TransferCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransferCertificateOutput) GoString() string { + return s.String() +} + +// Data used to transfer a certificate to an AWS account. +type TransferData struct { + _ struct{} `type:"structure"` + + // The date the transfer was accepted. + AcceptDate *time.Time `locationName:"acceptDate" type:"timestamp" timestampFormat:"unix"` + + // The date the transfer was rejected. + RejectDate *time.Time `locationName:"rejectDate" type:"timestamp" timestampFormat:"unix"` + + // The reason why the transfer was rejected. + RejectReason *string `locationName:"rejectReason" type:"string"` + + // The date the transfer took place. + TransferDate *time.Time `locationName:"transferDate" type:"timestamp" timestampFormat:"unix"` + + // The transfer message. + TransferMessage *string `locationName:"transferMessage" type:"string"` +} + +// String returns the string representation +func (s TransferData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransferData) GoString() string { + return s.String() +} + +// The input to the UpdateCACertificate operation. +type UpdateCACertificateInput struct { + _ struct{} `type:"structure"` + + // The CA certificate identifier. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` + + // The updated status of the CA certificate. + NewStatus *string `location:"querystring" locationName:"newStatus" type:"string" required:"true" enum:"CACertificateStatus"` +} + +// String returns the string representation +func (s UpdateCACertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateCACertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateCACertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateCACertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + if s.NewStatus == nil { + invalidParams.Add(request.NewErrParamRequired("NewStatus")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type UpdateCACertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateCACertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateCACertificateOutput) GoString() string { + return s.String() +} + +// The input for the UpdateCertificate operation. +type UpdateCertificateInput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `location:"uri" locationName:"certificateId" min:"64" type:"string" required:"true"` + + // The new status. + // + // Note: Setting the status to PENDING_TRANSFER will result in an exception + // being thrown. PENDING_TRANSFER is a status used internally by AWS IoT. It + // is not intended for developer use. + NewStatus *string `location:"querystring" locationName:"newStatus" type:"string" required:"true" enum:"CertificateStatus"` +} + +// String returns the string representation +func (s UpdateCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateCertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.CertificateId != nil && len(*s.CertificateId) < 64 { + invalidParams.Add(request.NewErrParamMinLen("CertificateId", 64)) + } + if s.NewStatus == nil { + invalidParams.Add(request.NewErrParamRequired("NewStatus")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +type UpdateCertificateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateCertificateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateCertificateOutput) GoString() string { + return s.String() +} + +// The input for the UpdateThing operation. +type UpdateThingInput struct { + _ struct{} `type:"structure"` + + // The attribute payload, a JSON string containing up to three key-value pairs + // (for example, {\"attributes\":{\"string1\":\"string2\"}}). + AttributePayload *AttributePayload `locationName:"attributePayload" type:"structure" required:"true"` + + // The thing name. + ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateThingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateThingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateThingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateThingInput"} + if s.AttributePayload == nil { + invalidParams.Add(request.NewErrParamRequired("AttributePayload")) + } + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// The output from the UpdateThing operation. +type UpdateThingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateThingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateThingOutput) GoString() string { + return s.String() +} + +const ( + // @enum CACertificateStatus + CACertificateStatusActive = "ACTIVE" + // @enum CACertificateStatus + CACertificateStatusInactive = "INACTIVE" +) + +const ( + // @enum CertificateStatus + CertificateStatusActive = "ACTIVE" + // @enum CertificateStatus + CertificateStatusInactive = "INACTIVE" + // @enum CertificateStatus + CertificateStatusRevoked = "REVOKED" + // @enum CertificateStatus + CertificateStatusPendingTransfer = "PENDING_TRANSFER" + // @enum CertificateStatus + CertificateStatusRegisterInactive = "REGISTER_INACTIVE" +) + +const ( + // @enum LogLevel + LogLevelDebug = "DEBUG" + // @enum LogLevel + LogLevelInfo = "INFO" + // @enum LogLevel + LogLevelError = "ERROR" + // @enum LogLevel + LogLevelWarn = "WARN" + // @enum LogLevel + LogLevelDisabled = "DISABLED" +) + +const ( + // @enum MessageFormat + MessageFormatRaw = "RAW" + // @enum MessageFormat + MessageFormatJson = "JSON" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/iot/service.go b/vendor/github.com/aws/aws-sdk-go/service/iot/service.go new file mode 100644 index 000000000000..49cda063b3e5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/iot/service.go @@ -0,0 +1,94 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package iot + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/restjson" + "github.com/aws/aws-sdk-go/private/signer/v4" +) + +// AWS IoT provides secure, bi-directional communication between Internet-connected +// things (such as sensors, actuators, embedded devices, or smart appliances) +// and the AWS cloud. You can discover your custom IoT-Data endpoint to communicate +// with, configure rules for data processing and integration with other services, +// organize resources associated with each thing (Thing Registry), configure +// logging, and create and manage policies and credentials to authenticate things. +// +// For more information about how AWS IoT works, see the Developer Guide (http://docs.aws.amazon.com/iot/latest/developerguide/aws-iot-how-it-works.html). +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type IoT struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// A ServiceName is the name of the service the client will make API calls to. +const ServiceName = "iot" + +// New creates a new instance of the IoT client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a IoT client from just a session. +// svc := iot.New(mySession) +// +// // Create a IoT client with additional configuration +// svc := iot.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *IoT { + c := p.ClientConfig(ServiceName, cfgs...) + return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *IoT { + svc := &IoT{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + SigningName: "execute-api", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2015-05-28", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a IoT operation and runs any +// custom request initialization. +func (c *IoT) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} From 69211425fb15a97c4e631338f529c134f0fed5b3 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 16 May 2016 15:59:30 +0200 Subject: [PATCH 02/52] Add basic support for AWS IoT things --- builtin/providers/aws/config.go | 42 +++++++ builtin/providers/aws/provider.go | 1 + .../providers/aws/resource_aws_iot_thing.go | 113 ++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 builtin/providers/aws/resource_aws_iot_thing.go diff --git a/builtin/providers/aws/config.go b/builtin/providers/aws/config.go index 78fa93deb63a..809c8a9c66a8 100644 --- a/builtin/providers/aws/config.go +++ b/builtin/providers/aws/config.go @@ -48,6 +48,7 @@ import ( "github.com/aws/aws-sdk-go/service/glacier" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/inspector" + "github.com/aws/aws-sdk-go/service/iot" "github.com/aws/aws-sdk-go/service/kinesis" "github.com/aws/aws-sdk-go/service/kms" "github.com/aws/aws-sdk-go/service/lambda" @@ -161,6 +162,7 @@ type AWSClient struct { sfnconn *sfn.SFN ssmconn *ssm.SSM wafconn *waf.WAF + iotconn *iot.IoT } func (c *AWSClient) S3() *s3.S3 { @@ -274,6 +276,46 @@ func (c *Config) Client() (interface{}, error) { client.partition = partition client.accountid = accountId } + + client.apigateway = apigateway.New(sess) + client.appautoscalingconn = applicationautoscaling.New(sess) + client.autoscalingconn = autoscaling.New(sess) + client.cfconn = cloudformation.New(sess) + client.cloudfrontconn = cloudfront.New(sess) + client.cloudtrailconn = cloudtrail.New(sess) + client.cloudwatchconn = cloudwatch.New(sess) + client.cloudwatcheventsconn = cloudwatchevents.New(sess) + client.cloudwatchlogsconn = cloudwatchlogs.New(sess) + client.codecommitconn = codecommit.New(usEast1Sess) + client.codedeployconn = codedeploy.New(sess) + client.dsconn = directoryservice.New(sess) + client.dynamodbconn = dynamodb.New(dynamoSess) + client.ec2conn = ec2.New(awsEc2Sess) + client.ecrconn = ecr.New(sess) + client.ecsconn = ecs.New(sess) + client.efsconn = efs.New(sess) + client.elasticacheconn = elasticache.New(sess) + client.elasticbeanstalkconn = elasticbeanstalk.New(sess) + client.elastictranscoderconn = elastictranscoder.New(sess) + client.elbconn = elb.New(awsElbSess) + client.elbv2conn = elbv2.New(awsElbSess) + client.emrconn = emr.New(sess) + client.esconn = elasticsearch.New(sess) + client.firehoseconn = firehose.New(sess) + client.glacierconn = glacier.New(sess) + client.iotconn = iot.New(sess) + client.kinesisconn = kinesis.New(kinesisSess) + client.kmsconn = kms.New(sess) + client.lambdaconn = lambda.New(sess) + client.opsworksconn = opsworks.New(usEast1Sess) + client.r53conn = route53.New(usEast1Sess) + client.rdsconn = rds.New(sess) + client.redshiftconn = redshift.New(sess) + client.simpledbconn = simpledb.New(sess) + client.s3conn = s3.New(awsS3Sess) + client.sesConn = ses.New(sess) + client.snsconn = sns.New(sess) + client.sqsconn = sqs.New(sess) } authErr := c.ValidateAccountId(client.accountid) diff --git a/builtin/providers/aws/provider.go b/builtin/providers/aws/provider.go index ca136e200b75..cbab76502660 100644 --- a/builtin/providers/aws/provider.go +++ b/builtin/providers/aws/provider.go @@ -341,6 +341,7 @@ func Provider() terraform.ResourceProvider { "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), "aws_instance": resourceAwsInstance(), "aws_internet_gateway": resourceAwsInternetGateway(), + "aws_iot_thing": resourceAwsIotThing(), "aws_key_pair": resourceAwsKeyPair(), "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), "aws_kinesis_stream": resourceAwsKinesisStream(), diff --git a/builtin/providers/aws/resource_aws_iot_thing.go b/builtin/providers/aws/resource_aws_iot_thing.go new file mode 100644 index 000000000000..5542569c948a --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_thing.go @@ -0,0 +1,113 @@ +package aws + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iot" + "github.com/hashicorp/terraform/helper/schema" +) + +func resourceAwsIotThing() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsIotThingCreate, + Read: resourceAwsIotThingRead, + Update: resourceAwsIotThingUpdate, + Delete: resourceAwsIotThingDelete, + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "attributes": &schema.Schema{ + Type: schema.TypeMap, + Optional: true, + }, + }, + } +} + +func resourceAwsIotThingCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + params := &iot.CreateThingInput{ + ThingName: aws.String(d.Get("name").(string)), // Required + AttributePayload: &iot.AttributePayload{ + Attributes: d.Get("attributes").(map[string]*string), + }, + } + _, err := conn.CreateThing(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return err + } + + return nil +} + +func resourceAwsIotThingRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + params := &iot.DescribeThingInput{ + ThingName: aws.String(d.Get("name").(string)), // Required + } + describeThingResp, err := conn.DescribeThing(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return err + } + + d.Set("name", describeThingResp.ThingName) + d.Set("default_client_id", describeThingResp.DefaultClientId) + d.Set("attributes", describeThingResp.Attributes) + + return nil +} + +func resourceAwsIotThingUpdate(d *schema.ResourceData, meta interface{}) error { + + conn := meta.(*AWSClient).iotconn + + if d.HasChange("attributes") { + params := &iot.UpdateThingInput{ + AttributePayload: &iot.AttributePayload{ // Required + Attributes: d.Get("attributes").(map[string]*string), + }, + ThingName: aws.String(d.Get("name").(string)), // Required + } + _, err := conn.UpdateThing(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return err + } + } + return nil +} + +func resourceAwsIotThingDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + params := &iot.DeleteThingInput{ + ThingName: aws.String(d.Get("name").(string)), // Required + } + _, err := conn.DeleteThing(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return err + } + + return nil +} From 94616fd60a9d9c69fc397725b89ede79f9f7d620 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Tue, 17 May 2016 10:52:37 +0200 Subject: [PATCH 03/52] Add schemas for the remaining IoT resources --- builtin/providers/aws/provider.go | 4 + .../aws/resource_aws_iot_certificate.go | 40 +++ .../providers/aws/resource_aws_iot_policy.go | 40 +++ .../aws/resource_aws_iot_policy_attachment.go | 40 +++ .../aws/resource_aws_iot_topic_rule.go | 252 ++++++++++++++++++ 5 files changed, 376 insertions(+) create mode 100644 builtin/providers/aws/resource_aws_iot_certificate.go create mode 100644 builtin/providers/aws/resource_aws_iot_policy.go create mode 100644 builtin/providers/aws/resource_aws_iot_policy_attachment.go create mode 100644 builtin/providers/aws/resource_aws_iot_topic_rule.go diff --git a/builtin/providers/aws/provider.go b/builtin/providers/aws/provider.go index cbab76502660..bde27e772425 100644 --- a/builtin/providers/aws/provider.go +++ b/builtin/providers/aws/provider.go @@ -342,6 +342,10 @@ func Provider() terraform.ResourceProvider { "aws_instance": resourceAwsInstance(), "aws_internet_gateway": resourceAwsInternetGateway(), "aws_iot_thing": resourceAwsIotThing(), + "aws_iot_certificate": resourceAwsIotCertificate(), + "aws_iot_policy": resourceAwsIotPolicy(), + "aws_iot_policy_attachment": resourceAwsIotPolicyAttachment(), + "aws_iot_topic_rule": resourceAwsIotTopicRule(), "aws_key_pair": resourceAwsKeyPair(), "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), "aws_kinesis_stream": resourceAwsKinesisStream(), diff --git a/builtin/providers/aws/resource_aws_iot_certificate.go b/builtin/providers/aws/resource_aws_iot_certificate.go new file mode 100644 index 000000000000..90c3999c2646 --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_certificate.go @@ -0,0 +1,40 @@ +package aws + +import ( + "github.com/hashicorp/terraform/helper/schema" +) + +func resourceAwsIotCertificate() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsIotCertificateCreate, + Read: resourceAwsIotCertificateRead, + Update: resourceAwsIotCertificateUpdate, + Delete: resourceAwsIotCertificateUpdate, + Schema: map[string]*schema.Schema{ + "csr": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "active": &schema.Schema{ + Type: schema.TypeBool, + Required: true, + }, + }, + } +} + +func resourceAwsIotCertificateCreate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotCertificateRead(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotCertificateUpdate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotCertificateDelete(d *schema.ResourceData, meta interface{}) error { + return nil +} diff --git a/builtin/providers/aws/resource_aws_iot_policy.go b/builtin/providers/aws/resource_aws_iot_policy.go new file mode 100644 index 000000000000..9848d80675b7 --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_policy.go @@ -0,0 +1,40 @@ +package aws + +import ( + "github.com/hashicorp/terraform/helper/schema" +) + +func resourceAwsIotPolicy() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsIotPolicyCreate, + Read: resourceAwsIotPolicyRead, + Update: resourceAwsIotPolicyUpdate, + Delete: resourceAwsIotPolicyDelete, + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "policy": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func resourceAwsIotPolicyCreate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotPolicyUpdate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotPolicyRead(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotPolicyDelete(d *schema.ResourceData, meta interface{}) error { + return nil +} diff --git a/builtin/providers/aws/resource_aws_iot_policy_attachment.go b/builtin/providers/aws/resource_aws_iot_policy_attachment.go new file mode 100644 index 000000000000..3f6982a21c9e --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_policy_attachment.go @@ -0,0 +1,40 @@ +package aws + +import ( + "github.com/hashicorp/terraform/helper/schema" +) + +func resourceAwsIotPolicyAttachment() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsIotPolicyAttachmentCreate, + Read: resourceAwsIotPolicyAttachmentRead, + Update: resourceAwsIotPolicyAttachmentUpdate, + Delete: resourceAwsIotPolicyAttachmentDelete, + Schema: map[string]*schema.Schema{ + "principal": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "policies": &schema.Schema{ + Type: schema.TypeList, + Required: true, + }, + }, + } +} + +func resourceAwsIotPolicyAttachmentCreate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotPolicyAttachmentRead(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotPolicyAttachmentUpdate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotPolicyAttachmentDelete(d *schema.ResourceData, meta interface{}) error { + return nil +} diff --git a/builtin/providers/aws/resource_aws_iot_topic_rule.go b/builtin/providers/aws/resource_aws_iot_topic_rule.go new file mode 100644 index 000000000000..c3cf1f3091a7 --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_topic_rule.go @@ -0,0 +1,252 @@ +package aws + +import ( + "github.com/hashicorp/terraform/helper/schema" +) + +func resourceAwsIotTopicRule() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsIotTopicRuleCreate, + Read: resourceAwsIotTopicRuleRead, + Update: resourceAwsIotTopicRuleUpdate, + Delete: resourceAwsIotTopicRuleDelete, + Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, + "enabled": &schema.Schema{ + Type: schema.TypeBool, + }, + "sql": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "cloudwatch_alarm": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "alarm_name": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + "state_reason": &schema.Schema{ + Type: schema.TypeString, + }, + "state_value": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "cloudwatch_metric": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "metric_name": &schema.Schema{ + Type: schema.TypeString, + }, + "metric_namespace": &schema.Schema{ + Type: schema.TypeString, + }, + "metric_timestamp": &schema.Schema{ + Type: schema.TypeString, + }, + "metric_unit": &schema.Schema{ + Type: schema.TypeString, + }, + "metric_value": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "dynamodb": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "hash_key_field": &schema.Schema{ + Type: schema.TypeString, + }, + "hash_key_value": &schema.Schema{ + Type: schema.TypeString, + }, + "payload_field": &schema.Schema{ + Type: schema.TypeString, + }, + "range_key_field": &schema.Schema{ + Type: schema.TypeString, + }, + "range_key_value": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + "table_name": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "elasticsearch": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "endpoint": &schema.Schema{ + Type: schema.TypeString, + }, + "id": &schema.Schema{ + Type: schema.TypeString, + }, + "index": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + "type": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "firehose": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "delivery_stream_name": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "kinesis": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "partition_key": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + "stream_name": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "lambda": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "function_arn": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "republish": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + "topic": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "s3": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket_name": &schema.Schema{ + Type: schema.TypeString, + }, + "key": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "sns": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "message_format": &schema.Schema{ + Type: schema.TypeString, + }, + "target_arn": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + "sqs": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "queue_url": &schema.Schema{ + Type: schema.TypeString, + }, + "role_arn": &schema.Schema{ + Type: schema.TypeString, + }, + "use_base64": &schema.Schema{ + Type: schema.TypeBool, + }, + }, + }, + }, + }, + } +} + +func resourceAwsIotTopicRuleCreate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotTopicRuleRead(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotTopicRuleUpdate(d *schema.ResourceData, meta interface{}) error { + return nil +} + +func resourceAwsIotTopicRuleDelete(d *schema.ResourceData, meta interface{}) error { + return nil +} From b7e06081a177f1f38661438d70cae86452711296 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 16:35:23 +0200 Subject: [PATCH 04/52] Get principals support working --- .../providers/aws/resource_aws_iot_thing.go | 91 ++++++++++++++----- 1 file changed, 68 insertions(+), 23 deletions(-) diff --git a/builtin/providers/aws/resource_aws_iot_thing.go b/builtin/providers/aws/resource_aws_iot_thing.go index 5542569c948a..205658042161 100644 --- a/builtin/providers/aws/resource_aws_iot_thing.go +++ b/builtin/providers/aws/resource_aws_iot_thing.go @@ -1,7 +1,7 @@ package aws import ( - "fmt" + "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" @@ -20,6 +20,13 @@ func resourceAwsIotThing() *schema.Resource { Required: true, ForceNew: true, }, + "principals": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "attributes": &schema.Schema{ Type: schema.TypeMap, Optional: true, @@ -31,42 +38,69 @@ func resourceAwsIotThing() *schema.Resource { func resourceAwsIotThingCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iotconn + thingName := d.Get("name").(string) + + attributes := make(map[string]*string) + + if attrs, ok := d.GetOk("attributes"); ok { + for k, v := range attrs.(map[string]interface{}) { + attributes[k] = new(string) + *attributes[k] = v.(string) + } + } + params := &iot.CreateThingInput{ - ThingName: aws.String(d.Get("name").(string)), // Required + ThingName: aws.String(thingName), // Required AttributePayload: &iot.AttributePayload{ - Attributes: d.Get("attributes").(map[string]*string), + Attributes: attributes, }, } - _, err := conn.CreateThing(params) + + log.Printf("[DEBUG] Creating IoT thing %s", thingName) + out, err := conn.CreateThing(params) if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) + log.Printf("[ERROR] %s", err) return err } + log.Printf("[DEBUG] IoT thing %s created", *out.ThingArn) + + for _, p := range d.Get("principals").([]string) { + _, err := conn.AttachThingPrincipal(&iot.AttachThingPrincipalInput{ + ThingName: aws.String(thingName), + Principal: aws.String(p), + }) + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + } + + d.SetId(*out.ThingName) + d.Set("name", *out.ThingName) + return nil } func resourceAwsIotThingRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iotconn + thingName := d.Get("name").(string) params := &iot.DescribeThingInput{ - ThingName: aws.String(d.Get("name").(string)), // Required + ThingName: aws.String(thingName), // Required } - describeThingResp, err := conn.DescribeThing(params) + log.Printf("[DEBUG] Reading IoT thing %s", thingName) + out, err := conn.DescribeThing(params) if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) return err } + log.Printf("[DEBUG] Received IoT thing: %s", out.ThingName) - d.Set("name", describeThingResp.ThingName) - d.Set("default_client_id", describeThingResp.DefaultClientId) - d.Set("attributes", describeThingResp.Attributes) + d.SetId(*out.ThingName) + d.Set("default_client_id", *out.DefaultClientId) + d.Set("attributes", aws.StringValueMap(out.Attributes)) return nil } @@ -76,18 +110,23 @@ func resourceAwsIotThingUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iotconn if d.HasChange("attributes") { + attributes := make(map[string]*string) + + if attrs, ok := d.GetOk("attributes"); ok { + for k, v := range attrs.(map[string]interface{}) { + attributes[k] = new(string) + *attributes[k] = v.(string) + } + } params := &iot.UpdateThingInput{ AttributePayload: &iot.AttributePayload{ // Required - Attributes: d.Get("attributes").(map[string]*string), + Attributes: attributes, }, ThingName: aws.String(d.Get("name").(string)), // Required } _, err := conn.UpdateThing(params) if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) return err } } @@ -97,15 +136,21 @@ func resourceAwsIotThingUpdate(d *schema.ResourceData, meta interface{}) error { func resourceAwsIotThingDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iotconn + thingName := aws.String(d.Get("name").(string)) + + for _, p := range d.Get("principals").([]string) { + conn.DetachThingPrincipal(&iot.DetachThingPrincipalInput{ + ThingName: thingName, + Principal: aws.String(p), + }) + } + params := &iot.DeleteThingInput{ - ThingName: aws.String(d.Get("name").(string)), // Required + ThingName: thingName, // Required } _, err := conn.DeleteThing(params) if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) return err } From d49b60b5345f372d52af4d0e8a37891b0b1626bb Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 17:12:24 +0200 Subject: [PATCH 05/52] Implement IoT certificate functionality --- .../aws/resource_aws_iot_certificate.go | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/builtin/providers/aws/resource_aws_iot_certificate.go b/builtin/providers/aws/resource_aws_iot_certificate.go index 90c3999c2646..ccd21ffe9522 100644 --- a/builtin/providers/aws/resource_aws_iot_certificate.go +++ b/builtin/providers/aws/resource_aws_iot_certificate.go @@ -1,6 +1,10 @@ package aws import ( + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/terraform/helper/schema" ) @@ -24,17 +28,95 @@ func resourceAwsIotCertificate() *schema.Resource { } func resourceAwsIotCertificateCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + log.Printf("[DEBUG] Creating certificate from csr") + out, err := conn.CreateCertificateFromCsr(&iot.CreateCertificateFromCsrInput{ + CertificateSigningRequest: aws.String(d.Get("csr").(string)), + SetAsActive: aws.Bool(d.Get("active").(bool)), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + log.Printf("[DEBUG] Created certificate from csr") + + d.SetId(*out.CertificateId) + d.Set("arn", *out.CertificateArn) + d.Set("pem", *out.CertificatePem) + return nil } func resourceAwsIotCertificateRead(d *schema.ResourceData, meta interface{}) error { + + conn := meta.(*AWSClient).iotconn + + out, err := conn.DescribeCertificate(&iot.DescribeCertificateInput{ + CertificateId: aws.String(d.Id()), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + + d.SetId(*out.CertificateDescription.CertificateId) + d.Set("arn", *out.CertificateDescription.CertificateArn) + d.Set("pem", *out.CertificateDescription.CertificatePem) + return nil } func resourceAwsIotCertificateUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + if d.HasChange("csr") { + //TODO: Create new certificate + } else { + + // What about a status like REVOKED etc. ?? + status := "INACTIVE" + if d.Get("active").(bool) { + status = "ACTIVE" + } + + _, err := conn.UpdateCertificate(&iot.UpdateCertificateInput{ + CertificateId: aws.String(d.Id()), + NewStatus: aws.String(status), + }) + + if err != nil { + return err + } + } + return nil } func resourceAwsIotCertificateDelete(d *schema.ResourceData, meta interface{}) error { + + conn := meta.(*AWSClient).iotconn + + _, err := conn.UpdateCertificate(&iot.UpdateCertificateInput{ + CertificateId: aws.String(d.Id()), + NewStatus: aws.String("INACTIVE"), + }) + + if err != nil { + log.Printf("[ERROR], %s", err) + return err + } + + _, err = conn.DeleteCertificate(&iot.DeleteCertificateInput{ + CertificateId: aws.String(d.Id()), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + return nil } From 9bcc40e326869982902bf53d7d648fa75112d1ff Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 17:46:09 +0200 Subject: [PATCH 06/52] Implement IoT policy functionality --- .../providers/aws/resource_aws_iot_policy.go | 95 ++++++++++++++++++- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_iot_policy.go b/builtin/providers/aws/resource_aws_iot_policy.go index 9848d80675b7..a4f6fb6fff1b 100644 --- a/builtin/providers/aws/resource_aws_iot_policy.go +++ b/builtin/providers/aws/resource_aws_iot_policy.go @@ -1,6 +1,10 @@ package aws import ( + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/terraform/helper/schema" ) @@ -24,17 +28,104 @@ func resourceAwsIotPolicy() *schema.Resource { } func resourceAwsIotPolicyCreate(d *schema.ResourceData, meta interface{}) error { + + conn := meta.(*AWSClient).iotconn + + _, err := conn.CreatePolicy(&iot.CreatePolicyInput{ + PolicyName: aws.String(d.Get("name")), + PolicyDocument: aws.String(d.Get("policy")), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + + d.SetId(*out.PolicyName) + d.Set("arn", *out.PolicyArn) + d.Set("defaultVersionId", *out.PolicyVersionId) + return nil } -func resourceAwsIotPolicyUpdate(d *schema.ResourceData, meta interface{}) error { +func resourceAwsIotPolicyRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + out, err := conn.GetPolicy(&iot.GetPolicyInput{ + PolicyName: aws.String(d.Id()), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + + d.SetId(*out.PolicyName) + d.Set("arn", *out.PolicyArn) + d.Set("defaultVersionId", *out.DefaultVersionId) + return nil } -func resourceAwsIotPolicyRead(d *schema.ResourceData, meta interface{}) error { +func resourceAwsIotPolicyUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + //TODO: prune old versions + + if d.HasChange("policy") { + out, err := conn.CreatePolicyVersion(&iot.CreatePolicyVersionInput{ + PolicyName: aws.String(d.Id()), + PolicyDocument: aws.String(d.Get("policy")), + SetAsDefault: true, + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + + d.Set("arn", *out.PolicyArn) + d.Set("defaultVersionId", *out.PolicyVersionId) + } + return nil } func resourceAwsIotPolicyDelete(d *schema.ResourceData, meta interface{}) error { + + conn := meta.(*AWSClient).iotconn + + out, err := conn.ListPolicyVersions(&iot.ListPolicyVersionsInput{ + PolicyName: aws.String(d.Id()), + }) + + if err != nil { + return err + } + + // Delete all non-default versions of the policy + for _, ver := range out.PolicyVersions { + if !ver.IsDefaultVersion { + _, err = conn.DeletePolicyVersion(&iot.DeletePolicyVersionInput{ + PolicyName: aws.String(d.Id()), + PolicyVersionId: ver.VersionId, + }) + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + } + } + + //Delete default policy version + _, err = conn.DeletePolicy(&iot.DeletePolicyInput{ + PolicyName: aws.String(d.Id()), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + return nil } From e6ace1ef4839d01a1e18ff9c326dd25b723aa109 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 18:13:15 +0200 Subject: [PATCH 07/52] Make IoT policy implementation compile --- builtin/providers/aws/resource_aws_iot_policy.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/providers/aws/resource_aws_iot_policy.go b/builtin/providers/aws/resource_aws_iot_policy.go index a4f6fb6fff1b..49fd6a1715a7 100644 --- a/builtin/providers/aws/resource_aws_iot_policy.go +++ b/builtin/providers/aws/resource_aws_iot_policy.go @@ -31,9 +31,9 @@ func resourceAwsIotPolicyCreate(d *schema.ResourceData, meta interface{}) error conn := meta.(*AWSClient).iotconn - _, err := conn.CreatePolicy(&iot.CreatePolicyInput{ - PolicyName: aws.String(d.Get("name")), - PolicyDocument: aws.String(d.Get("policy")), + out, err := conn.CreatePolicy(&iot.CreatePolicyInput{ + PolicyName: aws.String(d.Get("name").(string)), + PolicyDocument: aws.String(d.Get("policy").(string)), }) if err != nil { @@ -75,8 +75,8 @@ func resourceAwsIotPolicyUpdate(d *schema.ResourceData, meta interface{}) error if d.HasChange("policy") { out, err := conn.CreatePolicyVersion(&iot.CreatePolicyVersionInput{ PolicyName: aws.String(d.Id()), - PolicyDocument: aws.String(d.Get("policy")), - SetAsDefault: true, + PolicyDocument: aws.String(d.Get("policy").(string)), + SetAsDefault: aws.Bool(true), }) if err != nil { @@ -105,7 +105,7 @@ func resourceAwsIotPolicyDelete(d *schema.ResourceData, meta interface{}) error // Delete all non-default versions of the policy for _, ver := range out.PolicyVersions { - if !ver.IsDefaultVersion { + if !*ver.IsDefaultVersion { _, err = conn.DeletePolicyVersion(&iot.DeletePolicyVersionInput{ PolicyName: aws.String(d.Id()), PolicyVersionId: ver.VersionId, From fbab5876d586b02daa0499e8292b4aa1d5fac822 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 18:13:43 +0200 Subject: [PATCH 08/52] Add some implementation for IoT policy attachment --- .../aws/resource_aws_iot_policy_attachment.go | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/builtin/providers/aws/resource_aws_iot_policy_attachment.go b/builtin/providers/aws/resource_aws_iot_policy_attachment.go index 3f6982a21c9e..960806e5c7d7 100644 --- a/builtin/providers/aws/resource_aws_iot_policy_attachment.go +++ b/builtin/providers/aws/resource_aws_iot_policy_attachment.go @@ -1,6 +1,10 @@ package aws import ( + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/terraform/helper/schema" ) @@ -18,23 +22,73 @@ func resourceAwsIotPolicyAttachment() *schema.Resource { "policies": &schema.Schema{ Type: schema.TypeList, Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, }, }, } } func resourceAwsIotPolicyAttachmentCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + for _, p := range d.Get("policies").([]string) { + _, err := conn.AttachPrincipalPolicy(&iot.AttachPrincipalPolicyInput{ + Principal: aws.String(d.Get("principal").(string)), + PolicyName: aws.String(p), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + } + return nil } func resourceAwsIotPolicyAttachmentRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + out, err := conn.ListPrincipalPolicies(&iot.ListPrincipalPoliciesInput{ + Principal: aws.String(d.Get("principal").(string)), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + + length := len(out.Policies) + policies := make([]string, length) + for i, p := range out.Policies { + policies[i] = *p.PolicyName + } + + d.Set("policies", policies) + return nil } func resourceAwsIotPolicyAttachmentUpdate(d *schema.ResourceData, meta interface{}) error { + //TODO: implement return nil } func resourceAwsIotPolicyAttachmentDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + for _, p := range d.Get("policies").([]string) { + _, err := conn.DetachPrincipalPolicy(&iot.DetachPrincipalPolicyInput{ + Principal: aws.String(d.Get("principal").(string)), + PolicyName: aws.String(p), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + } return nil } From 29bb0996f739fe5047296580687e1d8cfacf6edb Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 18:15:27 +0200 Subject: [PATCH 09/52] Correct schema description of IoT topic rule --- .../aws/resource_aws_iot_topic_rule.go | 120 ++++++++++++------ 1 file changed, 80 insertions(+), 40 deletions(-) diff --git a/builtin/providers/aws/resource_aws_iot_topic_rule.go b/builtin/providers/aws/resource_aws_iot_topic_rule.go index c3cf1f3091a7..8fc0f7d12232 100644 --- a/builtin/providers/aws/resource_aws_iot_topic_rule.go +++ b/builtin/providers/aws/resource_aws_iot_topic_rule.go @@ -20,7 +20,8 @@ func resourceAwsIotTopicRule() *schema.Resource { Optional: true, }, "enabled": &schema.Schema{ - Type: schema.TypeBool, + Type: schema.TypeBool, + Optional: true, }, "sql": &schema.Schema{ Type: schema.TypeString, @@ -32,16 +33,20 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "alarm_name": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "state_reason": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "state_value": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -52,22 +57,28 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "metric_name": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "metric_namespace": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "metric_timestamp": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "metric_unit": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "metric_value": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -78,25 +89,32 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "hash_key_field": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "hash_key_value": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "payload_field": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "range_key_field": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "range_key_value": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "table_name": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -107,19 +125,24 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "endpoint": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "id": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "index": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "type": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -130,10 +153,12 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "delivery_stream_name": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -144,13 +169,16 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "partition_key": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "stream_name": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -161,7 +189,8 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "function_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -172,10 +201,12 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "topic": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -186,13 +217,16 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket_name": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "key": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -203,13 +237,16 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "message_format": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "target_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, }, }, @@ -220,13 +257,16 @@ func resourceAwsIotTopicRule() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "queue_url": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "role_arn": &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + Required: true, }, "use_base64": &schema.Schema{ - Type: schema.TypeBool, + Type: schema.TypeBool, + Required: true, }, }, }, From 5320b3b0cbb44fbd8306920509c3dc4384344c6c Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 18:20:34 +0200 Subject: [PATCH 10/52] Add tests for AWS IoT thing --- .../aws/resource_aws_iot_thing_test.go | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 builtin/providers/aws/resource_aws_iot_thing_test.go diff --git a/builtin/providers/aws/resource_aws_iot_thing_test.go b/builtin/providers/aws/resource_aws_iot_thing_test.go new file mode 100644 index 000000000000..67f9ac7d1e60 --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_thing_test.go @@ -0,0 +1,130 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/iot" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccAWSIoTThing_basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIoTThingDestroy_basic, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSIoTThing_basic, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIotThingExists_basic("aws_iot_thing.foo"), + ), + }, + }, + }) +} + +func testAccCheckAWSIoTThingDestroy_basic(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).iotconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_iot_thing" { + continue + } + + out, err := conn.ListThings(&iot.ListThingsInput{}) + + if err != nil { + return err + } + + for _, t := range out.Things { + if *t.ThingName == rs.Primary.ID { + return fmt.Errorf("IoT thing still exists:\n%s", t) + } + } + + } + + return nil +} + +func testAccCheckAWSIotThingExists_basic(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + _, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + return nil + } +} + +func TestAccAWSIoTThing_attributes(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIoTThingDestroy_attributes, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSIoTThing_attributes, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIotThingExists_attributes("aws_iot_thing.foo"), + ), + }, + }, + }) +} + +func testAccCheckAWSIoTThingDestroy_attributes(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).iotconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_iot_thing" { + continue + } + + out, err := conn.ListThings(&iot.ListThingsInput{}) + + if err != nil { + return err + } + + for _, t := range out.Things { + if *t.ThingName == rs.Primary.ID { + return fmt.Errorf("IoT thing still exists:\n%s", t) + } + } + + } + + return nil +} + +func testAccCheckAWSIotThingExists_attributes(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + _, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + return nil + } +} + +var testAccAWSIoTThing_basic = ` +resource "aws_iot_thing" "foo" { + name = "foo-thing" +} +` +var testAccAWSIoTThing_attributes = ` +resource "aws_iot_thing" "foo" { + name = "foo-thing" + + attributes { + key1 = "val1" + key2 = "val2" + } +} +` From 30bd454430260c1eb05e61f8cc75fbf3efbd6974 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 19:01:46 +0200 Subject: [PATCH 11/52] Do not store pem of cert --- builtin/providers/aws/resource_aws_iot_certificate.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_iot_certificate.go b/builtin/providers/aws/resource_aws_iot_certificate.go index ccd21ffe9522..2bad57f4f5a5 100644 --- a/builtin/providers/aws/resource_aws_iot_certificate.go +++ b/builtin/providers/aws/resource_aws_iot_certificate.go @@ -44,7 +44,6 @@ func resourceAwsIotCertificateCreate(d *schema.ResourceData, meta interface{}) e d.SetId(*out.CertificateId) d.Set("arn", *out.CertificateArn) - d.Set("pem", *out.CertificatePem) return nil } @@ -64,7 +63,6 @@ func resourceAwsIotCertificateRead(d *schema.ResourceData, meta interface{}) err d.SetId(*out.CertificateDescription.CertificateId) d.Set("arn", *out.CertificateDescription.CertificateArn) - d.Set("pem", *out.CertificateDescription.CertificatePem) return nil } From 5aec61985740e6f4f2d4177ae4297792e47ad93b Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Sat, 28 May 2016 19:02:10 +0200 Subject: [PATCH 12/52] Force recreation of cert if CSR has changed --- .../aws/resource_aws_iot_certificate.go | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_iot_certificate.go b/builtin/providers/aws/resource_aws_iot_certificate.go index 2bad57f4f5a5..f49cb089f86d 100644 --- a/builtin/providers/aws/resource_aws_iot_certificate.go +++ b/builtin/providers/aws/resource_aws_iot_certificate.go @@ -71,7 +71,35 @@ func resourceAwsIotCertificateUpdate(d *schema.ResourceData, meta interface{}) e conn := meta.(*AWSClient).iotconn if d.HasChange("csr") { - //TODO: Create new certificate + //Make old cert inactive + _, err := conn.UpdateCertificate(&iot.UpdateCertificateInput{ + CertificateId: aws.String(d.Id()), + NewStatus: aws.String("INACTIVE"), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return nil + } + + //TODO: Remove old cert?? + //conn.DeleteCertificate(&iot.DeleteCertificateInput{ + // CertificateId: aws.String(d.Id()), + //}) + + out, err := conn.CreateCertificateFromCsr(&iot.CreateCertificateFromCsrInput{ + CertificateSigningRequest: aws.String(d.Get("csr").(string)), + SetAsActive: aws.Bool(d.Get("active")), + }) + + if err != nil { + log.Printf("[ERROR] %s", err) + return err + } + + d.SetId(*out.CertificateId) + d.Set("arn", *out.CertificateArn) + } else { // What about a status like REVOKED etc. ?? From 2315b7d390010283379bed799036809de96ba8de Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 30 May 2016 09:46:36 +0200 Subject: [PATCH 13/52] Fixes for IoT certificate --- builtin/providers/aws/resource_aws_iot_certificate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_iot_certificate.go b/builtin/providers/aws/resource_aws_iot_certificate.go index f49cb089f86d..c7d1f17babaa 100644 --- a/builtin/providers/aws/resource_aws_iot_certificate.go +++ b/builtin/providers/aws/resource_aws_iot_certificate.go @@ -89,7 +89,7 @@ func resourceAwsIotCertificateUpdate(d *schema.ResourceData, meta interface{}) e out, err := conn.CreateCertificateFromCsr(&iot.CreateCertificateFromCsrInput{ CertificateSigningRequest: aws.String(d.Get("csr").(string)), - SetAsActive: aws.Bool(d.Get("active")), + SetAsActive: aws.Bool(d.Get("active").(bool)), }) if err != nil { From b468cc78f60d0a7bd4139c1971efbdce410b81ad Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 30 May 2016 09:47:06 +0200 Subject: [PATCH 14/52] Add sql version to schema of IoT topic rule --- builtin/providers/aws/resource_aws_iot_topic_rule.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/aws/resource_aws_iot_topic_rule.go b/builtin/providers/aws/resource_aws_iot_topic_rule.go index 8fc0f7d12232..c51c2dcda2f8 100644 --- a/builtin/providers/aws/resource_aws_iot_topic_rule.go +++ b/builtin/providers/aws/resource_aws_iot_topic_rule.go @@ -27,6 +27,10 @@ func resourceAwsIotTopicRule() *schema.Resource { Type: schema.TypeString, Required: true, }, + "sql_version": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, "cloudwatch_alarm": &schema.Schema{ Type: schema.TypeSet, Optional: true, From 178e233eafcefb7a038c6b7e47b1ff2fa76c1ece Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 30 May 2016 12:08:58 +0200 Subject: [PATCH 15/52] Add tests for aws iot certificate --- .../aws/resource_aws_iot_certificate.go | 6 +- .../aws/resource_aws_iot_certificate_test.go | 69 +++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 builtin/providers/aws/resource_aws_iot_certificate_test.go diff --git a/builtin/providers/aws/resource_aws_iot_certificate.go b/builtin/providers/aws/resource_aws_iot_certificate.go index c7d1f17babaa..cdefa995dfbb 100644 --- a/builtin/providers/aws/resource_aws_iot_certificate.go +++ b/builtin/providers/aws/resource_aws_iot_certificate.go @@ -13,7 +13,7 @@ func resourceAwsIotCertificate() *schema.Resource { Create: resourceAwsIotCertificateCreate, Read: resourceAwsIotCertificateRead, Update: resourceAwsIotCertificateUpdate, - Delete: resourceAwsIotCertificateUpdate, + Delete: resourceAwsIotCertificateDelete, Schema: map[string]*schema.Schema{ "csr": &schema.Schema{ Type: schema.TypeString, @@ -23,6 +23,10 @@ func resourceAwsIotCertificate() *schema.Resource { Type: schema.TypeBool, Required: true, }, + "arn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } diff --git a/builtin/providers/aws/resource_aws_iot_certificate_test.go b/builtin/providers/aws/resource_aws_iot_certificate_test.go new file mode 100644 index 000000000000..ab08017b4021 --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_certificate_test.go @@ -0,0 +1,69 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/iot" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccAWSIoTCertificate_basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIoTCertificateDestroy_basic, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSIoTCertificate_basic, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIoTCertificateExists_basic("aws_iot_certificate.foo_cert"), + ), + }, + }, + }) +} + +func testAccCheckAWSIoTCertificateDestroy_basic(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).iotconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_iot_certificate" { + continue + } + + out, err := conn.ListCertificates(&iot.ListCertificatesInput{}) + + if err != nil { + return err + } + + for _, t := range out.Certificates { + if *t.CertificateId == rs.Primary.ID { + return fmt.Errorf("IoT certificate still exists:\n%s", t) + } + } + + } + + return nil +} + +func testAccCheckAWSIoTCertificateExists_basic(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + _, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + return nil + } +} + +var testAccAWSIoTCertificate_basic = ` +resource "aws_iot_certificate" "foo_cert" { + csr = "${file("./csr.pem")}" + active = true +} +` From 902637a42e8a3897c041ceed76a4daf5d72f018f Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 30 May 2016 12:09:28 +0200 Subject: [PATCH 16/52] More tests for aws iot thing --- .../aws/resource_aws_iot_thing_test.go | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/builtin/providers/aws/resource_aws_iot_thing_test.go b/builtin/providers/aws/resource_aws_iot_thing_test.go index 67f9ac7d1e60..50fe3784ff0d 100644 --- a/builtin/providers/aws/resource_aws_iot_thing_test.go +++ b/builtin/providers/aws/resource_aws_iot_thing_test.go @@ -113,6 +113,58 @@ func testAccCheckAWSIotThingExists_attributes(name string) resource.TestCheckFun } } +func TestAccAWSIoTThing_principal(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIoTThingDestroy_principal, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSIoTThing_principal, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIotThingExists_principal("aws_iot_thing.device3"), + ), + }, + }, + }) +} + +func testAccCheckAWSIoTThingDestroy_principal(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).iotconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_iot_thing" { + continue + } + + out, err := conn.ListThings(&iot.ListThingsInput{}) + + if err != nil { + return err + } + + for _, t := range out.Things { + if *t.ThingName == rs.Primary.ID { + return fmt.Errorf("IoT thing still exists:\n%s", t) + } + } + + } + + return nil +} + +func testAccCheckAWSIotThingExists_principal(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + _, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + return nil + } +} + var testAccAWSIoTThing_basic = ` resource "aws_iot_thing" "foo" { name = "foo-thing" @@ -128,3 +180,21 @@ resource "aws_iot_thing" "foo" { } } ` + +var testAccAWSIoTThing_principal = ` +resource "aws_iot_thing" "device3" { + name = "MyDevice3" + principals = ["${aws_iot_certificate.cert.arn}"] + + attributes { + Manufacturer = "Amazon" + Type = "IoT Device A" + SerialNumber = "10293847562912" + } +} + +resource "aws_iot_certificate" "cert" { + csr = "${file("./csr.pem")}" + active = true +} +` From 4286d083c75c65e80fd5d72679ba8f3157f5f332 Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 30 May 2016 12:09:53 +0200 Subject: [PATCH 17/52] Add aws iot policy test --- .../aws/resource_aws_iot_policy_test.go | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 builtin/providers/aws/resource_aws_iot_policy_test.go diff --git a/builtin/providers/aws/resource_aws_iot_policy_test.go b/builtin/providers/aws/resource_aws_iot_policy_test.go new file mode 100644 index 000000000000..ff60cb1eb982 --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_policy_test.go @@ -0,0 +1,79 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/iot" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccAWSIoTPolicy_basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIoTPolicyDestroy_basic, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSIoTPolicy_basic, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIoTPolicyExists_basic("aws_iot_policy.pubsub"), + ), + }, + }, + }) +} + +func testAccCheckAWSIoTPolicyDestroy_basic(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).iotconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_iot_policy" { + continue + } + + out, err := conn.ListPolicies(&iot.ListPoliciesInput{}) + + if err != nil { + return err + } + + for _, t := range out.Policies { + if *t.PolicyName == rs.Primary.ID { + return fmt.Errorf("IoT policy still exists:\n%s", t) + } + } + + } + + return nil +} + +func testAccCheckAWSIoTPolicyExists_basic(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + _, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + return nil + } +} + +var testAccAWSIoTPolicy_basic = ` +resource "aws_iot_policy" "pubsub" { + name = "PubSubToAnyTopic" + policy = < Date: Mon, 30 May 2016 12:11:39 +0200 Subject: [PATCH 18/52] Some fixes for iot policy attachment --- .../aws/resource_aws_iot_policy_attachment.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/providers/aws/resource_aws_iot_policy_attachment.go b/builtin/providers/aws/resource_aws_iot_policy_attachment.go index 960806e5c7d7..148a03eb26df 100644 --- a/builtin/providers/aws/resource_aws_iot_policy_attachment.go +++ b/builtin/providers/aws/resource_aws_iot_policy_attachment.go @@ -20,7 +20,7 @@ func resourceAwsIotPolicyAttachment() *schema.Resource { Required: true, }, "policies": &schema.Schema{ - Type: schema.TypeList, + Type: schema.TypeSet, Required: true, Elem: &schema.Schema{ Type: schema.TypeString, @@ -33,10 +33,10 @@ func resourceAwsIotPolicyAttachment() *schema.Resource { func resourceAwsIotPolicyAttachmentCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iotconn - for _, p := range d.Get("policies").([]string) { + for _, p := range d.Get("policies").(*schema.Set).List() { _, err := conn.AttachPrincipalPolicy(&iot.AttachPrincipalPolicyInput{ Principal: aws.String(d.Get("principal").(string)), - PolicyName: aws.String(p), + PolicyName: aws.String(p.(string)), }) if err != nil { @@ -79,10 +79,10 @@ func resourceAwsIotPolicyAttachmentUpdate(d *schema.ResourceData, meta interface func resourceAwsIotPolicyAttachmentDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iotconn - for _, p := range d.Get("policies").([]string) { + for _, p := range d.Get("policies").(*schema.Set).List() { _, err := conn.DetachPrincipalPolicy(&iot.DetachPrincipalPolicyInput{ Principal: aws.String(d.Get("principal").(string)), - PolicyName: aws.String(p), + PolicyName: aws.String(p.(string)), }) if err != nil { From c78505066c6f67c2cb4780b9e8b9de3a430dd79b Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 30 May 2016 12:49:27 +0200 Subject: [PATCH 19/52] Implement functionality for IoT topic rule --- .../aws/resource_aws_iot_topic_rule.go | 225 ++++++++++++++++++ 1 file changed, 225 insertions(+) diff --git a/builtin/providers/aws/resource_aws_iot_topic_rule.go b/builtin/providers/aws/resource_aws_iot_topic_rule.go index c51c2dcda2f8..698810952dc7 100644 --- a/builtin/providers/aws/resource_aws_iot_topic_rule.go +++ b/builtin/providers/aws/resource_aws_iot_topic_rule.go @@ -1,6 +1,10 @@ package aws import ( + //"log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/terraform/helper/schema" ) @@ -280,17 +284,238 @@ func resourceAwsIotTopicRule() *schema.Resource { } func resourceAwsIotTopicRuleCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + ruleName := d.Get("name").(string) + + cloudwatchAlarmActions := d.Get("cloudwatch_alarm").(*schema.Set).List() + cloudwatchMetricActions := d.Get("cloudwatch_metric").(*schema.Set).List() + dynamoDbActions := d.Get("dynamodb").(*schema.Set).List() + elasticsearchActions := d.Get("elasticsearch").(*schema.Set).List() + firehoseActions := d.Get("firehose").(*schema.Set).List() + kinesisActions := d.Get("kinesis").(*schema.Set).List() + lambdaActions := d.Get("lambda").(*schema.Set).List() + republishActions := d.Get("republish").(*schema.Set).List() + s3Actions := d.Get("s3").(*schema.Set).List() + snsActions := d.Get("sns").(*schema.Set).List() + sqsActions := d.Get("sqs").(*schema.Set).List() + + numActions := len(cloudwatchAlarmActions) + len(cloudwatchMetricActions) + + len(dynamoDbActions) + len(elasticsearchActions) + len(firehoseActions) + + len(kinesisActions) + len(lambdaActions) + len(republishActions) + + len(s3Actions) + len(snsActions) + len(sqsActions) + actions := make([]*iot.Action, numActions) + + i := 0 + // Add Cloudwatch Alarm actions + for _, a := range cloudwatchAlarmActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + CloudwatchAlarm: &iot.CloudwatchAlarmAction{ + AlarmName: aws.String(raw["alarm_name"].(string)), + RoleArn: aws.String(raw["role_arn"].(string)), + StateReason: aws.String(raw["state_reason"].(string)), + StateValue: aws.String(raw["state_value"].(string)), + }, + } + i++ + } + + // Add Cloudwatch Metric actions + for _, a := range cloudwatchMetricActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + CloudwatchMetric: &iot.CloudwatchMetricAction{ + MetricName: aws.String(raw["metric_name"].(string)), + MetricNamespace: aws.String(raw["metric_namespace"].(string)), + MetricUnit: aws.String(raw["metric_unit"].(string)), + MetricValue: aws.String(raw["metric_value"].(string)), + RoleArn: aws.String(raw["role_arn"].(string)), + MetricTimestamp: aws.String(raw["metric_timestamp"].(string)), + }, + } + i++ + } + + // Add DynamoDB actions + for _, a := range dynamoDbActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + DynamoDB: &iot.DynamoDBAction{ + HashKeyField: aws.String(raw["hash_key_field"].(string)), + HashKeyValue: aws.String(raw["hash_key_value"].(string)), + RangeKeyField: aws.String(raw["range_key_field"].(string)), + RangeKeyValue: aws.String(raw["range_key_value"].(string)), + RoleArn: aws.String(raw["role_arn"].(string)), + TableName: aws.String(raw["table_name"].(string)), + PayloadField: aws.String(raw["payload_field"].(string)), + }, + } + i++ + } + + // Add Elasticsearch actions + + for _, a := range elasticsearchActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + Elasticsearch: &iot.ElasticsearchAction{ + Endpoint: aws.String(raw["endpoint"].(string)), + Id: aws.String(raw["id"].(string)), + Index: aws.String(raw["index"].(string)), + RoleArn: aws.String(raw["role_arn"].(string)), + Type: aws.String(raw["type"].(string)), + }, + } + i++ + } + + // Add Firehose actions + + for _, a := range firehoseActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + Firehose: &iot.FirehoseAction{ + DeliveryStreamName: aws.String(raw["delivery_stream_name"].(string)), + RoleArn: aws.String(raw["role_arn"].(string)), + }, + } + i++ + } + + // Add Kinesis actions + + for _, a := range kinesisActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + Kinesis: &iot.KinesisAction{ + RoleArn: aws.String(raw["role_arn"].(string)), + StreamName: aws.String(raw["stream_name"].(string)), + PartitionKey: aws.String(raw["partition_key"].(string)), + }, + } + i++ + } + + // Add Lambda actions + + for _, a := range lambdaActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + Lambda: &iot.LambdaAction{ + FunctionArn: aws.String(raw["function_arn"].(string)), + }, + } + i++ + } + + // Add Republish actions + + for _, a := range republishActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + Republish: &iot.RepublishAction{ + RoleArn: aws.String(raw["role_arn"].(string)), + Topic: aws.String(raw["topic"].(string)), + }, + } + i++ + } + + // Add S3 actions + + for _, a := range s3Actions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + S3: &iot.S3Action{ + BucketName: aws.String(raw["bucket_name"].(string)), + Key: aws.String(raw["key"].(string)), + RoleArn: aws.String(raw["role_arn"].(string)), + }, + } + i++ + } + + // Add SNS actions + + for _, a := range snsActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + Sns: &iot.SnsAction{ + RoleArn: aws.String(raw["role_arn"].(string)), + TargetArn: aws.String(raw["target_arn"].(string)), + MessageFormat: aws.String(raw["message_format"].(string)), + }, + } + i++ + } + + // Add SQS actions + + for _, a := range sqsActions { + raw := a.(map[string]interface{}) + actions[i] = &iot.Action{ + Sqs: &iot.SqsAction{ + QueueUrl: aws.String(raw["queue_url"].(string)), + RoleArn: aws.String(raw["role_arn"].(string)), + UseBase64: aws.Bool(raw["use_base64"].(bool)), + }, + } + i++ + } + + _, err := conn.CreateTopicRule(&iot.CreateTopicRuleInput{ + RuleName: aws.String(ruleName), + TopicRulePayload: &iot.TopicRulePayload{ + Description: aws.String(d.Get("description").(string)), + RuleDisabled: aws.Bool(!d.Get("enabled").(bool)), + Sql: aws.String(d.Get("sql").(string)), + AwsIotSqlVersion: aws.String(d.Get("sql_version").(string)), + Actions: actions, + }, + }) + + if err != nil { + return err + } + + d.SetId(ruleName) + return nil } func resourceAwsIotTopicRuleRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + out, err := conn.GetTopicRule(&iot.GetTopicRuleInput{ + RuleName: aws.String(d.Id()), + }) + + if err != nil { + return err + } + + d.SetId(*out.Rule.RuleName) + d.Set("arn", *out.RuleArn) + return nil } func resourceAwsIotTopicRuleUpdate(d *schema.ResourceData, meta interface{}) error { + //TODO: implement return nil } func resourceAwsIotTopicRuleDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iotconn + + _, err := conn.DeleteTopicRule(&iot.DeleteTopicRuleInput{ + RuleName: aws.String(d.Id()), + }) + + if err != nil { + return err + } + return nil } From b6cd40b53ce9d217e0e329924abb6a2be64edf4a Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Mon, 30 May 2016 12:49:38 +0200 Subject: [PATCH 20/52] Add IoT topic rule tests --- .../aws/resource_aws_iot_topic_rule_test.go | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 builtin/providers/aws/resource_aws_iot_topic_rule_test.go diff --git a/builtin/providers/aws/resource_aws_iot_topic_rule_test.go b/builtin/providers/aws/resource_aws_iot_topic_rule_test.go new file mode 100644 index 000000000000..64b990e27310 --- /dev/null +++ b/builtin/providers/aws/resource_aws_iot_topic_rule_test.go @@ -0,0 +1,122 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/iot" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccAWSIoTTopicRule_basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy_basic, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSIoTTopicRule_basic, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIoTTopicRuleExists_basic("aws_iot_topic_rule.rule"), + ), + }, + }, + }) +} + +func testAccCheckAWSIoTTopicRuleDestroy_basic(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).iotconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_iot_topic_rule" { + continue + } + + out, err := conn.ListTopicRules(&iot.ListTopicRulesInput{}) + + if err != nil { + return err + } + + for _, r := range out.Rules { + if *r.RuleName == rs.Primary.ID { + return fmt.Errorf("IoT topic rule still exists:\n%s", r) + } + } + + } + + return nil +} + +func testAccCheckAWSIoTTopicRuleExists_basic(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + _, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + return nil + } +} + +var testAccAWSIoTTopicRule_basic = ` +resource "aws_iot_topic_rule" "rule" { + name = "MyRule" + description = "Example rule" + enabled = true + sql = "SELECT * FROM 'topic/test'" + sql_version = "2015-10-08" + + // Fake data + dynamodb { + hash_key_field = "hash_key_field" + hash_key_value = "hash_key_value" + payload_field = "payload_field" + range_key_field = "range_key_field" + range_key_value = "range_key_value" + role_arn = "${aws_iam_role.iot_role.arn}" + table_name = "table_name" + } + +} + +resource "aws_iam_role" "iot_role" { + name = "iot" + assume_role_policy = < Date: Sat, 25 Jun 2016 12:30:15 +0200 Subject: [PATCH 21/52] Start documenting AWS IoT resources --- .../aws/r/iot_certificate.html.markdown | 29 +++ .../providers/aws/r/iot_policy.html.markdown | 34 ++++ .../aws/r/iot_policy_attachment.html.markdown | 25 +++ .../providers/aws/r/iot_thing.html.markdown | 35 ++++ .../aws/r/iot_topic_rule.html.markdown | 177 ++++++++++++++++++ website/source/layouts/aws.erb | 20 +- 6 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 website/source/docs/providers/aws/r/iot_certificate.html.markdown create mode 100644 website/source/docs/providers/aws/r/iot_policy.html.markdown create mode 100644 website/source/docs/providers/aws/r/iot_policy_attachment.html.markdown create mode 100644 website/source/docs/providers/aws/r/iot_thing.html.markdown create mode 100644 website/source/docs/providers/aws/r/iot_topic_rule.html.markdown diff --git a/website/source/docs/providers/aws/r/iot_certificate.html.markdown b/website/source/docs/providers/aws/r/iot_certificate.html.markdown new file mode 100644 index 000000000000..3cc6464e061b --- /dev/null +++ b/website/source/docs/providers/aws/r/iot_certificate.html.markdown @@ -0,0 +1,29 @@ +--- +layout: "aws" +page_title: "AWS: aws_iot_certificate" +sidebar_current: "docs-aws-resource-iot-certificate" +description: |- + Creates and manages an AWS IoT certificate +--- + +# aws\_iot\_certificate + +## Example Usage + +``` +resource "aws_iot_certificate" "cert" { + csr = "${file("/my/csr.pem")}" + active = true +} +``` + +## Argument Reference + +* `csr` - The CSR of the certificate +* `active` - Boolean flag to indicate if the certificate should be active + + + +## Attributes Reference + +* `arn` - The ARN of the created AWS IoT certificate diff --git a/website/source/docs/providers/aws/r/iot_policy.html.markdown b/website/source/docs/providers/aws/r/iot_policy.html.markdown new file mode 100644 index 000000000000..9afdf5fa2356 --- /dev/null +++ b/website/source/docs/providers/aws/r/iot_policy.html.markdown @@ -0,0 +1,34 @@ +--- +layout: "aws" +page_title: "AWS: aws_iot_policy" +sidebar_current: "docs-aws-resource-iot-policy" +description: |- + Creates and manages an AWS IoT policy +--- + +# aws\_iot\_policy + +## Example Usage + +``` +resource "aws_iot_policy" "pubsub" { + name = "PubSubToAnyTopic" + policy = < + > + IoT Resources + - > Kinesis Resources