diff --git a/CHANGELOG.md b/CHANGELOG.md index 64b0b662b1e..407ba6f671e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log - AWS SDK for Android +## [Release 2.4.3](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.4.3) + +### Improvements: +- **AWS IoT** + - Update API to latest spec. + +- **Amazon Polly** + - Added support for new voice id - `Vicki`. + +- **Amazon Pinpoint** + - Update logging to be more restrictive. + - Added support for app-level opt-out. + +### Bug Fixes: +- **All Services** + - Fixed an issue where endpoint URLs were incorrectly set after using `setRegion.`. See [issue #290](https://github.com/aws/aws-sdk-android/issues/290) +- **Amazon S3** + - Fixed bug which caused gradle build error on commons-io. See [issue #282](https://github.com/aws/aws-sdk-android/issues/282) + - Fixed NPE error while resuming transfers using `TransferUtility`. See [issue #299](https://github.com/aws/aws-sdk-android/issues/299) + - Fixed `TransferUtility` observer progress tracking bug. See [issue #257](https://github.com/aws/aws-sdk-android/issues/257) + ## [Release 2.4.2](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.4.2) ### Improvements: diff --git a/Proguard.md b/Proguard.md index 3fc7ce9340a..eb0f6cb72eb 100644 --- a/Proguard.md +++ b/Proguard.md @@ -7,7 +7,6 @@ When exporting your app using the AWS SDK for Android with the default, empty _p ``` # Class names are needed in reflection -keepnames class com.amazonaws.** --keepnames class com.amazon.** # Request handlers defined in request.handlers -keep class com.amazonaws.services.**.*Handler # The following are referenced but aren't required to run diff --git a/aws-android-sdk-apigateway-core/pom.xml b/aws-android-sdk-apigateway-core/pom.xml index 10c62193e52..444fdcdc498 100644 --- a/aws-android-sdk-apigateway-core/pom.xml +++ b/aws-android-sdk-apigateway-core/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-autoscaling/pom.xml b/aws-android-sdk-autoscaling/pom.xml index f166f9befa9..dbabdf8e966 100644 --- a/aws-android-sdk-autoscaling/pom.xml +++ b/aws-android-sdk-autoscaling/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/AmazonAutoScalingClient.java b/aws-android-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/AmazonAutoScalingClient.java index f0727805932..24e2065a135 100644 --- a/aws-android-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/AmazonAutoScalingClient.java +++ b/aws-android-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/AmazonAutoScalingClient.java @@ -273,6 +273,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("autoscaling.amazonaws.com"); + this.endpointPrefix = "autoscaling"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-cloudwatch/pom.xml b/aws-android-sdk-cloudwatch/pom.xml index 6e3c7fa64d1..50bc3fc0e70 100644 --- a/aws-android-sdk-cloudwatch/pom.xml +++ b/aws-android-sdk-cloudwatch/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java b/aws-android-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java index c1259b324d3..af76263d869 100644 --- a/aws-android-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java +++ b/aws-android-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java @@ -288,6 +288,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("monitoring.us-east-1.amazonaws.com"); + this.endpointPrefix = "monitoring"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-cognito/pom.xml b/aws-android-sdk-cognito/pom.xml index 0f45e316086..53b8a38c021 100644 --- a/aws-android-sdk-cognito/pom.xml +++ b/aws-android-sdk-cognito/pom.xml @@ -6,14 +6,14 @@ aws-android-sdk-cognito jar AWS SDK for Android - Amazon Cognito Sync - 2.4.2 + 2.4.3 The AWS Android SDK for Amazon Cognito Sync module holds the client classes that are used for communicating with Amazon Cognito Sync Service http://aws.amazon.com/sdkforandroid com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -29,7 +29,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 com.google.android diff --git a/aws-android-sdk-cognito/src/main/java/com/amazonaws/services/cognitosync/AmazonCognitoSyncClient.java b/aws-android-sdk-cognito/src/main/java/com/amazonaws/services/cognitosync/AmazonCognitoSyncClient.java index 2224627df06..b682b339fff 100644 --- a/aws-android-sdk-cognito/src/main/java/com/amazonaws/services/cognitosync/AmazonCognitoSyncClient.java +++ b/aws-android-sdk-cognito/src/main/java/com/amazonaws/services/cognitosync/AmazonCognitoSyncClient.java @@ -297,6 +297,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("cognito-sync.us-east-1.amazonaws.com"); + this.endpointPrefix = "cognito-sync"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-cognito/src/main/resources/fabric/com.amazonaws.aws-android-sdk-cognito.properties b/aws-android-sdk-cognito/src/main/resources/fabric/com.amazonaws.aws-android-sdk-cognito.properties index a845f1044d8..8513b4cf857 100644 --- a/aws-android-sdk-cognito/src/main/resources/fabric/com.amazonaws.aws-android-sdk-cognito.properties +++ b/aws-android-sdk-cognito/src/main/resources/fabric/com.amazonaws.aws-android-sdk-cognito.properties @@ -1,3 +1,3 @@ fabric-identifier=com.amazonaws.aws-android-sdk-cognito -fabric-version=2.4.2 +fabric-version=2.4.3 fabric-build-type=binary diff --git a/aws-android-sdk-cognitoidentityprovider/pom.xml b/aws-android-sdk-cognitoidentityprovider/pom.xml index bcefd040a05..73bdf84e056 100644 --- a/aws-android-sdk-cognitoidentityprovider/pom.xml +++ b/aws-android-sdk-cognitoidentityprovider/pom.xml @@ -6,14 +6,14 @@ aws-android-sdk-cognitoidentityprovider jar AWS SDK for Android - Amazon Cognito Identity Provider - 2.4.2 + 2.4.3 The AWS Android SDK for Amazon Cognito Identity Provider module holds the client classes that are used for communicating with Amazon Cognito Identity Provider Service http://aws.amazon.com/sdkforandroid com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -29,7 +29,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 com.google.android diff --git a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/AmazonCognitoIdentityProviderClient.java b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/AmazonCognitoIdentityProviderClient.java index 79f69175294..a5ae8517b02 100644 --- a/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/AmazonCognitoIdentityProviderClient.java +++ b/aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/services/cognitoidentityprovider/AmazonCognitoIdentityProviderClient.java @@ -303,6 +303,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("cognito-idp.us-east-1.amazonaws.com"); + this.endpointPrefix = "cognito-idp"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-core/pom.xml b/aws-android-sdk-core/pom.xml index ac0a66eca96..f08885014f2 100644 --- a/aws-android-sdk-core/pom.xml +++ b/aws-android-sdk-core/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java b/aws-android-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java index f9e086e8c78..f3bc72549ef 100644 --- a/aws-android-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java +++ b/aws-android-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceClient.java @@ -106,6 +106,8 @@ public abstract class AmazonWebServiceClient { */ private volatile String serviceName; + protected volatile String endpointPrefix; + /** * Constructs a new AmazonWebServiceClient object using the specified * configuration. @@ -209,16 +211,36 @@ protected Signer getSigner() { * specified endpoint. */ public void setEndpoint(final String endpoint) { - URI uri = toURI(endpoint); + final URI uri = toURI(endpoint); @SuppressWarnings("checkstyle:hiddenfield") - Signer signer = computeSignerByURI(uri, signerRegionOverride, false); + final Signer signer = computeSignerByURI(uri, signerRegionOverride, false); synchronized (this) { this.endpoint = uri; this.signer = signer; } } + /** + * Returns the endpoint for the service. + * + * @return the endpoint for the service. + */ + public String getEndpoint() { + synchronized (this) { + return this.endpoint.toString(); + } + } + + /** + * Returns the endpoint prefix for the service. + * + * @return the endpoint prefix. + */ + public String getEndpointPrefix() { + return endpointPrefix; + } + /** * @param endpoint the endpoint. * @return the endpoint as a URI. @@ -236,7 +258,7 @@ private URI toURI(String endpoint) { try { return new URI(endpoint); - } catch (URISyntaxException e) { + } catch (final URISyntaxException e) { throw new IllegalArgumentException(e); } } @@ -280,8 +302,8 @@ private URI toURI(String endpoint) { public void setEndpoint(final String endpoint, final String serviceName, final String regionId) { - URI uri = toURI(endpoint); - Signer signer = computeSignerByServiceRegion(serviceName, regionId, + final URI uri = toURI(endpoint); + final Signer signer = computeSignerByServiceRegion(serviceName, regionId, regionId, true); synchronized (this) { this.signer = signer; @@ -346,8 +368,8 @@ private Signer computeSignerByURI(final URI uri, String signerRegionOverride, throw new IllegalArgumentException( "Endpoint is not set. Use setEndpoint to set an endpoint before performing any request."); } - String service = getServiceNameIntern(); - String region = AwsHostNameUtils.parseRegionName(uri.getHost(), service); + final String service = getServiceNameIntern(); + final String region = AwsHostNameUtils.parseRegionName(uri.getHost(), service); return computeSignerByServiceRegion( service, region, signerRegionOverride, isRegionIdAsSignerParam); } @@ -374,20 +396,21 @@ private Signer computeSignerByServiceRegion( final String serviceName, final String regionId, final String signerRegionOverride, final boolean isRegionIdAsSignerParam) { - String signerType = clientConfiguration.getSignerOverride(); - Signer signer = signerType == null + final String signerType = clientConfiguration.getSignerOverride(); + final Signer signer = signerType == null ? SignerFactory.getSigner(serviceName, regionId) : SignerFactory.getSignerByTypeAndService(signerType, serviceName); if (signer instanceof RegionAwareSigner) { // Overrides the default region computed - RegionAwareSigner regionAwareSigner = (RegionAwareSigner) signer; + final RegionAwareSigner regionAwareSigner = (RegionAwareSigner) signer; // (signerRegionOverride != null) means that it is likely to be AWS // internal dev work, as "signerRegionOverride" is typically null // when used in the external release - if (signerRegionOverride != null) + if (signerRegionOverride != null) { regionAwareSigner.setRegionName(signerRegionOverride); - else if (regionId != null && isRegionIdAsSignerParam) + } else if (regionId != null && isRegionIdAsSignerParam) { regionAwareSigner.setRegionName(regionId); + } } return signer; } @@ -422,36 +445,26 @@ public void setRegion(final Region region) { throw new IllegalArgumentException("No region provided"); } - String serviceName = getServiceNameIntern(); + final String serviceName = getServiceNameIntern(); String serviceEndpoint; if (region.isServiceSupported(serviceName)) { - serviceEndpoint = region.getServiceEndpoint(serviceName); - - int protocolIdx = serviceEndpoint.indexOf("://"); + final int protocolIdx = serviceEndpoint.indexOf("://"); // Strip off the protocol to allow the client config to specify it if (protocolIdx >= 0) { - serviceEndpoint = - serviceEndpoint.substring(protocolIdx + "://".length()); + serviceEndpoint = serviceEndpoint.substring(protocolIdx + "://".length()); } - } else { - serviceEndpoint = String.format("%s.%s.%s", - serviceName, - region.getName(), - region.getDomain()); - - LOG.info("{" + serviceName + ", " + region.getName() + "} was not " - + "found in region metadata, trying to construct an " - + "endpoint using the standard pattern for this region: '" - + serviceEndpoint + "'."); + getEndpointPrefix(), + region.getName(), + region.getDomain()); } - URI uri = toURI(serviceEndpoint); - Signer signer = computeSignerByServiceRegion(serviceName, + final URI uri = toURI(serviceEndpoint); + final Signer signer = computeSignerByServiceRegion(serviceName, region.getName(), signerRegionOverride, false); synchronized (this) { this.endpoint = uri; @@ -459,6 +472,8 @@ public void setRegion(final Region region) { } } + + /** * @deprecated by client configuration via the constructor. This method will * be removed later on. @@ -467,7 +482,7 @@ public void setRegion(final Region region) { @Deprecated @SuppressWarnings("checkstyle:hiddenfield") public void setConfiguration(final ClientConfiguration clientConfiguration) { - AmazonHttpClient existingClient = this.client; + final AmazonHttpClient existingClient = this.client; RequestMetricCollector requestMetricCollector = null; if (existingClient != null) { requestMetricCollector = existingClient.getRequestMetricCollector(); @@ -535,7 +550,7 @@ public void removeRequestHandler(final RequestHandler2 requestHandler2) { } protected ExecutionContext createExecutionContext(final AmazonWebServiceRequest req) { - boolean isMetricsEnabled = isRequestMetricsEnabled(req) || isProfilingEnabled(); + final boolean isMetricsEnabled = isRequestMetricsEnabled(req) || isProfilingEnabled(); return new ExecutionContext(requestHandler2s, isMetricsEnabled, this); } @@ -555,7 +570,7 @@ protected final ExecutionContext createExecutionContext(final Request req) { */ @Deprecated protected final ExecutionContext createExecutionContext() { - boolean isMetricsEnabled = isRMCEnabledAtClientOrSdkLevel() || isProfilingEnabled(); + final boolean isMetricsEnabled = isRMCEnabledAtClientOrSdkLevel() || isProfilingEnabled(); return new ExecutionContext(requestHandler2s, isMetricsEnabled, this); } @@ -573,7 +588,7 @@ protected static boolean isProfilingEnabled() { */ @Deprecated protected final boolean isRequestMetricsEnabled(final AmazonWebServiceRequest req) { - RequestMetricCollector c = req.getRequestMetricCollector(); // request + final RequestMetricCollector c = req.getRequestMetricCollector(); // request // level // collector if (c != null && c.isEnabled()) { @@ -590,7 +605,7 @@ protected final boolean isRequestMetricsEnabled(final AmazonWebServiceRequest re */ @Deprecated private boolean isRMCEnabledAtClientOrSdkLevel() { - RequestMetricCollector c = requestMetricCollector(); + final RequestMetricCollector c = requestMetricCollector(); return c != null && c.isEnabled(); } @@ -654,7 +669,7 @@ public RequestMetricCollector getRequestMetricsCollector() { */ @Deprecated protected RequestMetricCollector requestMetricCollector() { - RequestMetricCollector mc = client.getRequestMetricCollector(); + final RequestMetricCollector mc = client.getRequestMetricCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; } @@ -666,7 +681,7 @@ protected RequestMetricCollector requestMetricCollector() { */ @Deprecated protected final RequestMetricCollector findRequestMetricCollector(final Request req) { - AmazonWebServiceRequest origReq = req.getOriginalRequest(); + final AmazonWebServiceRequest origReq = req.getOriginalRequest(); RequestMetricCollector mc = origReq.getRequestMetricCollector(); if (mc != null) { return mc; @@ -707,11 +722,12 @@ protected final void endClientExecution( if (request != null) { awsRequestMetrics.endEvent(Field.ClientExecuteTime); awsRequestMetrics.getTimingInfo().endTiming(); - RequestMetricCollector c = findRequestMetricCollector(request); + final RequestMetricCollector c = findRequestMetricCollector(request); c.collectMetrics(request, response); } - if (loggingAwsRequestMetrics) + if (loggingAwsRequestMetrics) { awsRequestMetrics.log(); + } } /** @@ -769,10 +785,10 @@ public final void setServiceNameIntern(final String serviceName) { */ @SuppressWarnings("checkstyle:hiddenfield") private String computeServiceName() { - Class httpClientClass = Classes.childClassOf( + final Class httpClientClass = Classes.childClassOf( AmazonWebServiceClient.class, this); final String httpClientName = httpClientClass.getSimpleName(); - String service = ServiceNameFactory.getServiceName(httpClientName); + final String service = ServiceNameFactory.getServiceName(httpClientName); if (service != null) { return service; // only if it is so explicitly configured } @@ -803,7 +819,7 @@ private String computeServiceName() { throw new IllegalStateException( "Unrecognized AWS http client class name " + httpClientName); } - String serviceName = httpClientName.substring(i + len, j); + final String serviceName = httpClientName.substring(i + len, j); return StringUtils.lowerCase(serviceName); } @@ -824,7 +840,7 @@ public final String getSignerRegionOverride() { */ @SuppressWarnings("checkstyle:hiddenfield") public final void setSignerRegionOverride(final String signerRegionOverride) { - Signer signer = computeSignerByURI(endpoint, signerRegionOverride, true); + final Signer signer = computeSignerByURI(endpoint, signerRegionOverride, true); synchronized (this) { this.signer = signer; this.signerRegionOverride = signerRegionOverride; diff --git a/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java b/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java index 4870a0f9e88..d6c4ad5c960 100644 --- a/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java +++ b/aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionDefaults.java @@ -27,319 +27,324 @@ public static List getRegions() { region = new Region("ap-northeast-1", ""); ret.add(region); - updateRegion(region, "lambda", "lambda.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "elasticloadbalancing", + "elasticloadbalancing.ap-northeast-1.amazonaws.com", false, true); updateRegion(region, "cognito-identity", "cognito-identity.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "data.iot", "data.iot.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "s3", "s3-ap-northeast-1.amazonaws.com", false, true); updateRegion(region, "dynamodb", "dynamodb.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "elasticloadbalancing", - "elasticloadbalancing.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "s3", "s3-ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "data.iot", "data.iot.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.ap-northeast-1.amazonaws.com", false, true); updateRegion(region, "kinesis", "kinesis.ap-northeast-1.amazonaws.com", false, true); updateRegion(region, "sns", "sns.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.ap-northeast-1.amazonaws.com", false, true); updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "sdb", "sdb.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.ap-northeast-1.amazonaws.com", false, true); updateRegion(region, "cognito-sync", "cognito-sync.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.ap-northeast-1.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.ap-northeast-1.amazonaws.com", false, true); + updateRegion(region, "sdb", "sdb.ap-northeast-1.amazonaws.com", false, true); region = new Region("ap-northeast-2", ""); ret.add(region); - updateRegion(region, "data.iot", "data.iot.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "s3", "s3.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.ap-northeast-2.amazonaws.com", false, true); updateRegion(region, "cognito-sync", "cognito-sync.ap-northeast-2.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "lambda", "lambda.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.ap-northeast-2.amazonaws.com", false, true); updateRegion(region, "cognito-identity", "cognito-identity.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "s3", "s3.ap-northeast-2.amazonaws.com", false, true); updateRegion(region, "autoscaling", "autoscaling.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.ap-northeast-2.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.ap-northeast-2.amazonaws.com", false, true); + updateRegion(region, "data.iot", "data.iot.ap-northeast-2.amazonaws.com", false, true); updateRegion(region, "kms", "kms.ap-northeast-2.amazonaws.com", false, true); updateRegion(region, "sts", "sts.ap-northeast-2.amazonaws.com", false, true); region = new Region("ap-south-1", ""); ret.add(region); - updateRegion(region, "elasticloadbalancing", - "elasticloadbalancing.ap-south-1.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.ap-south-1.amazonaws.com", false, true); updateRegion(region, "kms", "kms.ap-south-1.amazonaws.com", false, true); updateRegion(region, "kinesis", "kinesis.ap-south-1.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.ap-south-1.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.ap-south-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.ap-south-1.amazonaws.com", false, true); updateRegion(region, "s3", "s3.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); updateRegion(region, "sns", "sns.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "cognito-identity", "cognito-identity.ap-south-1.amazonaws.com", + false, true); + updateRegion(region, "ec2", "ec2.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "cognito-sync", "cognito-sync.ap-south-1.amazonaws.com", false, true); + updateRegion(region, "elasticloadbalancing", + "elasticloadbalancing.ap-south-1.amazonaws.com", false, true); region = new Region("ap-southeast-1", ""); ret.add(region); - updateRegion(region, "elasticloadbalancing", - "elasticloadbalancing.ap-southeast-1.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.ap-southeast-1.amazonaws.com", false, true); updateRegion(region, "data.iot", "data.iot.ap-southeast-1.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.ap-southeast-1.amazonaws.com", false, true); updateRegion(region, "kinesis", "kinesis.ap-southeast-1.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.ap-southeast-1.amazonaws.com", false, true); updateRegion(region, "ec2", "ec2.ap-southeast-1.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.ap-southeast-1.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.ap-southeast-1.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.ap-southeast-1.amazonaws.com", false, true); updateRegion(region, "s3", "s3-ap-southeast-1.amazonaws.com", false, true); - updateRegion(region, "lambda", "lambda.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "elasticloadbalancing", + "elasticloadbalancing.ap-southeast-1.amazonaws.com", false, true); updateRegion(region, "sdb", "sdb.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.ap-southeast-1.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); region = new Region("ap-southeast-2", ""); ret.add(region); - updateRegion(region, "s3", "s3-ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "data.iot", "data.iot.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "sdb", "sdb.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "elasticloadbalancing", - "elasticloadbalancing.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.ap-southeast-2.amazonaws.com", false, true); updateRegion(region, "cognito-identity", "cognito-identity.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "elasticloadbalancing", + "elasticloadbalancing.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "s3", "s3-ap-southeast-2.amazonaws.com", false, true); updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.ap-southeast-2.amazonaws.com", false, true); updateRegion(region, "sqs", "sqs.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "data.iot", "data.iot.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.ap-southeast-2.amazonaws.com", false, true); updateRegion(region, "kinesis", "kinesis.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.ap-southeast-2.amazonaws.com", false, true); updateRegion(region, "cognito-sync", "cognito-sync.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "lambda", "lambda.ap-southeast-2.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "sdb", "sdb.ap-southeast-2.amazonaws.com", false, true); updateRegion(region, "kms", "kms.ap-southeast-2.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.ap-southeast-2.amazonaws.com", false, true); region = new Region("ca-central-1", ""); ret.add(region); - updateRegion(region, "kms", "kms.ca-central-1.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.ca-central-1.amazonaws.com", false, true); updateRegion(region, "autoscaling", "autoscaling.ca-central-1.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.ca-central-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.ca-central-1.amazonaws.com", false, true); - updateRegion(region, "s3", "s3.ca-central-1.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.ca-central-1.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.ca-central-1.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.ca-central-1.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.ca-central-1.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.ca-central-1.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.ca-central-1.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.ca-central-1.amazonaws.com", false, true); + updateRegion(region, "s3", "s3.ca-central-1.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.ca-central-1.amazonaws.com", false, true); updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.ca-central-1.amazonaws.com", false, true); region = new Region("eu-central-1", ""); ret.add(region); - updateRegion(region, "cognito-identity", "cognito-identity.eu-central-1.amazonaws.com", - false, true); + updateRegion(region, "ec2", "ec2.eu-central-1.amazonaws.com", false, true); updateRegion(region, "sqs", "sqs.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "data.iot", "data.iot.eu-central-1.amazonaws.com", false, true); updateRegion(region, "lambda", "lambda.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "s3", "s3.eu-central-1.amazonaws.com", false, true); updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "cognito-sync", "cognito-sync.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "s3", "s3.eu-central-1.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "cognito-identity", "cognito-identity.eu-central-1.amazonaws.com", + false, true); + updateRegion(region, "iot", "iot.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.eu-central-1.amazonaws.com", false, true); updateRegion(region, "autoscaling", "autoscaling.eu-central-1.amazonaws.com", false, true); - updateRegion(region, "data.iot", "data.iot.eu-central-1.amazonaws.com", false, true); + updateRegion(region, "cognito-sync", "cognito-sync.eu-central-1.amazonaws.com", false, true); region = new Region("eu-west-1", ""); ret.add(region); + updateRegion(region, "sqs", "sqs.eu-west-1.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "firehose", "firehose.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "polly", "polly.eu-west-1.amazonaws.com", false, true); updateRegion(region, "sns", "sns.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "cognito-sync", "cognito-sync.eu-west-1.amazonaws.com", false, true); updateRegion(region, "data.iot", "data.iot.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "email", "email.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); updateRegion(region, "kinesis", "kinesis.eu-west-1.amazonaws.com", false, true); updateRegion(region, "iot", "iot.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "s3", "s3-eu-west-1.amazonaws.com", false, true); + updateRegion(region, "sdb", "sdb.eu-west-1.amazonaws.com", false, true); updateRegion(region, "cognito-identity", "cognito-identity.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "sdb", "sdb.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "email", "email.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "lambda", "lambda.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.eu-west-1.amazonaws.com", false, true); + updateRegion(region, "firehose", "firehose.eu-west-1.amazonaws.com", false, true); updateRegion(region, "machinelearning", "machinelearning.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "cognito-sync", "cognito-sync.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "polly", "polly.eu-west-1.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "s3", "s3-eu-west-1.amazonaws.com", false, true); region = new Region("eu-west-2", ""); ret.add(region); - updateRegion(region, "s3", "s3.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.eu-west-2.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "lambda", "lambda.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.eu-west-2.amazonaws.com", false, true); updateRegion(region, "cognito-idp", "cognito-idp.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "s3", "s3.eu-west-2.amazonaws.com", false, true); updateRegion(region, "cognito-sync", "cognito-sync.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.eu-west-2.amazonaws.com", false, true); updateRegion(region, "cognito-identity", "cognito-identity.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.eu-west-2.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.eu-west-2.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.eu-west-2.amazonaws.com", false, true); region = new Region("sa-east-1", ""); ret.add(region); - updateRegion(region, "ec2", "ec2.sa-east-1.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.sa-east-1.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.sa-east-1.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.sa-east-1.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.sa-east-1.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.sa-east-1.amazonaws.com", false, true); updateRegion(region, "s3", "s3-sa-east-1.amazonaws.com", false, true); updateRegion(region, "sdb", "sdb.sa-east-1.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.sa-east-1.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.sa-east-1.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.sa-east-1.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.sa-east-1.amazonaws.com", false, true); updateRegion(region, "sns", "sns.sa-east-1.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.sa-east-1.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.sa-east-1.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.sa-east-1.amazonaws.com", false, true); region = new Region("us-east-1", ""); ret.add(region); - updateRegion(region, "elasticloadbalancing", - "elasticloadbalancing.us-east-1.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.us-east-1.amazonaws.com", false, true); updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "data.iot", "data.iot.us-east-1.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.us-east-1.amazonaws.com", false, true); + updateRegion(region, "cognito-sync", "cognito-sync.us-east-1.amazonaws.com", false, true); updateRegion(region, "kms", "kms.us-east-1.amazonaws.com", false, true); - updateRegion(region, "email", "email.us-east-1.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.us-east-1.amazonaws.com", false, true); - updateRegion(region, "s3", "s3.amazonaws.com", false, true); + updateRegion(region, "data.iot", "data.iot.us-east-1.amazonaws.com", false, true); updateRegion(region, "pinpoint", "pinpoint.us-east-1.amazonaws.com", false, true); + updateRegion(region, "cognito-identity", "cognito-identity.us-east-1.amazonaws.com", false, + true); + updateRegion(region, "iot", "iot.us-east-1.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.us-east-1.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.us-east-1.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.us-east-1.amazonaws.com", false, true); updateRegion(region, "machinelearning", "machinelearning.us-east-1.amazonaws.com", false, true); updateRegion(region, "polly", "polly.us-east-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.us-east-1.amazonaws.com", false, true); - updateRegion(region, "sdb", "sdb.amazonaws.com", false, true); + updateRegion(region, "s3", "s3.amazonaws.com", false, true); updateRegion(region, "dynamodb", "dynamodb.us-east-1.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.us-east-1.amazonaws.com", false, true); - updateRegion(region, "cognito-identity", "cognito-identity.us-east-1.amazonaws.com", false, - true); + updateRegion(region, "lambda", "lambda.us-east-1.amazonaws.com", false, true); + updateRegion(region, "sdb", "sdb.amazonaws.com", false, true); updateRegion(region, "autoscaling", "autoscaling.us-east-1.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.us-east-1.amazonaws.com", false, true); updateRegion(region, "mobileanalytics", "mobileanalytics.us-east-1.amazonaws.com", false, true); - updateRegion(region, "lambda", "lambda.us-east-1.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.us-east-1.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.us-east-1.amazonaws.com", false, true); + updateRegion(region, "elasticloadbalancing", + "elasticloadbalancing.us-east-1.amazonaws.com", false, true); updateRegion(region, "firehose", "firehose.us-east-1.amazonaws.com", false, true); - updateRegion(region, "cognito-sync", "cognito-sync.us-east-1.amazonaws.com", false, true); + updateRegion(region, "email", "email.us-east-1.amazonaws.com", false, true); region = new Region("us-east-2", ""); ret.add(region); - updateRegion(region, "kinesis", "kinesis.us-east-2.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.us-east-2.amazonaws.com", false, true); updateRegion(region, "kms", "kms.us-east-2.amazonaws.com", false, true); - updateRegion(region, "lambda", "lambda.us-east-2.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.us-east-2.amazonaws.com", false, true); updateRegion(region, "cognito-sync", "cognito-sync.us-east-2.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.us-east-2.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.us-east-2.amazonaws.com", false, true); + updateRegion(region, "polly", "polly.us-east-2.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.us-east-2.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.us-east-2.amazonaws.com", false, true); + updateRegion(region, "lambda", "lambda.us-east-2.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.us-east-2.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.us-east-2.amazonaws.com", false, true); updateRegion(region, "cognito-identity", "cognito-identity.us-east-2.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.us-east-2.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.us-east-2.amazonaws.com", false, true); updateRegion(region, "autoscaling", "autoscaling.us-east-2.amazonaws.com", false, true); - updateRegion(region, "polly", "polly.us-east-2.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.us-east-2.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.us-east-2.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.us-east-2.amazonaws.com", false, true); updateRegion(region, "s3", "s3.us-east-2.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.us-east-2.amazonaws.com", false, true); region = new Region("us-west-1", ""); ret.add(region); - updateRegion(region, "s3", "s3-us-west-1.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.us-west-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.us-west-1.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.us-west-1.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.us-west-1.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.us-west-1.amazonaws.com", false, true); - updateRegion(region, "sdb", "sdb.us-west-1.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.us-west-1.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.us-west-1.amazonaws.com", false, true); updateRegion(region, "lambda", "lambda.us-west-1.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.us-west-1.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.us-west-1.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.us-west-1.amazonaws.com", false, true); updateRegion(region, "sqs", "sqs.us-west-1.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); updateRegion(region, "kinesis", "kinesis.us-west-1.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.us-west-1.amazonaws.com", false, true); + updateRegion(region, "s3", "s3-us-west-1.amazonaws.com", false, true); + updateRegion(region, "sdb", "sdb.us-west-1.amazonaws.com", false, true); region = new Region("us-west-2", ""); ret.add(region); + updateRegion(region, "elasticloadbalancing", + "elasticloadbalancing.us-west-2.amazonaws.com", false, true); + updateRegion(region, "cognito-sync", "cognito-sync.us-west-2.amazonaws.com", false, true); updateRegion(region, "email", "email.us-west-2.amazonaws.com", false, true); - updateRegion(region, "kms", "kms.us-west-2.amazonaws.com", false, true); - updateRegion(region, "data.iot", "data.iot.us-west-2.amazonaws.com", false, true); + updateRegion(region, "cognito-idp", "cognito-idp.us-west-2.amazonaws.com", false, true); updateRegion(region, "firehose", "firehose.us-west-2.amazonaws.com", false, true); + updateRegion(region, "data.iot", "data.iot.us-west-2.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.us-west-2.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.us-west-2.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.us-west-2.amazonaws.com", false, true); updateRegion(region, "lambda", "lambda.us-west-2.amazonaws.com", false, true); - updateRegion(region, "iot", "iot.us-west-2.amazonaws.com", false, true); - updateRegion(region, "polly", "polly.us-west-2.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.us-west-2.amazonaws.com", false, true); - updateRegion(region, "s3", "s3-us-west-2.amazonaws.com", false, true); updateRegion(region, "autoscaling", "autoscaling.us-west-2.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.us-west-2.amazonaws.com", false, true); + updateRegion(region, "s3", "s3-us-west-2.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.us-west-2.amazonaws.com", false, true); updateRegion(region, "sdb", "sdb.us-west-2.amazonaws.com", false, true); - updateRegion(region, "cognito-sync", "cognito-sync.us-west-2.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.us-west-2.amazonaws.com", false, true); + updateRegion(region, "sqs", "sqs.us-west-2.amazonaws.com", false, true); + updateRegion(region, "iot", "iot.us-west-2.amazonaws.com", false, true); + updateRegion(region, "polly", "polly.us-west-2.amazonaws.com", false, true); updateRegion(region, "sts", "sts.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.us-west-2.amazonaws.com", false, true); updateRegion(region, "cognito-identity", "cognito-identity.us-west-2.amazonaws.com", false, true); - updateRegion(region, "cognito-idp", "cognito-idp.us-west-2.amazonaws.com", false, true); - updateRegion(region, "elasticloadbalancing", - "elasticloadbalancing.us-west-2.amazonaws.com", false, true); - updateRegion(region, "sqs", "sqs.us-west-2.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.us-west-2.amazonaws.com", false, true); region = new Region("cn-north-1", ""); ret.add(region); + updateRegion(region, "sts", "sts.cn-north-1.amazonaws.com.cn", false, true); updateRegion(region, "autoscaling", "autoscaling.cn-north-1.amazonaws.com.cn", false, true); - updateRegion(region, "dynamodb", "dynamodb.cn-north-1.amazonaws.com.cn", false, true); - updateRegion(region, "ec2", "ec2.cn-north-1.amazonaws.com.cn", false, true); updateRegion(region, "kinesis", "kinesis.cn-north-1.amazonaws.com.cn", false, true); - updateRegion(region, "sts", "sts.cn-north-1.amazonaws.com.cn", false, true); updateRegion(region, "s3", "s3.cn-north-1.amazonaws.com.cn", false, true); + updateRegion(region, "sns", "sns.cn-north-1.amazonaws.com.cn", false, true); + updateRegion(region, "dynamodb", "dynamodb.cn-north-1.amazonaws.com.cn", false, true); + updateRegion(region, "ec2", "ec2.cn-north-1.amazonaws.com.cn", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.cn-north-1.amazonaws.com.cn", false, true); - updateRegion(region, "sns", "sns.cn-north-1.amazonaws.com.cn", false, true); updateRegion(region, "sqs", "sqs.cn-north-1.amazonaws.com.cn", false, true); region = new Region("us-gov-west-1", ""); ret.add(region); - updateRegion(region, "kms", "kms.us-gov-west-1.amazonaws.com", false, true); - updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "dynamodb", "dynamodb.us-gov-west-1.amazonaws.com", false, true); updateRegion(region, "s3", "s3-us-gov-west-1.amazonaws.com", false, true); - updateRegion(region, "sns", "sns.us-gov-west-1.amazonaws.com", false, true); + updateRegion(region, "kms", "kms.us-gov-west-1.amazonaws.com", false, true); + updateRegion(region, "ec2", "ec2.us-gov-west-1.amazonaws.com", false, true); updateRegion(region, "elasticloadbalancing", "elasticloadbalancing.us-gov-west-1.amazonaws.com", false, true); - updateRegion(region, "kinesis", "kinesis.us-gov-west-1.amazonaws.com", false, true); - updateRegion(region, "autoscaling", "autoscaling.us-gov-west-1.amazonaws.com", false, true); - updateRegion(region, "dynamodb", "dynamodb.us-gov-west-1.amazonaws.com", false, true); + updateRegion(region, "sts", "sts.amazonaws.com", false, true); + updateRegion(region, "sns", "sns.us-gov-west-1.amazonaws.com", false, true); updateRegion(region, "sqs", "sqs.us-gov-west-1.amazonaws.com", false, true); - updateRegion(region, "ec2", "ec2.us-gov-west-1.amazonaws.com", false, true); + updateRegion(region, "autoscaling", "autoscaling.us-gov-west-1.amazonaws.com", false, true); + updateRegion(region, "kinesis", "kinesis.us-gov-west-1.amazonaws.com", false, true); return ret; } diff --git a/aws-android-sdk-core/src/main/java/com/amazonaws/services/cognitoidentity/AmazonCognitoIdentityClient.java b/aws-android-sdk-core/src/main/java/com/amazonaws/services/cognitoidentity/AmazonCognitoIdentityClient.java index 64ade03e6af..821b46c50f1 100644 --- a/aws-android-sdk-core/src/main/java/com/amazonaws/services/cognitoidentity/AmazonCognitoIdentityClient.java +++ b/aws-android-sdk-core/src/main/java/com/amazonaws/services/cognitoidentity/AmazonCognitoIdentityClient.java @@ -316,6 +316,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("cognito-identity.us-east-1.amazonaws.com"); + this.endpointPrefix = "cognito-identity"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-core/src/main/java/com/amazonaws/services/securitytoken/AWSSecurityTokenServiceClient.java b/aws-android-sdk-core/src/main/java/com/amazonaws/services/securitytoken/AWSSecurityTokenServiceClient.java index 185ba5adc16..70165533501 100644 --- a/aws-android-sdk-core/src/main/java/com/amazonaws/services/securitytoken/AWSSecurityTokenServiceClient.java +++ b/aws-android-sdk-core/src/main/java/com/amazonaws/services/securitytoken/AWSSecurityTokenServiceClient.java @@ -341,6 +341,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sts.amazonaws.com"); + this.endpointPrefix = "sts"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-core/src/main/java/com/amazonaws/util/VersionInfoUtils.java b/aws-android-sdk-core/src/main/java/com/amazonaws/util/VersionInfoUtils.java index e5480788a56..375bed4d78c 100644 --- a/aws-android-sdk-core/src/main/java/com/amazonaws/util/VersionInfoUtils.java +++ b/aws-android-sdk-core/src/main/java/com/amazonaws/util/VersionInfoUtils.java @@ -26,7 +26,7 @@ public class VersionInfoUtils { private static final int DEFAULT_STRING_LENGTH = 128; /** SDK version info */ - private static volatile String version = "2.4.2"; + private static volatile String version = "2.4.3"; // changed build // logic diff --git a/aws-android-sdk-core/src/main/resources/fabric/com.amazonaws.aws-android-sdk-core.properties b/aws-android-sdk-core/src/main/resources/fabric/com.amazonaws.aws-android-sdk-core.properties index f7c9c0c1308..2524fbb3748 100644 --- a/aws-android-sdk-core/src/main/resources/fabric/com.amazonaws.aws-android-sdk-core.properties +++ b/aws-android-sdk-core/src/main/resources/fabric/com.amazonaws.aws-android-sdk-core.properties @@ -1,3 +1,3 @@ fabric-identifier=com.amazonaws.aws-android-sdk-core -fabric-version=2.4.2 +fabric-version=2.4.3 fabric-build-type=binary diff --git a/aws-android-sdk-core/src/test/java/com/amazonaws/AmazonWebServiceClientTest.java b/aws-android-sdk-core/src/test/java/com/amazonaws/AmazonWebServiceClientTest.java index 1c69a3dce3e..f13b33d80b8 100644 --- a/aws-android-sdk-core/src/test/java/com/amazonaws/AmazonWebServiceClientTest.java +++ b/aws-android-sdk-core/src/test/java/com/amazonaws/AmazonWebServiceClientTest.java @@ -23,8 +23,6 @@ import com.amazonaws.auth.QueryStringSigner; import com.amazonaws.handlers.RequestHandler2; import com.amazonaws.http.ExecutionContext; -import com.amazonaws.regions.Region; -import com.amazonaws.regions.Regions; import org.junit.Assert; import org.junit.Test; @@ -36,19 +34,19 @@ public class AmazonWebServiceClientTest { @Test public void emptyClient() { - AmazonWebServiceClient client = + final AmazonWebServiceClient client = new AmazonWebServiceClient(new ClientConfiguration()) { }; try { client.getServiceName(); - } catch (IllegalStateException exception) { + } catch (final IllegalStateException exception) { } } @Test public void testDefaultSigner() { - AmazonTestClient client = new AmazonTestClient(); + final AmazonTestClient client = new AmazonTestClient(); Assert.assertEquals("test", client.getServiceName()); Assert.assertTrue(client.getSigner() instanceof AWS4Signer); @@ -56,19 +54,19 @@ public void testDefaultSigner() { @Test public void testOverrideSigner() { - ClientConfiguration config = new ClientConfiguration(); + final ClientConfiguration config = new ClientConfiguration(); config.setSignerOverride("QueryStringSignerType"); - AmazonTestClient client = new AmazonTestClient(config); + final AmazonTestClient client = new AmazonTestClient(config); Assert.assertTrue(client.getSigner() instanceof QueryStringSigner); } @Test public void setServiceNameIntern() { - AmazonTestClient client = new AmazonTestClient(); + final AmazonTestClient client = new AmazonTestClient(); assertEquals(client.getServiceName(), client.getServiceNameIntern()); - String serviceNameOverride = "foo"; + final String serviceNameOverride = "foo"; assertFalse(serviceNameOverride.equals(client.getServiceName())); client.setServiceNameIntern(serviceNameOverride); assertEquals(serviceNameOverride, client.getServiceName()); @@ -76,13 +74,13 @@ public void setServiceNameIntern() { @Test public void testGetServiceNameWithExplicitInternalConfiguration() { - AmazonSimpleDBClient testClient = new AmazonSimpleDBClient(); + final AmazonSimpleDBClient testClient = new AmazonSimpleDBClient(); assertEquals(testClient.getServiceName(), "sdb"); } @Test public void testGetServiceNameWithAWSPrefix() { - AWSTestClient testClient = new AWSTestClient(); + final AWSTestClient testClient = new AWSTestClient(); assertEquals(testClient.getServiceName(), "test"); } @@ -94,6 +92,7 @@ public AmazonTestClient() { public AmazonTestClient(final ClientConfiguration config) { super(config); super.setEndpoint("test.us-west-2.amazonaws.com"); + this.endpointPrefix = "test"; } } @@ -105,6 +104,7 @@ public AWSTestClient() { public AWSTestClient(final ClientConfiguration config) { super(config); super.setEndpoint("test.us-west-2.amazonaws.com"); + this.endpointPrefix = "test"; } } @@ -117,53 +117,45 @@ public AmazonSimpleDBClient() { public AmazonSimpleDBClient(final ClientConfiguration config) { super(config); super.setEndpoint("test.us-west-2.amazonaws.com"); + this.endpointPrefix = "test"; } } - @Test - public void testSetRegionNonExist() { - String endpoint = "someservice.us-east-1.amazonaws.com"; - AmazonTestClient client = new AmazonTestClient(); - client.setServiceNameIntern("someservice"); - client.setRegion(Region.getRegion(Regions.US_EAST_1)); - assertEquals(endpoint, client.endpoint.getHost()); - } - @Test public void testSetEndpoint() throws URISyntaxException { - AmazonTestClient client = new AmazonTestClient(); + final AmazonTestClient client = new AmazonTestClient(); client.setEndpoint("http://www.test.com"); assertEquals(client.endpoint, new URI("http://www.test.com")); } @Test public void testSetSignerRegionOverride() { - AmazonTestClient client = new AmazonTestClient(); + final AmazonTestClient client = new AmazonTestClient(); client.setSignerRegionOverride("test"); assertEquals(client.getSignerRegionOverride(), "test"); } @Test public void testCreateExecutionContextWithAmazonWebServiceRequest() { - AmazonWebServiceRequest awsr = new TestRequest(); - AmazonTestClient client = new AmazonTestClient(); - ExecutionContext ec = client.createExecutionContext(awsr); + final AmazonWebServiceRequest awsr = new TestRequest(); + final AmazonTestClient client = new AmazonTestClient(); + final ExecutionContext ec = client.createExecutionContext(awsr); assertEquals(client.requestHandler2s, ec.getRequestHandler2s()); } @Test public void testCreateExecutionContextWithRequest() { - AmazonWebServiceRequest awsr = new TestRequest(); - Request req = new DefaultRequest(awsr, "test"); + final AmazonWebServiceRequest awsr = new TestRequest(); + final Request req = new DefaultRequest(awsr, "test"); - AmazonTestClient client = new AmazonTestClient(); - ExecutionContext ec = client.createExecutionContext(req); + final AmazonTestClient client = new AmazonTestClient(); + final ExecutionContext ec = client.createExecutionContext(req); assertEquals(client.requestHandler2s, ec.getRequestHandler2s()); } @Test public void testAddAndRemoveRequestHandler2() { - RequestHandler2 rh = new RequestHandler2() { + final RequestHandler2 rh = new RequestHandler2() { @Override public void beforeRequest(Request request) { @@ -178,7 +170,7 @@ public void afterError(Request request, Response response, Exception e) { } }; - AmazonTestClient client = new AmazonTestClient(); + final AmazonTestClient client = new AmazonTestClient(); client.addRequestHandler(rh); assertEquals(client.requestHandler2s.size(), 1); assertSame(client.requestHandler2s.get(0), rh); @@ -189,7 +181,7 @@ public void afterError(Request request, Response response, Exception e) { @Test public void testTimeoffset() { - AmazonTestClient client = new AmazonTestClient(); + final AmazonTestClient client = new AmazonTestClient(); client.withTimeOffset(100); assertEquals(client.getTimeOffset(), 100); } diff --git a/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionTest.java b/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionTest.java index cb7fcc28c06..112c2e9edb6 100644 --- a/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionTest.java +++ b/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionTest.java @@ -33,23 +33,23 @@ public class RegionTest { @Test public void testDefaultDomain() { - String serviceName = "s3"; + final String serviceName = "s3"; assertEquals("empty domain", DEFAULT_DOMAIN, new Region(serviceName, "").getDomain()); assertEquals("null domain", DEFAULT_DOMAIN, new Region(serviceName, null).getDomain()); } @Test public void testRegionEquals() { - Region usWest2 = RegionUtils.getRegion("us-west-2"); - Region other = RegionUtils.getRegionByEndpoint("s3-us-west-2.amazonaws.com"); + final Region usWest2 = RegionUtils.getRegion("us-west-2"); + final Region other = RegionUtils.getRegionByEndpoint("s3-us-west-2.amazonaws.com"); assertEquals(usWest2, other); } @Test public void testInstantiateClientNoConfigOrCredentials() { - Region usEast1 = Region.getRegion(Regions.US_EAST_1); - AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, null, null); + final Region usEast1 = Region.getRegion(Regions.US_EAST_1); + final AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, null, null); assertNotNull(asc); assertNull(asc.provider); assertNull(asc.conf); @@ -57,8 +57,8 @@ public void testInstantiateClientNoConfigOrCredentials() { @Test public void testInstantiateClient() { - Region usEast1 = Region.getRegion(Regions.US_EAST_1); - AWSCredentialsProvider prov = new AWSCredentialsProvider() { + final Region usEast1 = Region.getRegion(Regions.US_EAST_1); + final AWSCredentialsProvider prov = new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { @@ -71,9 +71,9 @@ public void refresh() { }; - ClientConfiguration conf = new ClientConfiguration(); + final ClientConfiguration conf = new ClientConfiguration(); - AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, prov, conf); + final AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, prov, conf); assertNotNull(asc); assertSame(asc.provider, prov); assertSame(asc.conf, conf); @@ -81,8 +81,8 @@ public void refresh() { @Test public void testInstantiateClientNoConfig() { - Region usEast1 = Region.getRegion(Regions.US_EAST_1); - AWSCredentialsProvider prov = new AWSCredentialsProvider() { + final Region usEast1 = Region.getRegion(Regions.US_EAST_1); + final AWSCredentialsProvider prov = new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { @@ -94,7 +94,7 @@ public void refresh() { } }; - AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, prov, null); + final AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, prov, null); assertNotNull(asc); assertSame(asc.provider, prov); assertNull(asc.conf); @@ -102,10 +102,10 @@ public void refresh() { @Test public void testInstantiateClientNoCredentials() { - Region usEast1 = Region.getRegion(Regions.US_EAST_1); - ClientConfiguration conf = new ClientConfiguration(); + final Region usEast1 = Region.getRegion(Regions.US_EAST_1); + final ClientConfiguration conf = new ClientConfiguration(); conf.setConnectionTimeout(5); - AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, null, conf); + final AmazonServiceClient asc = usEast1.createClient(AmazonServiceClient.class, null, conf); assertNotNull(asc); assertSame(asc.conf, conf); assertNull(asc.provider); @@ -140,8 +140,14 @@ public AmazonServiceClient(AWSCredentialsProvider provider) { this.conf = null; } + @Override public String getEndpoint() { return endpoint.toString(); } + + @Override + public String getEndpointPrefix() { + return "amazon"; + } } } diff --git a/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionsTest.java b/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionsTest.java index 84c7c9fc3c0..38e188fc97d 100644 --- a/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionsTest.java +++ b/aws-android-sdk-core/src/test/java/com/amazonaws/regions/RegionsTest.java @@ -17,9 +17,6 @@ import static org.junit.Assert.assertEquals; -import com.amazonaws.AmazonWebServiceClient; -import com.amazonaws.ClientConfiguration; - import org.junit.Assert; import org.junit.Test; @@ -27,61 +24,18 @@ public class RegionsTest { @Test public void testDefaultDomain() { - Region region = new Region("region", null); + final Region region = new Region("region", null); Assert.assertEquals("amazonaws.com", region.getDomain()); } - @Test - public void testSetEndpointByRegion() { - - Region region = new Region("region", "example.com"); - region.getServiceEndpoints().put("service", - "service-region.example.com"); - - // This should use the configured region. - AmazonServiceClient service = new AmazonServiceClient(); - service.setRegion(region); - Assert.assertEquals("https://service-region.example.com", - service.getEndpoint()); - - // This should guess at an endpoint based on the region's domain. - AmazonUnknownServiceClient unknown = new AmazonUnknownServiceClient(); - unknown.setRegion(region); - Assert.assertEquals("https://unknownservice.region.example.com", - unknown.getEndpoint()); - } - @Test public void testFromName() { - Regions usEast1 = Regions.fromName("us-east-1"); + final Regions usEast1 = Regions.fromName("us-east-1"); assertEquals(usEast1, Regions.US_EAST_1); - Regions cn1 = Regions.fromName("cn-north-1"); + final Regions cn1 = Regions.fromName("cn-north-1"); assertEquals(cn1, Regions.CN_NORTH_1); - Regions govCloud = Regions.fromName("us-gov-west-1"); + final Regions govCloud = Regions.fromName("us-gov-west-1"); assertEquals(govCloud, Regions.GovCloud); assertEquals(usEast1.getName(), "us-east-1"); } - - private static class AmazonServiceClient extends AmazonWebServiceClient { - - public AmazonServiceClient() { - super(new ClientConfiguration()); - } - - public String getEndpoint() { - return endpoint.toString(); - } - } - - private static class AmazonUnknownServiceClient - extends AmazonWebServiceClient { - - public AmazonUnknownServiceClient() { - super(new ClientConfiguration()); - } - - public String getEndpoint() { - return endpoint.toString(); - } - } } diff --git a/aws-android-sdk-core/src/test/java/com/amazonaws/util/VersionInfoUtilsTest.java b/aws-android-sdk-core/src/test/java/com/amazonaws/util/VersionInfoUtilsTest.java index 1c689fbef73..0c75d3ab75e 100644 --- a/aws-android-sdk-core/src/test/java/com/amazonaws/util/VersionInfoUtilsTest.java +++ b/aws-android-sdk-core/src/test/java/com/amazonaws/util/VersionInfoUtilsTest.java @@ -24,7 +24,7 @@ public class VersionInfoUtilsTest { @Test public void getVersion() { - assertEquals("2.4.2", VersionInfoUtils.getVersion()); + assertEquals("2.4.3", VersionInfoUtils.getVersion()); } @Test diff --git a/aws-android-sdk-ddb-mapper/pom.xml b/aws-android-sdk-ddb-mapper/pom.xml index b7c42e72fe1..680a1464604 100644 --- a/aws-android-sdk-ddb-mapper/pom.xml +++ b/aws-android-sdk-ddb-mapper/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,19 +20,19 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 com.amazonaws aws-android-sdk-ddb false - 2.4.2 + 2.4.3 com.amazonaws aws-android-sdk-s3 false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-ddb/pom.xml b/aws-android-sdk-ddb/pom.xml index 70bcc9e2a7c..d4b6ef89afe 100644 --- a/aws-android-sdk-ddb/pom.xml +++ b/aws-android-sdk-ddb/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-ddb/src/main/java/com/amazonaws/services/dynamodbv2/AmazonDynamoDBClient.java b/aws-android-sdk-ddb/src/main/java/com/amazonaws/services/dynamodbv2/AmazonDynamoDBClient.java index f9f4a9745e5..be55da18b39 100644 --- a/aws-android-sdk-ddb/src/main/java/com/amazonaws/services/dynamodbv2/AmazonDynamoDBClient.java +++ b/aws-android-sdk-ddb/src/main/java/com/amazonaws/services/dynamodbv2/AmazonDynamoDBClient.java @@ -457,6 +457,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("dynamodb.us-east-1.amazonaws.com"); + this.endpointPrefix = "dynamodb"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-ec2/pom.xml b/aws-android-sdk-ec2/pom.xml index 287fedcd5af..378da6fbeba 100644 --- a/aws-android-sdk-ec2/pom.xml +++ b/aws-android-sdk-ec2/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-elb/pom.xml b/aws-android-sdk-elb/pom.xml index a453ab85361..720f070af77 100644 --- a/aws-android-sdk-elb/pom.xml +++ b/aws-android-sdk-elb/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-elb/src/main/java/com/amazonaws/services/elasticloadbalancing/AmazonElasticLoadBalancingClient.java b/aws-android-sdk-elb/src/main/java/com/amazonaws/services/elasticloadbalancing/AmazonElasticLoadBalancingClient.java index 18a9e3d5333..eb9246b89e1 100644 --- a/aws-android-sdk-elb/src/main/java/com/amazonaws/services/elasticloadbalancing/AmazonElasticLoadBalancingClient.java +++ b/aws-android-sdk-elb/src/main/java/com/amazonaws/services/elasticloadbalancing/AmazonElasticLoadBalancingClient.java @@ -306,6 +306,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("elasticloadbalancing.amazonaws.com"); + this.endpointPrefix = "elasticloadbalancing"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-iot/pom.xml b/aws-android-sdk-iot/pom.xml index 610ea03934f..e946dd14515 100644 --- a/aws-android-sdk-iot/pom.xml +++ b/aws-android-sdk-iot/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 org.eclipse.paho diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIot.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIot.java index dcbcf19aee2..83c25400077 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIot.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIot.java @@ -511,7 +511,7 @@ CreatePolicyVersionResult createPolicyVersion( /** *

- * Creates a thing in the Thing Registry. + * Creates a thing record in the thing registry. *

* * @param createThingRequest

@@ -537,6 +537,9 @@ CreatePolicyVersionResult createPolicyVersion( * @throws ResourceAlreadyExistsException

* The resource already exists. *

+ * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

* @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -548,6 +551,45 @@ CreatePolicyVersionResult createPolicyVersion( CreateThingResult createThing(CreateThingRequest createThingRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Creates a new thing type. + *

+ * + * @param createThingTypeRequest

+ * The input for the CreateThingType operation. + *

+ * @return createThingTypeResult The response from the CreateThingType + * service method, as returned by AWS IoT. + * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws ResourceAlreadyExistsException

+ * The resource already exists. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + CreateThingTypeResult createThingType(CreateThingTypeRequest createThingTypeRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Creates a rule. Creating rules is an administrator-level action. Any user @@ -816,7 +858,7 @@ DeleteRegistrationCodeResult deleteRegistrationCode( /** *

- * Deletes the specified thing from the Thing Registry. + * Deletes the specified thing. *

* * @param deleteThingRequest

@@ -827,6 +869,11 @@ DeleteRegistrationCodeResult deleteRegistrationCode( * @throws ResourceNotFoundException

* The specified resource does not exist. *

+ * @throws VersionConflictException

+ * An exception thrown when the version of a thing passed to a + * command is different than the version specified with the + * --version parameter. + *

* @throws InvalidRequestException

* The request is not valid. *

@@ -853,6 +900,50 @@ DeleteRegistrationCodeResult deleteRegistrationCode( DeleteThingResult deleteThing(DeleteThingRequest deleteThingRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Deletes the specified thing type . You cannot delete a thing type if it + * has things associated with it. To delete a thing type, first mark it as + * deprecated by calling DeprecateThingType, then remove any + * associated things by calling UpdateThing to change the thing type + * on any associated thing, and finally use DeleteThingType to delete + * the thing type. + *

+ * + * @param deleteThingTypeRequest

+ * The input for the DeleteThingType operation. + *

+ * @return deleteThingTypeResult The response from the DeleteThingType + * service method, as returned by AWS IoT. + * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

+ * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + DeleteThingTypeResult deleteThingType(DeleteThingTypeRequest deleteThingTypeRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Deletes the specified rule. @@ -884,6 +975,46 @@ DeleteThingResult deleteThing(DeleteThingRequest deleteThingRequest) void deleteTopicRule(DeleteTopicRuleRequest deleteTopicRuleRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Deprecates a thing type. You can not associate new things with deprecated + * thing type. + *

+ * + * @param deprecateThingTypeRequest

+ * The input for the DeprecateThingType operation. + *

+ * @return deprecateThingTypeResult The response from the DeprecateThingType + * service method, as returned by AWS IoT. + * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

+ * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + DeprecateThingTypeResult deprecateThingType(DeprecateThingTypeRequest deprecateThingTypeRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Describes a registered CA certificate. @@ -1033,6 +1164,45 @@ DescribeEndpointResult describeEndpoint(DescribeEndpointRequest describeEndpoint DescribeThingResult describeThing(DescribeThingRequest describeThingRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Gets information about the specified thing type. + *

+ * + * @param describeThingTypeRequest

+ * The input for the DescribeThingType operation. + *

+ * @return describeThingTypeResult The response from the DescribeThingType + * service method, as returned by AWS IoT. + * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

+ * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + DescribeThingTypeResult describeThingType(DescribeThingTypeRequest describeThingTypeRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Removes the specified policy from the specified certificate. @@ -1468,6 +1638,43 @@ ListCertificatesByCAResult listCertificatesByCA( ListCertificatesByCARequest listCertificatesByCARequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Lists certificates that are being transfered but not yet accepted. + *

+ * + * @param listOutgoingCertificatesRequest

+ * The input to the ListOutgoingCertificates operation. + *

+ * @return listOutgoingCertificatesResult The response from the + * ListOutgoingCertificates service method, as returned by AWS IoT. + * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + ListOutgoingCertificatesResult listOutgoingCertificates( + ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Lists your policies. @@ -1652,6 +1859,9 @@ ListPrincipalPoliciesResult listPrincipalPolicies( * @throws InternalFailureException

* An unexpected error has occurred. *

+ * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

* @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1689,6 +1899,9 @@ ListPrincipalThingsResult listPrincipalThings( * @throws InternalFailureException

* An unexpected error has occurred. *

+ * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

* @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1703,9 +1916,47 @@ ListThingPrincipalsResult listThingPrincipals( /** *

- * Lists your things. You can pass an AttributeName or AttributeValue to - * filter your things (for example, - * "ListThings where AttributeName=Color and AttributeValue=Red"). + * Lists the existing thing types. + *

+ * + * @param listThingTypesRequest

+ * The input for the ListThingTypes operation. + *

+ * @return listThingTypesResult The response from the ListThingTypes service + * method, as returned by AWS IoT. + * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + ListThingTypesResult listThingTypes(ListThingTypesRequest listThingTypesRequest) + throws AmazonClientException, AmazonServiceException; + + /** + *

+ * Lists your things. Use the attributeName and attributeValue + * parameters to filter your things. For example, calling + * ListThings with attributeName=Color and attributeValue=Red + * retrieves all things in the registry that contain an attribute + * Color with the value Red. *

* * @param listThingsRequest

@@ -2199,6 +2450,11 @@ void updateCertificate(UpdateCertificateRequest updateCertificateRequest) * @throws InvalidRequestException

* The request is not valid. *

+ * @throws VersionConflictException

+ * An exception thrown when the version of a thing passed to a + * command is different than the version specified with the + * --version parameter. + *

* @throws ThrottlingException

* The rate exceeds the limit. *

diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIotClient.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIotClient.java index c228418d222..7898a423353 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIotClient.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/AWSIotClient.java @@ -286,11 +286,13 @@ private void init() { jsonErrorUnmarshallers.add(new TransferAlreadyCompletedExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new TransferConflictExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnauthorizedExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new VersionConflictExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new VersionsLimitExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new JsonErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("iot.us-east-1.amazonaws.com"); + this.endpointPrefix = "iot"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( @@ -914,7 +916,7 @@ public CreatePolicyVersionResult createPolicyVersion( /** *

- * Creates a thing in the Thing Registry. + * Creates a thing record in the thing registry. *

* * @param createThingRequest

@@ -940,6 +942,9 @@ public CreatePolicyVersionResult createPolicyVersion( * @throws ResourceAlreadyExistsException

* The resource already exists. *

+ * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

* @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -976,6 +981,70 @@ public CreateThingResult createThing(CreateThingRequest createThingRequest) } } + /** + *

+ * Creates a new thing type. + *

+ * + * @param createThingTypeRequest

+ * The input for the CreateThingType operation. + *

+ * @return createThingTypeResult The response from the CreateThingType + * service method, as returned by AWS IoT. + * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws ResourceAlreadyExistsException

+ * The resource already exists. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + public CreateThingTypeResult createThingType(CreateThingTypeRequest createThingTypeRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(createThingTypeRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new CreateThingTypeRequestMarshaller().marshall(createThingTypeRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new CreateThingTypeResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Creates a rule. Creating rules is an administrator-level action. Any user @@ -1378,7 +1447,7 @@ public DeleteRegistrationCodeResult deleteRegistrationCode( /** *

- * Deletes the specified thing from the Thing Registry. + * Deletes the specified thing. *

* * @param deleteThingRequest

@@ -1389,6 +1458,11 @@ public DeleteRegistrationCodeResult deleteRegistrationCode( * @throws ResourceNotFoundException

* The specified resource does not exist. *

+ * @throws VersionConflictException

+ * An exception thrown when the version of a thing passed to a + * command is different than the version specified with the + * --version parameter. + *

* @throws InvalidRequestException

* The request is not valid. *

@@ -1440,6 +1514,75 @@ public DeleteThingResult deleteThing(DeleteThingRequest deleteThingRequest) } } + /** + *

+ * Deletes the specified thing type . You cannot delete a thing type if it + * has things associated with it. To delete a thing type, first mark it as + * deprecated by calling DeprecateThingType, then remove any + * associated things by calling UpdateThing to change the thing type + * on any associated thing, and finally use DeleteThingType to delete + * the thing type. + *

+ * + * @param deleteThingTypeRequest

+ * The input for the DeleteThingType operation. + *

+ * @return deleteThingTypeResult The response from the DeleteThingType + * service method, as returned by AWS IoT. + * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

+ * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + public DeleteThingTypeResult deleteThingType(DeleteThingTypeRequest deleteThingTypeRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(deleteThingTypeRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DeleteThingTypeRequestMarshaller().marshall(deleteThingTypeRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DeleteThingTypeResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Deletes the specified rule. @@ -1491,6 +1634,73 @@ public void deleteTopicRule(DeleteTopicRuleRequest deleteTopicRuleRequest) } } + /** + *

+ * Deprecates a thing type. You can not associate new things with deprecated + * thing type. + *

+ * + * @param deprecateThingTypeRequest

+ * The input for the DeprecateThingType operation. + *

+ * @return deprecateThingTypeResult The response from the DeprecateThingType + * service method, as returned by AWS IoT. + * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

+ * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + public DeprecateThingTypeResult deprecateThingType( + DeprecateThingTypeRequest deprecateThingTypeRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(deprecateThingTypeRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DeprecateThingTypeRequestMarshaller() + .marshall(deprecateThingTypeRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DeprecateThingTypeResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Describes a registered CA certificate. @@ -1742,6 +1952,72 @@ public DescribeThingResult describeThing(DescribeThingRequest describeThingReque } } + /** + *

+ * Gets information about the specified thing type. + *

+ * + * @param describeThingTypeRequest

+ * The input for the DescribeThingType operation. + *

+ * @return describeThingTypeResult The response from the DescribeThingType + * service method, as returned by AWS IoT. + * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

+ * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + public DescribeThingTypeResult describeThingType( + DescribeThingTypeRequest describeThingTypeRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(describeThingTypeRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DescribeThingTypeRequestMarshaller() + .marshall(describeThingTypeRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DescribeThingTypeResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Removes the specified policy from the specified certificate. @@ -2470,6 +2746,69 @@ public ListCertificatesByCAResult listCertificatesByCA( } } + /** + *

+ * Lists certificates that are being transfered but not yet accepted. + *

+ * + * @param listOutgoingCertificatesRequest

+ * The input to the ListOutgoingCertificates operation. + *

+ * @return listOutgoingCertificatesResult The response from the + * ListOutgoingCertificates service method, as returned by AWS IoT. + * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + public ListOutgoingCertificatesResult listOutgoingCertificates( + ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(listOutgoingCertificatesRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new ListOutgoingCertificatesRequestMarshaller() + .marshall(listOutgoingCertificatesRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new ListOutgoingCertificatesResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Lists your policies. @@ -2758,6 +3097,9 @@ public ListPrincipalPoliciesResult listPrincipalPolicies( * @throws InternalFailureException

* An unexpected error has occurred. *

+ * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

* @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -2821,6 +3163,9 @@ public ListPrincipalThingsResult listPrincipalThings( * @throws InternalFailureException

* An unexpected error has occurred. *

+ * @throws ResourceNotFoundException

+ * The specified resource does not exist. + *

* @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -2861,9 +3206,72 @@ public ListThingPrincipalsResult listThingPrincipals( /** *

- * Lists your things. You can pass an AttributeName or AttributeValue to - * filter your things (for example, - * "ListThings where AttributeName=Color and AttributeValue=Red"). + * Lists the existing thing types. + *

+ * + * @param listThingTypesRequest

+ * The input for the ListThingTypes operation. + *

+ * @return listThingTypesResult The response from the ListThingTypes service + * method, as returned by AWS IoT. + * @throws InvalidRequestException

+ * The request is not valid. + *

+ * @throws ThrottlingException

+ * The rate exceeds the limit. + *

+ * @throws UnauthorizedException

+ * You are not authorized to perform this operation. + *

+ * @throws ServiceUnavailableException

+ * The service is temporarily unavailable. + *

+ * @throws InternalFailureException

+ * An unexpected error has occurred. + *

+ * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by AWS + * IoT indicating either a problem with the data in the request, + * or a server side issue. + */ + public ListThingTypesResult listThingTypes(ListThingTypesRequest listThingTypesRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(listThingTypesRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new ListThingTypesRequestMarshaller().marshall(listThingTypesRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new ListThingTypesResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Lists your things. Use the attributeName and attributeValue + * parameters to filter your things. For example, calling + * ListThings with attributeName=Color and attributeValue=Red + * retrieves all things in the registry that contain an attribute + * Color with the value Red. *

* * @param listThingsRequest

@@ -3612,6 +4020,11 @@ public void updateCertificate(UpdateCertificateRequest updateCertificateRequest) * @throws InvalidRequestException

* The request is not valid. *

+ * @throws VersionConflictException

+ * An exception thrown when the version of a thing passed to a + * command is different than the version specified with the + * --version parameter. + *

* @throws ThrottlingException

* The rate exceeds the limit. *

diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Action.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Action.java index 285a0e20768..d0159e04641 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Action.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Action.java @@ -30,6 +30,15 @@ public class Action implements Serializable { */ private DynamoDBAction dynamoDB; + /** + *

+ * Write to a DynamoDB table. This is a new version of the DynamoDB action. + * It allows you to write each attribute in an MQTT message payload into a + * separate DynamoDB column. + *

+ */ + private DynamoDBv2Action dynamoDBv2; + /** *

* Invoke a Lambda function. @@ -95,7 +104,7 @@ public class Action implements Serializable { /** *

- * Write data to an Amazon Elasticsearch Service; domain. + * Write data to an Amazon Elasticsearch Service domain. *

*/ private ElasticsearchAction elasticsearch; @@ -145,6 +154,63 @@ public Action withDynamoDB(DynamoDBAction dynamoDB) { return this; } + /** + *

+ * Write to a DynamoDB table. This is a new version of the DynamoDB action. + * It allows you to write each attribute in an MQTT message payload into a + * separate DynamoDB column. + *

+ * + * @return

+ * Write to a DynamoDB table. This is a new version of the DynamoDB + * action. It allows you to write each attribute in an MQTT message + * payload into a separate DynamoDB column. + *

+ */ + public DynamoDBv2Action getDynamoDBv2() { + return dynamoDBv2; + } + + /** + *

+ * Write to a DynamoDB table. This is a new version of the DynamoDB action. + * It allows you to write each attribute in an MQTT message payload into a + * separate DynamoDB column. + *

+ * + * @param dynamoDBv2

+ * Write to a DynamoDB table. This is a new version of the + * DynamoDB action. It allows you to write each attribute in an + * MQTT message payload into a separate DynamoDB column. + *

+ */ + public void setDynamoDBv2(DynamoDBv2Action dynamoDBv2) { + this.dynamoDBv2 = dynamoDBv2; + } + + /** + *

+ * Write to a DynamoDB table. This is a new version of the DynamoDB action. + * It allows you to write each attribute in an MQTT message payload into a + * separate DynamoDB column. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param dynamoDBv2

+ * Write to a DynamoDB table. This is a new version of the + * DynamoDB action. It allows you to write each attribute in an + * MQTT message payload into a separate DynamoDB column. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public Action withDynamoDBv2(DynamoDBv2Action dynamoDBv2) { + this.dynamoDBv2 = dynamoDBv2; + return this; + } + /** *

* Invoke a Lambda function. @@ -552,11 +618,11 @@ public Action withCloudwatchAlarm(CloudwatchAlarmAction cloudwatchAlarm) { /** *

- * Write data to an Amazon Elasticsearch Service; domain. + * Write data to an Amazon Elasticsearch Service domain. *

* * @return

- * Write data to an Amazon Elasticsearch Service; domain. + * Write data to an Amazon Elasticsearch Service domain. *

*/ public ElasticsearchAction getElasticsearch() { @@ -565,11 +631,11 @@ public ElasticsearchAction getElasticsearch() { /** *

- * Write data to an Amazon Elasticsearch Service; domain. + * Write data to an Amazon Elasticsearch Service domain. *

* * @param elasticsearch

- * Write data to an Amazon Elasticsearch Service; domain. + * Write data to an Amazon Elasticsearch Service domain. *

*/ public void setElasticsearch(ElasticsearchAction elasticsearch) { @@ -578,14 +644,14 @@ public void setElasticsearch(ElasticsearchAction elasticsearch) { /** *

- * Write data to an Amazon Elasticsearch Service; domain. + * Write data to an Amazon Elasticsearch Service domain. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param elasticsearch

- * Write data to an Amazon Elasticsearch Service; domain. + * Write data to an Amazon Elasticsearch Service domain. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -608,6 +674,8 @@ public String toString() { sb.append("{"); if (getDynamoDB() != null) sb.append("dynamoDB: " + getDynamoDB() + ","); + if (getDynamoDBv2() != null) + sb.append("dynamoDBv2: " + getDynamoDBv2() + ","); if (getLambda() != null) sb.append("lambda: " + getLambda() + ","); if (getSns() != null) @@ -638,6 +706,7 @@ public int hashCode() { int hashCode = 1; hashCode = prime * hashCode + ((getDynamoDB() == null) ? 0 : getDynamoDB().hashCode()); + hashCode = prime * hashCode + ((getDynamoDBv2() == null) ? 0 : getDynamoDBv2().hashCode()); hashCode = prime * hashCode + ((getLambda() == null) ? 0 : getLambda().hashCode()); hashCode = prime * hashCode + ((getSns() == null) ? 0 : getSns().hashCode()); hashCode = prime * hashCode + ((getSqs() == null) ? 0 : getSqs().hashCode()); @@ -669,6 +738,11 @@ public boolean equals(Object obj) { return false; if (other.getDynamoDB() != null && other.getDynamoDB().equals(this.getDynamoDB()) == false) return false; + if (other.getDynamoDBv2() == null ^ this.getDynamoDBv2() == null) + return false; + if (other.getDynamoDBv2() != null + && other.getDynamoDBv2().equals(this.getDynamoDBv2()) == false) + return false; if (other.getLambda() == null ^ this.getLambda() == null) return false; if (other.getLambda() != null && other.getLambda().equals(this.getLambda()) == false) diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttachThingPrincipalRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttachThingPrincipalRequest.java index cac83cec191..b885caea6af 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttachThingPrincipalRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttachThingPrincipalRequest.java @@ -32,13 +32,13 @@ public class AttachThingPrincipalRequest extends AmazonWebServiceRequest impleme *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * The principal (certificate or other credential). + * The principal, such as a certificate or other credential. *

*/ private String principal; @@ -50,7 +50,7 @@ public class AttachThingPrincipalRequest extends AmazonWebServiceRequest impleme *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the thing. @@ -67,7 +67,7 @@ public String getThingName() { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -87,7 +87,7 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -102,11 +102,11 @@ public AttachThingPrincipalRequest withThingName(String thingName) { /** *

- * The principal (certificate or other credential). + * The principal, such as a certificate or other credential. *

* * @return

- * The principal (certificate or other credential). + * The principal, such as a certificate or other credential. *

*/ public String getPrincipal() { @@ -115,11 +115,11 @@ public String getPrincipal() { /** *

- * The principal (certificate or other credential). + * The principal, such as a certificate or other credential. *

* * @param principal

- * The principal (certificate or other credential). + * The principal, such as a certificate or other credential. *

*/ public void setPrincipal(String principal) { @@ -128,14 +128,14 @@ public void setPrincipal(String principal) { /** *

- * The principal (certificate or other credential). + * The principal, such as a certificate or other credential. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param principal

- * The principal (certificate or other credential). + * The principal, such as a certificate or other credential. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttributePayload.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttributePayload.java index 1980c5e56e9..684c4aad8e6 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttributePayload.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttributePayload.java @@ -19,28 +19,55 @@ /** *

- * The attribute payload, a JSON string containing up to three key-value pairs - * (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * The attribute payload. *

*/ public class AttributePayload implements Serializable { /** *

- * A JSON string containing up to three key-value pair in JSON format (for - * example, {\"attributes\":{\"string1\":\"string2\"}}). + * A JSON string containing up to three key-value pair in JSON format. For + * example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*/ private java.util.Map attributes; /** *

- * A JSON string containing up to three key-value pair in JSON format (for - * example, {\"attributes\":{\"string1\":\"string2\"}}). + * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes stored in the + * registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an empty + * attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ */ + private Boolean merge; + + /** + *

+ * A JSON string containing up to three key-value pair in JSON format. For + * example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

* * @return

* A JSON string containing up to three key-value pair in JSON - * format (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * format. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*/ public java.util.Map getAttributes() { @@ -49,14 +76,19 @@ public java.util.Map getAttributes() { /** *

- * A JSON string containing up to three key-value pair in JSON format (for - * example, {\"attributes\":{\"string1\":\"string2\"}}). + * A JSON string containing up to three key-value pair in JSON format. For + * example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

* * @param attributes

* A JSON string containing up to three key-value pair in JSON - * format (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * format. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*/ public void setAttributes(java.util.Map attributes) { @@ -65,8 +97,11 @@ public void setAttributes(java.util.Map attributes) { /** *

- * A JSON string containing up to three key-value pair in JSON format (for - * example, {\"attributes\":{\"string1\":\"string2\"}}). + * A JSON string containing up to three key-value pair in JSON format. For + * example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*

* Returns a reference to this object so that method calls can be chained @@ -74,8 +109,10 @@ public void setAttributes(java.util.Map attributes) { * * @param attributes

* A JSON string containing up to three key-value pair in JSON - * format (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * format. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

* @return A reference to this updated object so that method calls can be * chained together. @@ -87,8 +124,11 @@ public AttributePayload withAttributes(java.util.Map attributes) /** *

- * A JSON string containing up to three key-value pair in JSON format (for - * example, {\"attributes\":{\"string1\":\"string2\"}}). + * A JSON string containing up to three key-value pair in JSON format. For + * example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*

* The method adds a new key-value pair into attributes parameter, and @@ -123,6 +163,160 @@ public AttributePayload clearattributesEntries() { return this; } + /** + *

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes stored in the + * registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an empty + * attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ * + * @return

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes + * stored in the registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an + * empty attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ */ + public Boolean isMerge() { + return merge; + } + + /** + *

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes stored in the + * registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an empty + * attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ * + * @return

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes + * stored in the registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an + * empty attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ */ + public Boolean getMerge() { + return merge; + } + + /** + *

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes stored in the + * registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an empty + * attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ * + * @param merge

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes + * stored in the registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an + * empty attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ */ + public void setMerge(Boolean merge) { + this.merge = merge; + } + + /** + *

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes stored in the + * registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an empty + * attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param merge

+ * Specifies whether the list of attributes provided in the + * AttributePayload is merged with the attributes + * stored in the registry, instead of overwriting them. + *

+ *

+ * To remove an attribute, call UpdateThing with an + * empty attribute value. + *

+ * + *

+ * The merge attribute is only valid when calling + * UpdateThing. + *

+ *
+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AttributePayload withMerge(Boolean merge) { + this.merge = merge; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -135,7 +329,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAttributes() != null) - sb.append("attributes: " + getAttributes()); + sb.append("attributes: " + getAttributes() + ","); + if (getMerge() != null) + sb.append("merge: " + getMerge()); sb.append("}"); return sb.toString(); } @@ -146,6 +342,7 @@ public int hashCode() { int hashCode = 1; hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); + hashCode = prime * hashCode + ((getMerge() == null) ? 0 : getMerge().hashCode()); return hashCode; } @@ -165,6 +362,10 @@ public boolean equals(Object obj) { if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; + if (other.getMerge() == null ^ this.getMerge() == null) + return false; + if (other.getMerge() != null && other.getMerge().equals(this.getMerge()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AutoRegistrationStatus.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AutoRegistrationStatus.java new file mode 100644 index 00000000000..e9dcbc29b77 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AutoRegistrationStatus.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Auto Registration Status + */ +public enum AutoRegistrationStatus { + + ENABLE("ENABLE"), + DISABLE("DISABLE"); + + private String value; + + private AutoRegistrationStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("ENABLE", ENABLE); + enumMap.put("DISABLE", DISABLE); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return AutoRegistrationStatus corresponding to the value + */ + public static AutoRegistrationStatus fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CACertificateDescription.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CACertificateDescription.java index a992163986a..e95f8213a3d 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CACertificateDescription.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CACertificateDescription.java @@ -78,6 +78,17 @@ public class CACertificateDescription implements Serializable { */ private java.util.Date creationDate; + /** + *

+ * Whether the CA certificate configured for auto registration of device + * certificates. Valid values are "ENABLE" and "DISABLE" + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + */ + private String autoRegistrationStatus; + /** *

* The CA certificate ARN. @@ -430,6 +441,114 @@ public CACertificateDescription withCreationDate(java.util.Date creationDate) { return this; } + /** + *

+ * Whether the CA certificate configured for auto registration of device + * certificates. Valid values are "ENABLE" and "DISABLE" + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @return

+ * Whether the CA certificate configured for auto registration of + * device certificates. Valid values are "ENABLE" and "DISABLE" + *

+ * @see AutoRegistrationStatus + */ + public String getAutoRegistrationStatus() { + return autoRegistrationStatus; + } + + /** + *

+ * Whether the CA certificate configured for auto registration of device + * certificates. Valid values are "ENABLE" and "DISABLE" + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param autoRegistrationStatus

+ * Whether the CA certificate configured for auto registration of + * device certificates. Valid values are "ENABLE" and "DISABLE" + *

+ * @see AutoRegistrationStatus + */ + public void setAutoRegistrationStatus(String autoRegistrationStatus) { + this.autoRegistrationStatus = autoRegistrationStatus; + } + + /** + *

+ * Whether the CA certificate configured for auto registration of device + * certificates. Valid values are "ENABLE" and "DISABLE" + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param autoRegistrationStatus

+ * Whether the CA certificate configured for auto registration of + * device certificates. Valid values are "ENABLE" and "DISABLE" + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoRegistrationStatus + */ + public CACertificateDescription withAutoRegistrationStatus(String autoRegistrationStatus) { + this.autoRegistrationStatus = autoRegistrationStatus; + return this; + } + + /** + *

+ * Whether the CA certificate configured for auto registration of device + * certificates. Valid values are "ENABLE" and "DISABLE" + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param autoRegistrationStatus

+ * Whether the CA certificate configured for auto registration of + * device certificates. Valid values are "ENABLE" and "DISABLE" + *

+ * @see AutoRegistrationStatus + */ + public void setAutoRegistrationStatus(AutoRegistrationStatus autoRegistrationStatus) { + this.autoRegistrationStatus = autoRegistrationStatus.toString(); + } + + /** + *

+ * Whether the CA certificate configured for auto registration of device + * certificates. Valid values are "ENABLE" and "DISABLE" + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param autoRegistrationStatus

+ * Whether the CA certificate configured for auto registration of + * device certificates. Valid values are "ENABLE" and "DISABLE" + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoRegistrationStatus + */ + public CACertificateDescription withAutoRegistrationStatus( + AutoRegistrationStatus autoRegistrationStatus) { + this.autoRegistrationStatus = autoRegistrationStatus.toString(); + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -452,7 +571,9 @@ public String toString() { if (getOwnedBy() != null) sb.append("ownedBy: " + getOwnedBy() + ","); if (getCreationDate() != null) - sb.append("creationDate: " + getCreationDate()); + sb.append("creationDate: " + getCreationDate() + ","); + if (getAutoRegistrationStatus() != null) + sb.append("autoRegistrationStatus: " + getAutoRegistrationStatus()); sb.append("}"); return sb.toString(); } @@ -472,6 +593,10 @@ public int hashCode() { hashCode = prime * hashCode + ((getOwnedBy() == null) ? 0 : getOwnedBy().hashCode()); hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); + hashCode = prime + * hashCode + + ((getAutoRegistrationStatus() == null) ? 0 : getAutoRegistrationStatus() + .hashCode()); return hashCode; } @@ -514,6 +639,11 @@ public boolean equals(Object obj) { if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false) return false; + if (other.getAutoRegistrationStatus() == null ^ this.getAutoRegistrationStatus() == null) + return false; + if (other.getAutoRegistrationStatus() != null + && other.getAutoRegistrationStatus().equals(this.getAutoRegistrationStatus()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CannedAccessControlList.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CannedAccessControlList.java new file mode 100644 index 00000000000..3d9e0d68a93 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CannedAccessControlList.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Canned Access Control List + */ +public enum CannedAccessControlList { + + Private("private"), + PublicRead("public-read"), + PublicReadWrite("public-read-write"), + AwsExecRead("aws-exec-read"), + AuthenticatedRead("authenticated-read"), + BucketOwnerRead("bucket-owner-read"), + BucketOwnerFullControl("bucket-owner-full-control"), + LogDeliveryWrite("log-delivery-write"); + + private String value; + + private CannedAccessControlList(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("private", Private); + enumMap.put("public-read", PublicRead); + enumMap.put("public-read-write", PublicReadWrite); + enumMap.put("aws-exec-read", AwsExecRead); + enumMap.put("authenticated-read", AuthenticatedRead); + enumMap.put("bucket-owner-read", BucketOwnerRead); + enumMap.put("bucket-owner-full-control", BucketOwnerFullControl); + enumMap.put("log-delivery-write", LogDeliveryWrite); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return CannedAccessControlList corresponding to the value + */ + public static CannedAccessControlList fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Certificate.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Certificate.java index a3254ed4dc9..5d3b7539901 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Certificate.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/Certificate.java @@ -51,7 +51,7 @@ public class Certificate implements Serializable { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION */ private String status; @@ -174,7 +174,7 @@ public Certificate withCertificateId(String certificateId) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @return

* The status of the certificate. @@ -199,7 +199,7 @@ public String getStatus() { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. @@ -227,7 +227,7 @@ public void setStatus(String status) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. @@ -255,7 +255,7 @@ public Certificate withStatus(String status) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. @@ -283,7 +283,7 @@ public void setStatus(CertificateStatus status) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateDescription.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateDescription.java index 14f5a7afe0b..e69d6d6b65d 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateDescription.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateDescription.java @@ -59,7 +59,7 @@ public class CertificateDescription implements Serializable { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION */ private String status; @@ -283,7 +283,7 @@ public CertificateDescription withCaCertificateId(String caCertificateId) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @return

* The status of the certificate. @@ -301,7 +301,7 @@ public String getStatus() { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. @@ -322,7 +322,7 @@ public void setStatus(String status) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. @@ -343,7 +343,7 @@ public CertificateDescription withStatus(String status) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. @@ -364,7 +364,7 @@ public void setStatus(CertificateStatus status) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param status

* The status of the certificate. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateStatus.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateStatus.java index c33ecaf590d..926c4537988 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateStatus.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CertificateStatus.java @@ -27,7 +27,8 @@ public enum CertificateStatus { INACTIVE("INACTIVE"), REVOKED("REVOKED"), PENDING_TRANSFER("PENDING_TRANSFER"), - REGISTER_INACTIVE("REGISTER_INACTIVE"); + REGISTER_INACTIVE("REGISTER_INACTIVE"), + PENDING_ACTIVATION("PENDING_ACTIVATION"); private String value; @@ -48,6 +49,7 @@ public String toString() { enumMap.put("REVOKED", REVOKED); enumMap.put("PENDING_TRANSFER", PENDING_TRANSFER); enumMap.put("REGISTER_INACTIVE", REGISTER_INACTIVE); + enumMap.put("PENDING_ACTIVATION", PENDING_ACTIVATION); } /** diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingRequest.java index cb124ee3717..47161a01527 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingRequest.java @@ -21,40 +21,54 @@ /** *

- * Creates a thing in the Thing Registry. + * Creates a thing record in the thing registry. *

*/ public class CreateThingRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * The name of the thing. + * The name of the thing to create. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * The attribute payload, which consists of up to 3 name/value pairs in a - * JSON document (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * The name of the thing type associated with the new thing. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The attribute payload, which consists of up to three name/value pairs in + * a JSON document. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*/ private AttributePayload attributePayload; /** *

- * The name of the thing. + * The name of the thing to create. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

- * The name of the thing. + * The name of the thing to create. *

*/ public String getThingName() { @@ -63,15 +77,15 @@ public String getThingName() { /** *

- * The name of the thing. + * The name of the thing to create. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The name of the thing. + * The name of the thing to create. *

*/ public void setThingName(String thingName) { @@ -80,7 +94,7 @@ public void setThingName(String thingName) { /** *

- * The name of the thing. + * The name of the thing to create. *

*

* Returns a reference to this object so that method calls can be chained @@ -88,10 +102,10 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The name of the thing. + * The name of the thing to create. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -103,14 +117,76 @@ public CreateThingRequest withThingName(String thingName) { /** *

- * The attribute payload, which consists of up to 3 name/value pairs in a - * JSON document (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * The name of the thing type associated with the new thing. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type associated with the new thing. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type associated with the new thing. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type associated with the new thing. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type associated with the new thing. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type associated with the new thing. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateThingRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * The attribute payload, which consists of up to three name/value pairs in + * a JSON document. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

* * @return

- * The attribute payload, which consists of up to 3 name/value pairs - * in a JSON document (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * The attribute payload, which consists of up to three name/value + * pairs in a JSON document. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*/ public AttributePayload getAttributePayload() { @@ -119,14 +195,19 @@ public AttributePayload getAttributePayload() { /** *

- * The attribute payload, which consists of up to 3 name/value pairs in a - * JSON document (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * The attribute payload, which consists of up to three name/value pairs in + * a JSON document. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

* * @param attributePayload

- * The attribute payload, which consists of up to 3 name/value - * pairs in a JSON document (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * The attribute payload, which consists of up to three + * name/value pairs in a JSON document. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*/ public void setAttributePayload(AttributePayload attributePayload) { @@ -135,17 +216,22 @@ public void setAttributePayload(AttributePayload attributePayload) { /** *

- * The attribute payload, which consists of up to 3 name/value pairs in a - * JSON document (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * The attribute payload, which consists of up to three name/value pairs in + * a JSON document. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param attributePayload

- * The attribute payload, which consists of up to 3 name/value - * pairs in a JSON document (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * The attribute payload, which consists of up to three + * name/value pairs in a JSON document. For example: + *

+ *

+ * {\"attributes\":{\"string1\":\"string2\"}}) *

* @return A reference to this updated object so that method calls can be * chained together. @@ -168,6 +254,8 @@ public String toString() { sb.append("{"); if (getThingName() != null) sb.append("thingName: " + getThingName() + ","); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); if (getAttributePayload() != null) sb.append("attributePayload: " + getAttributePayload()); sb.append("}"); @@ -180,6 +268,8 @@ public int hashCode() { int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributePayload() == null) ? 0 : getAttributePayload().hashCode()); return hashCode; @@ -201,6 +291,11 @@ public boolean equals(Object obj) { if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; if (other.getAttributePayload() == null ^ this.getAttributePayload() == null) return false; if (other.getAttributePayload() != null diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingResult.java index 83b08dd13c9..bdd512a92ca 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingResult.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingResult.java @@ -25,33 +25,33 @@ public class CreateThingResult implements Serializable { /** *

- * The name of the thing. + * The name of the new thing. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * The thing ARN. + * The ARN of the new thing. *

*/ private String thingArn; /** *

- * The name of the thing. + * The name of the new thing. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

- * The name of the thing. + * The name of the new thing. *

*/ public String getThingName() { @@ -60,15 +60,15 @@ public String getThingName() { /** *

- * The name of the thing. + * The name of the new thing. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The name of the thing. + * The name of the new thing. *

*/ public void setThingName(String thingName) { @@ -77,7 +77,7 @@ public void setThingName(String thingName) { /** *

- * The name of the thing. + * The name of the new thing. *

*

* Returns a reference to this object so that method calls can be chained @@ -85,10 +85,10 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The name of the thing. + * The name of the new thing. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -100,11 +100,11 @@ public CreateThingResult withThingName(String thingName) { /** *

- * The thing ARN. + * The ARN of the new thing. *

* * @return

- * The thing ARN. + * The ARN of the new thing. *

*/ public String getThingArn() { @@ -113,11 +113,11 @@ public String getThingArn() { /** *

- * The thing ARN. + * The ARN of the new thing. *

* * @param thingArn

- * The thing ARN. + * The ARN of the new thing. *

*/ public void setThingArn(String thingArn) { @@ -126,14 +126,14 @@ public void setThingArn(String thingArn) { /** *

- * The thing ARN. + * The ARN of the new thing. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param thingArn

- * The thing ARN. + * The ARN of the new thing. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingTypeRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingTypeRequest.java new file mode 100644 index 00000000000..10cf70b6891 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingTypeRequest.java @@ -0,0 +1,216 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Creates a new thing type. + *

+ */ +public class CreateThingTypeRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The ThingTypeProperties for the thing type to create. It contains + * information about the new thing type including a description, and a list + * of searchable thing attribute names. + *

+ */ + private ThingTypeProperties thingTypeProperties; + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateThingTypeRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * The ThingTypeProperties for the thing type to create. It contains + * information about the new thing type including a description, and a list + * of searchable thing attribute names. + *

+ * + * @return

+ * The ThingTypeProperties for the thing type to create. It contains + * information about the new thing type including a description, and + * a list of searchable thing attribute names. + *

+ */ + public ThingTypeProperties getThingTypeProperties() { + return thingTypeProperties; + } + + /** + *

+ * The ThingTypeProperties for the thing type to create. It contains + * information about the new thing type including a description, and a list + * of searchable thing attribute names. + *

+ * + * @param thingTypeProperties

+ * The ThingTypeProperties for the thing type to create. It + * contains information about the new thing type including a + * description, and a list of searchable thing attribute names. + *

+ */ + public void setThingTypeProperties(ThingTypeProperties thingTypeProperties) { + this.thingTypeProperties = thingTypeProperties; + } + + /** + *

+ * The ThingTypeProperties for the thing type to create. It contains + * information about the new thing type including a description, and a list + * of searchable thing attribute names. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypeProperties

+ * The ThingTypeProperties for the thing type to create. It + * contains information about the new thing type including a + * description, and a list of searchable thing attribute names. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateThingTypeRequest withThingTypeProperties(ThingTypeProperties thingTypeProperties) { + this.thingTypeProperties = thingTypeProperties; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); + if (getThingTypeProperties() != null) + sb.append("thingTypeProperties: " + getThingTypeProperties()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeProperties() == null) ? 0 : getThingTypeProperties().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateThingTypeRequest == false) + return false; + CreateThingTypeRequest other = (CreateThingTypeRequest) obj; + + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + if (other.getThingTypeProperties() == null ^ this.getThingTypeProperties() == null) + return false; + if (other.getThingTypeProperties() != null + && other.getThingTypeProperties().equals(this.getThingTypeProperties()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingTypeResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingTypeResult.java new file mode 100644 index 00000000000..66b7686dea0 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateThingTypeResult.java @@ -0,0 +1,200 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The output of the CreateThingType operation. + *

+ */ +public class CreateThingTypeResult implements Serializable { + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The Amazon Resource Name (ARN) of the thing type. + *

+ */ + private String thingTypeArn; + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateThingTypeResult withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * The Amazon Resource Name (ARN) of the thing type. + *

+ * + * @return

+ * The Amazon Resource Name (ARN) of the thing type. + *

+ */ + public String getThingTypeArn() { + return thingTypeArn; + } + + /** + *

+ * The Amazon Resource Name (ARN) of the thing type. + *

+ * + * @param thingTypeArn

+ * The Amazon Resource Name (ARN) of the thing type. + *

+ */ + public void setThingTypeArn(String thingTypeArn) { + this.thingTypeArn = thingTypeArn; + } + + /** + *

+ * The Amazon Resource Name (ARN) of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypeArn

+ * The Amazon Resource Name (ARN) of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateThingTypeResult withThingTypeArn(String thingTypeArn) { + this.thingTypeArn = thingTypeArn; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); + if (getThingTypeArn() != null) + sb.append("thingTypeArn: " + getThingTypeArn()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeArn() == null) ? 0 : getThingTypeArn().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateThingTypeResult == false) + return false; + CreateThingTypeResult other = (CreateThingTypeResult) obj; + + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + if (other.getThingTypeArn() == null ^ this.getThingTypeArn() == null) + return false; + if (other.getThingTypeArn() != null + && other.getThingTypeArn().equals(this.getThingTypeArn()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingRequest.java index fdf3ccb52ff..474e311cfed 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingRequest.java @@ -21,32 +21,42 @@ /** *

- * Deletes the specified thing from the Thing Registry. + * Deletes the specified thing. *

*/ public class DeleteThingRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * The thing name. + * The name of the thing to delete. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * The thing name. + * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the DeleteThing request is + * rejected with a VersionConflictException. + *

+ */ + private Long expectedVersion; + + /** + *

+ * The name of the thing to delete. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

- * The thing name. + * The name of the thing to delete. *

*/ public String getThingName() { @@ -55,15 +65,15 @@ public String getThingName() { /** *

- * The thing name. + * The name of the thing to delete. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The thing name. + * The name of the thing to delete. *

*/ public void setThingName(String thingName) { @@ -72,7 +82,7 @@ public void setThingName(String thingName) { /** *

- * The thing name. + * The name of the thing to delete. *

*

* Returns a reference to this object so that method calls can be chained @@ -80,10 +90,10 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The thing name. + * The name of the thing to delete. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -93,6 +103,71 @@ public DeleteThingRequest withThingName(String thingName) { return this; } + /** + *

+ * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the DeleteThing request is + * rejected with a VersionConflictException. + *

+ * + * @return

+ * The expected version of the thing record in the registry. If the + * version of the record in the registry does not match the expected + * version specified in the request, the DeleteThing + * request is rejected with a VersionConflictException. + *

+ */ + public Long getExpectedVersion() { + return expectedVersion; + } + + /** + *

+ * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the DeleteThing request is + * rejected with a VersionConflictException. + *

+ * + * @param expectedVersion

+ * The expected version of the thing record in the registry. If + * the version of the record in the registry does not match the + * expected version specified in the request, the + * DeleteThing request is rejected with a + * VersionConflictException. + *

+ */ + public void setExpectedVersion(Long expectedVersion) { + this.expectedVersion = expectedVersion; + } + + /** + *

+ * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the DeleteThing request is + * rejected with a VersionConflictException. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param expectedVersion

+ * The expected version of the thing record in the registry. If + * the version of the record in the registry does not match the + * expected version specified in the request, the + * DeleteThing request is rejected with a + * VersionConflictException. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteThingRequest withExpectedVersion(Long expectedVersion) { + this.expectedVersion = expectedVersion; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -105,7 +180,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getThingName() != null) - sb.append("thingName: " + getThingName()); + sb.append("thingName: " + getThingName() + ","); + if (getExpectedVersion() != null) + sb.append("expectedVersion: " + getExpectedVersion()); sb.append("}"); return sb.toString(); } @@ -116,6 +193,8 @@ public int hashCode() { int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); + hashCode = prime * hashCode + + ((getExpectedVersion() == null) ? 0 : getExpectedVersion().hashCode()); return hashCode; } @@ -135,6 +214,11 @@ public boolean equals(Object obj) { if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; + if (other.getExpectedVersion() == null ^ this.getExpectedVersion() == null) + return false; + if (other.getExpectedVersion() != null + && other.getExpectedVersion().equals(this.getExpectedVersion()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingTypeRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingTypeRequest.java new file mode 100644 index 00000000000..8b32514473b --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingTypeRequest.java @@ -0,0 +1,146 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Deletes the specified thing type . You cannot delete a thing type if it has + * things associated with it. To delete a thing type, first mark it as + * deprecated by calling DeprecateThingType, then remove any associated + * things by calling UpdateThing to change the thing type on any + * associated thing, and finally use DeleteThingType to delete the thing + * type. + *

+ */ +public class DeleteThingTypeRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteThingTypeRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteThingTypeRequest == false) + return false; + DeleteThingTypeRequest other = (DeleteThingTypeRequest) obj; + + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingTypeResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingTypeResult.java new file mode 100644 index 00000000000..4d84ff40175 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeleteThingTypeResult.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The output for the DeleteThingType operation. + *

+ */ +public class DeleteThingTypeResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteThingTypeResult == false) + return false; + DeleteThingTypeResult other = (DeleteThingTypeResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeprecateThingTypeRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeprecateThingTypeRequest.java new file mode 100644 index 00000000000..19417746834 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeprecateThingTypeRequest.java @@ -0,0 +1,229 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Deprecates a thing type. You can not associate new things with deprecated + * thing type. + *

+ */ +public class DeprecateThingTypeRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

+ * The name of the thing type to deprecate. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * Whether to undeprecate a deprecated thing type. If true, the thing + * type will not be deprecated anymore and you can associate it with things. + *

+ */ + private Boolean undoDeprecate; + + /** + *

+ * The name of the thing type to deprecate. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type to deprecate. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type to deprecate. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type to deprecate. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type to deprecate. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type to deprecate. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeprecateThingTypeRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * Whether to undeprecate a deprecated thing type. If true, the thing + * type will not be deprecated anymore and you can associate it with things. + *

+ * + * @return

+ * Whether to undeprecate a deprecated thing type. If true, + * the thing type will not be deprecated anymore and you can + * associate it with things. + *

+ */ + public Boolean isUndoDeprecate() { + return undoDeprecate; + } + + /** + *

+ * Whether to undeprecate a deprecated thing type. If true, the thing + * type will not be deprecated anymore and you can associate it with things. + *

+ * + * @return

+ * Whether to undeprecate a deprecated thing type. If true, + * the thing type will not be deprecated anymore and you can + * associate it with things. + *

+ */ + public Boolean getUndoDeprecate() { + return undoDeprecate; + } + + /** + *

+ * Whether to undeprecate a deprecated thing type. If true, the thing + * type will not be deprecated anymore and you can associate it with things. + *

+ * + * @param undoDeprecate

+ * Whether to undeprecate a deprecated thing type. If + * true, the thing type will not be deprecated anymore and + * you can associate it with things. + *

+ */ + public void setUndoDeprecate(Boolean undoDeprecate) { + this.undoDeprecate = undoDeprecate; + } + + /** + *

+ * Whether to undeprecate a deprecated thing type. If true, the thing + * type will not be deprecated anymore and you can associate it with things. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param undoDeprecate

+ * Whether to undeprecate a deprecated thing type. If + * true, the thing type will not be deprecated anymore and + * you can associate it with things. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeprecateThingTypeRequest withUndoDeprecate(Boolean undoDeprecate) { + this.undoDeprecate = undoDeprecate; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); + if (getUndoDeprecate() != null) + sb.append("undoDeprecate: " + getUndoDeprecate()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + hashCode = prime * hashCode + + ((getUndoDeprecate() == null) ? 0 : getUndoDeprecate().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeprecateThingTypeRequest == false) + return false; + DeprecateThingTypeRequest other = (DeprecateThingTypeRequest) obj; + + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + if (other.getUndoDeprecate() == null ^ this.getUndoDeprecate() == null) + return false; + if (other.getUndoDeprecate() != null + && other.getUndoDeprecate().equals(this.getUndoDeprecate()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeprecateThingTypeResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeprecateThingTypeResult.java new file mode 100644 index 00000000000..0e69ab12748 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DeprecateThingTypeResult.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The output for the DeprecateThingType operation. + *

+ */ +public class DeprecateThingTypeResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeprecateThingTypeResult == false) + return false; + DeprecateThingTypeResult other = (DeprecateThingTypeResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingRequest.java index a9f1aea116a..e2fc559208f 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingRequest.java @@ -32,7 +32,7 @@ public class DescribeThingRequest extends AmazonWebServiceRequest implements Ser *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; @@ -43,7 +43,7 @@ public class DescribeThingRequest extends AmazonWebServiceRequest implements Ser *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the thing. @@ -60,7 +60,7 @@ public String getThingName() { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -80,7 +80,7 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingResult.java index 8826f977c09..52c703bc187 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingResult.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingResult.java @@ -37,19 +37,43 @@ public class DescribeThingResult implements Serializable { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * 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\"}}) + * The thing type name. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The thing attributes. *

*/ private java.util.Map attributes; + /** + *

+ * The current version of the thing record in the registry. + *

+ * + *

+ * To avoid unintentional changes to the information in the registry, you + * can pass the version information in the expectedVersion + * parameter of the UpdateThing and DeleteThing + * calls. + *

+ *
+ */ + private Long version; + /** *

* The default client ID. @@ -102,7 +126,7 @@ public DescribeThingResult withDefaultClientId(String defaultClientId) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the thing. @@ -119,7 +143,7 @@ public String getThingName() { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -139,7 +163,7 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -154,16 +178,68 @@ public DescribeThingResult withThingName(String thingName) { /** *

- * 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\"}}) + * The thing type name. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The thing type name. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The thing type name. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The thing type name. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The thing type name. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The thing type name. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DescribeThingResult withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * The thing attributes. *

* * @return

- * 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\"}}) + * The thing attributes. *

*/ public java.util.Map getAttributes() { @@ -172,16 +248,11 @@ public java.util.Map getAttributes() { /** *

- * 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\"}}) + * The thing attributes. *

* * @param attributes

- * 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\"}}) + * The thing attributes. *

*/ public void setAttributes(java.util.Map attributes) { @@ -190,19 +261,14 @@ public void setAttributes(java.util.Map attributes) { /** *

- * 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\"}}) + * The thing attributes. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param attributes

- * 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\"}}) + * The thing attributes. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -214,9 +280,7 @@ public DescribeThingResult withAttributes(java.util.Map attribut /** *

- * 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\"}}) + * The thing attributes. *

*

* The method adds a new key-value pair into attributes parameter, and @@ -251,6 +315,99 @@ public DescribeThingResult clearattributesEntries() { return this; } + /** + *

+ * The current version of the thing record in the registry. + *

+ * + *

+ * To avoid unintentional changes to the information in the registry, you + * can pass the version information in the expectedVersion + * parameter of the UpdateThing and DeleteThing + * calls. + *

+ *
+ * + * @return

+ * The current version of the thing record in the registry. + *

+ * + *

+ * To avoid unintentional changes to the information in the + * registry, you can pass the version information in the + * expectedVersion parameter of the + * UpdateThing and DeleteThing calls. + *

+ *
+ */ + public Long getVersion() { + return version; + } + + /** + *

+ * The current version of the thing record in the registry. + *

+ * + *

+ * To avoid unintentional changes to the information in the registry, you + * can pass the version information in the expectedVersion + * parameter of the UpdateThing and DeleteThing + * calls. + *

+ *
+ * + * @param version

+ * The current version of the thing record in the registry. + *

+ * + *

+ * To avoid unintentional changes to the information in the + * registry, you can pass the version information in the + * expectedVersion parameter of the + * UpdateThing and DeleteThing calls. + *

+ *
+ */ + public void setVersion(Long version) { + this.version = version; + } + + /** + *

+ * The current version of the thing record in the registry. + *

+ * + *

+ * To avoid unintentional changes to the information in the registry, you + * can pass the version information in the expectedVersion + * parameter of the UpdateThing and DeleteThing + * calls. + *

+ *
+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param version

+ * The current version of the thing record in the registry. + *

+ * + *

+ * To avoid unintentional changes to the information in the + * registry, you can pass the version information in the + * expectedVersion parameter of the + * UpdateThing and DeleteThing calls. + *

+ *
+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DescribeThingResult withVersion(Long version) { + this.version = version; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -266,8 +423,12 @@ public String toString() { sb.append("defaultClientId: " + getDefaultClientId() + ","); if (getThingName() != null) sb.append("thingName: " + getThingName() + ","); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); if (getAttributes() != null) - sb.append("attributes: " + getAttributes()); + sb.append("attributes: " + getAttributes() + ","); + if (getVersion() != null) + sb.append("version: " + getVersion()); sb.append("}"); return sb.toString(); } @@ -280,7 +441,10 @@ public int hashCode() { hashCode = prime * hashCode + ((getDefaultClientId() == null) ? 0 : getDefaultClientId().hashCode()); hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); + hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); return hashCode; } @@ -305,11 +469,20 @@ public boolean equals(Object obj) { if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; + if (other.getVersion() == null ^ this.getVersion() == null) + return false; + if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingTypeRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingTypeRequest.java new file mode 100644 index 00000000000..2e25b0196a9 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingTypeRequest.java @@ -0,0 +1,141 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Gets information about the specified thing type. + *

+ */ +public class DescribeThingTypeRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DescribeThingTypeRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DescribeThingTypeRequest == false) + return false; + DescribeThingTypeRequest other = (DescribeThingTypeRequest) obj; + + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingTypeResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingTypeResult.java new file mode 100644 index 00000000000..ea1044b4306 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingTypeResult.java @@ -0,0 +1,288 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The output for the DescribeThingType operation. + *

+ */ +public class DescribeThingTypeResult implements Serializable { + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The ThingTypeProperties contains information about the thing type + * including description, and a list of searchable thing attribute names. + *

+ */ + private ThingTypeProperties thingTypeProperties; + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ */ + private ThingTypeMetadata thingTypeMetadata; + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DescribeThingTypeResult withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * The ThingTypeProperties contains information about the thing type + * including description, and a list of searchable thing attribute names. + *

+ * + * @return

+ * The ThingTypeProperties contains information about the thing type + * including description, and a list of searchable thing attribute + * names. + *

+ */ + public ThingTypeProperties getThingTypeProperties() { + return thingTypeProperties; + } + + /** + *

+ * The ThingTypeProperties contains information about the thing type + * including description, and a list of searchable thing attribute names. + *

+ * + * @param thingTypeProperties

+ * The ThingTypeProperties contains information about the thing + * type including description, and a list of searchable thing + * attribute names. + *

+ */ + public void setThingTypeProperties(ThingTypeProperties thingTypeProperties) { + this.thingTypeProperties = thingTypeProperties; + } + + /** + *

+ * The ThingTypeProperties contains information about the thing type + * including description, and a list of searchable thing attribute names. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypeProperties

+ * The ThingTypeProperties contains information about the thing + * type including description, and a list of searchable thing + * attribute names. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DescribeThingTypeResult withThingTypeProperties(ThingTypeProperties thingTypeProperties) { + this.thingTypeProperties = thingTypeProperties; + return this; + } + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ * + * @return

+ * The ThingTypeMetadata contains additional information about the + * thing type including: creation date and time, a value indicating + * whether the thing type is deprecated, and a date and time when + * time was deprecated. + *

+ */ + public ThingTypeMetadata getThingTypeMetadata() { + return thingTypeMetadata; + } + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ * + * @param thingTypeMetadata

+ * The ThingTypeMetadata contains additional information about + * the thing type including: creation date and time, a value + * indicating whether the thing type is deprecated, and a date + * and time when time was deprecated. + *

+ */ + public void setThingTypeMetadata(ThingTypeMetadata thingTypeMetadata) { + this.thingTypeMetadata = thingTypeMetadata; + } + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypeMetadata

+ * The ThingTypeMetadata contains additional information about + * the thing type including: creation date and time, a value + * indicating whether the thing type is deprecated, and a date + * and time when time was deprecated. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DescribeThingTypeResult withThingTypeMetadata(ThingTypeMetadata thingTypeMetadata) { + this.thingTypeMetadata = thingTypeMetadata; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); + if (getThingTypeProperties() != null) + sb.append("thingTypeProperties: " + getThingTypeProperties() + ","); + if (getThingTypeMetadata() != null) + sb.append("thingTypeMetadata: " + getThingTypeMetadata()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeProperties() == null) ? 0 : getThingTypeProperties().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeMetadata() == null) ? 0 : getThingTypeMetadata().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DescribeThingTypeResult == false) + return false; + DescribeThingTypeResult other = (DescribeThingTypeResult) obj; + + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + if (other.getThingTypeProperties() == null ^ this.getThingTypeProperties() == null) + return false; + if (other.getThingTypeProperties() != null + && other.getThingTypeProperties().equals(this.getThingTypeProperties()) == false) + return false; + if (other.getThingTypeMetadata() == null ^ this.getThingTypeMetadata() == null) + return false; + if (other.getThingTypeMetadata() != null + && other.getThingTypeMetadata().equals(this.getThingTypeMetadata()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DetachThingPrincipalRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DetachThingPrincipalRequest.java index d105412dafa..c4a062d9673 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DetachThingPrincipalRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DetachThingPrincipalRequest.java @@ -32,17 +32,15 @@ public class DetachThingPrincipalRequest extends AmazonWebServiceRequest impleme *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * The principal. - *

- *

- * If the principal is a certificate, specify the certificate ARN. If the - * principal is an Amazon Cognito identity, specify the identity ID. + * If the principal is a certificate, this value must be ARN of the + * certificate. If the principal is an Amazon Cognito identity, this value + * must be the ID of the Amazon Cognito identity. *

*/ private String principal; @@ -54,7 +52,7 @@ public class DetachThingPrincipalRequest extends AmazonWebServiceRequest impleme *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the thing. @@ -71,7 +69,7 @@ public String getThingName() { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -91,7 +89,7 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -106,20 +104,15 @@ public DetachThingPrincipalRequest withThingName(String thingName) { /** *

- * The principal. - *

- *

- * If the principal is a certificate, specify the certificate ARN. If the - * principal is an Amazon Cognito identity, specify the identity ID. + * If the principal is a certificate, this value must be ARN of the + * certificate. If the principal is an Amazon Cognito identity, this value + * must be the ID of the Amazon Cognito identity. *

* * @return

- * The principal. - *

- *

- * If the principal is a certificate, specify the certificate ARN. - * If the principal is an Amazon Cognito identity, specify the - * identity ID. + * If the principal is a certificate, this value must be ARN of the + * certificate. If the principal is an Amazon Cognito identity, this + * value must be the ID of the Amazon Cognito identity. *

*/ public String getPrincipal() { @@ -128,20 +121,16 @@ public String getPrincipal() { /** *

- * The principal. - *

- *

- * If the principal is a certificate, specify the certificate ARN. If the - * principal is an Amazon Cognito identity, specify the identity ID. + * If the principal is a certificate, this value must be ARN of the + * certificate. If the principal is an Amazon Cognito identity, this value + * must be the ID of the Amazon Cognito identity. *

* * @param principal

- * The principal. - *

- *

- * If the principal is a certificate, specify the certificate - * ARN. If the principal is an Amazon Cognito identity, specify - * the identity ID. + * If the principal is a certificate, this value must be ARN of + * the certificate. If the principal is an Amazon Cognito + * identity, this value must be the ID of the Amazon Cognito + * identity. *

*/ public void setPrincipal(String principal) { @@ -150,23 +139,19 @@ public void setPrincipal(String principal) { /** *

- * The principal. - *

- *

- * If the principal is a certificate, specify the certificate ARN. If the - * principal is an Amazon Cognito identity, specify the identity ID. + * If the principal is a certificate, this value must be ARN of the + * certificate. If the principal is an Amazon Cognito identity, this value + * must be the ID of the Amazon Cognito identity. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param principal

- * The principal. - *

- *

- * If the principal is a certificate, specify the certificate - * ARN. If the principal is an Amazon Cognito identity, specify - * the identity ID. + * If the principal is a certificate, this value must be ARN of + * the certificate. If the principal is an Amazon Cognito + * identity, this value must be the ID of the Amazon Cognito + * identity. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DynamoDBv2Action.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DynamoDBv2Action.java new file mode 100644 index 00000000000..5a297091970 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DynamoDBv2Action.java @@ -0,0 +1,242 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * Describes an action to write to a DynamoDB table. + *

+ *

+ * This DynamoDB action writes each attribute in the message payload into it's + * own column in the DynamoDB table. + *

+ */ +public class DynamoDBv2Action implements Serializable { + /** + *

+ * The ARN of the IAM role that grants access to the DynamoDB table. + *

+ */ + private String roleArn; + + /** + *

+ * Specifies the DynamoDB table to which the message data will be written. + * For example: + *

+ *

+ * { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } } + *

+ *

+ * Each attribute in the message payload will be written to a separate + * column in the DynamoDB database. + *

+ */ + private PutItemInput putItem; + + /** + *

+ * The ARN of the IAM role that grants access to the DynamoDB table. + *

+ * + * @return

+ * The ARN of the IAM role that grants access to the DynamoDB table. + *

+ */ + public String getRoleArn() { + return roleArn; + } + + /** + *

+ * The ARN of the IAM role that grants access to the DynamoDB table. + *

+ * + * @param roleArn

+ * The ARN of the IAM role that grants access to the DynamoDB + * table. + *

+ */ + public void setRoleArn(String roleArn) { + this.roleArn = roleArn; + } + + /** + *

+ * The ARN of the IAM role that grants access to the DynamoDB table. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param roleArn

+ * The ARN of the IAM role that grants access to the DynamoDB + * table. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DynamoDBv2Action withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + *

+ * Specifies the DynamoDB table to which the message data will be written. + * For example: + *

+ *

+ * { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } } + *

+ *

+ * Each attribute in the message payload will be written to a separate + * column in the DynamoDB database. + *

+ * + * @return

+ * Specifies the DynamoDB table to which the message data will be + * written. For example: + *

+ *

+ * { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } } + *

+ *

+ * Each attribute in the message payload will be written to a + * separate column in the DynamoDB database. + *

+ */ + public PutItemInput getPutItem() { + return putItem; + } + + /** + *

+ * Specifies the DynamoDB table to which the message data will be written. + * For example: + *

+ *

+ * { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } } + *

+ *

+ * Each attribute in the message payload will be written to a separate + * column in the DynamoDB database. + *

+ * + * @param putItem

+ * Specifies the DynamoDB table to which the message data will be + * written. For example: + *

+ *

+ * { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } } + *

+ *

+ * Each attribute in the message payload will be written to a + * separate column in the DynamoDB database. + *

+ */ + public void setPutItem(PutItemInput putItem) { + this.putItem = putItem; + } + + /** + *

+ * Specifies the DynamoDB table to which the message data will be written. + * For example: + *

+ *

+ * { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } } + *

+ *

+ * Each attribute in the message payload will be written to a separate + * column in the DynamoDB database. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param putItem

+ * Specifies the DynamoDB table to which the message data will be + * written. For example: + *

+ *

+ * { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } } + *

+ *

+ * Each attribute in the message payload will be written to a + * separate column in the DynamoDB database. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DynamoDBv2Action withPutItem(PutItemInput putItem) { + this.putItem = putItem; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getRoleArn() != null) + sb.append("roleArn: " + getRoleArn() + ","); + if (getPutItem() != null) + sb.append("putItem: " + getPutItem()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); + hashCode = prime * hashCode + ((getPutItem() == null) ? 0 : getPutItem().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DynamoDBv2Action == false) + return false; + DynamoDBv2Action other = (DynamoDBv2Action) obj; + + if (other.getRoleArn() == null ^ this.getRoleArn() == null) + return false; + if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) + return false; + if (other.getPutItem() == null ^ this.getPutItem() == null) + return false; + if (other.getPutItem() != null && other.getPutItem().equals(this.getPutItem()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ElasticsearchAction.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ElasticsearchAction.java index 6719d72245d..f848ba91cc1 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ElasticsearchAction.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ElasticsearchAction.java @@ -19,7 +19,7 @@ /** *

- * Describes an action that writes data to an Amazon Elasticsearch Service; + * Describes an action that writes data to an Amazon Elasticsearch Service * domain. *

*/ diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/FirehoseAction.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/FirehoseAction.java index ee5c312f8d4..de031de2ff1 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/FirehoseAction.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/FirehoseAction.java @@ -37,6 +37,18 @@ public class FirehoseAction implements Serializable { */ private String deliveryStreamName; + /** + *

+ * A character separator that will be used to separate records written to + * the Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' + * (Windows newline), ',' (comma). + *

+ *

+ * Constraints:
+ * Pattern: ([\n\t])|(\r\n)|(,)
+ */ + private String separator; + /** *

* The IAM role that grants access to the Amazon Kinesis Firehost stream. @@ -130,6 +142,72 @@ public FirehoseAction withDeliveryStreamName(String deliveryStreamName) { return this; } + /** + *

+ * A character separator that will be used to separate records written to + * the Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' + * (Windows newline), ',' (comma). + *

+ *

+ * Constraints:
+ * Pattern: ([\n\t])|(\r\n)|(,)
+ * + * @return

+ * A character separator that will be used to separate records + * written to the Firehose stream. Valid values are: '\n' (newline), + * '\t' (tab), '\r\n' (Windows newline), ',' (comma). + *

+ */ + public String getSeparator() { + return separator; + } + + /** + *

+ * A character separator that will be used to separate records written to + * the Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' + * (Windows newline), ',' (comma). + *

+ *

+ * Constraints:
+ * Pattern: ([\n\t])|(\r\n)|(,)
+ * + * @param separator

+ * A character separator that will be used to separate records + * written to the Firehose stream. Valid values are: '\n' + * (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma). + *

+ */ + public void setSeparator(String separator) { + this.separator = separator; + } + + /** + *

+ * A character separator that will be used to separate records written to + * the Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' + * (Windows newline), ',' (comma). + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Pattern: ([\n\t])|(\r\n)|(,)
+ * + * @param separator

+ * A character separator that will be used to separate records + * written to the Firehose stream. Valid values are: '\n' + * (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma). + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public FirehoseAction withSeparator(String separator) { + this.separator = separator; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -144,7 +222,9 @@ public String toString() { if (getRoleArn() != null) sb.append("roleArn: " + getRoleArn() + ","); if (getDeliveryStreamName() != null) - sb.append("deliveryStreamName: " + getDeliveryStreamName()); + sb.append("deliveryStreamName: " + getDeliveryStreamName() + ","); + if (getSeparator() != null) + sb.append("separator: " + getSeparator()); sb.append("}"); return sb.toString(); } @@ -157,6 +237,7 @@ public int hashCode() { hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getDeliveryStreamName() == null) ? 0 : getDeliveryStreamName().hashCode()); + hashCode = prime * hashCode + ((getSeparator() == null) ? 0 : getSeparator().hashCode()); return hashCode; } @@ -180,6 +261,11 @@ public boolean equals(Object obj) { if (other.getDeliveryStreamName() != null && other.getDeliveryStreamName().equals(this.getDeliveryStreamName()) == false) return false; + if (other.getSeparator() == null ^ this.getSeparator() == null) + return false; + if (other.getSeparator() != null + && other.getSeparator().equals(this.getSeparator()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListOutgoingCertificatesRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListOutgoingCertificatesRequest.java new file mode 100644 index 00000000000..7f2cc9587ca --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListOutgoingCertificatesRequest.java @@ -0,0 +1,278 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Lists certificates that are being transfered but not yet accepted. + *

+ */ +public class ListOutgoingCertificatesRequest extends AmazonWebServiceRequest implements + Serializable { + /** + *

+ * The result page size. + *

+ *

+ * Constraints:
+ * Range: 1 - 250
+ */ + private Integer pageSize; + + /** + *

+ * The marker for the next set of results. + *

+ */ + private String marker; + + /** + *

+ * Specifies the order for results. If True, the results are returned in + * ascending order, based on the creation date. + *

+ */ + private Boolean ascendingOrder; + + /** + *

+ * The result page size. + *

+ *

+ * Constraints:
+ * Range: 1 - 250
+ * + * @return

+ * The result page size. + *

+ */ + public Integer getPageSize() { + return pageSize; + } + + /** + *

+ * The result page size. + *

+ *

+ * Constraints:
+ * Range: 1 - 250
+ * + * @param pageSize

+ * The result page size. + *

+ */ + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + /** + *

+ * The result page size. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Range: 1 - 250
+ * + * @param pageSize

+ * The result page size. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListOutgoingCertificatesRequest withPageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + *

+ * The marker for the next set of results. + *

+ * + * @return

+ * The marker for the next set of results. + *

+ */ + public String getMarker() { + return marker; + } + + /** + *

+ * The marker for the next set of results. + *

+ * + * @param marker

+ * The marker for the next set of results. + *

+ */ + public void setMarker(String marker) { + this.marker = marker; + } + + /** + *

+ * The marker for the next set of results. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param marker

+ * The marker for the next set of results. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListOutgoingCertificatesRequest withMarker(String marker) { + this.marker = marker; + return this; + } + + /** + *

+ * Specifies the order for results. If True, the results are returned in + * ascending order, based on the creation date. + *

+ * + * @return

+ * Specifies the order for results. If True, the results are + * returned in ascending order, based on the creation date. + *

+ */ + public Boolean isAscendingOrder() { + return ascendingOrder; + } + + /** + *

+ * Specifies the order for results. If True, the results are returned in + * ascending order, based on the creation date. + *

+ * + * @return

+ * Specifies the order for results. If True, the results are + * returned in ascending order, based on the creation date. + *

+ */ + public Boolean getAscendingOrder() { + return ascendingOrder; + } + + /** + *

+ * Specifies the order for results. If True, the results are returned in + * ascending order, based on the creation date. + *

+ * + * @param ascendingOrder

+ * Specifies the order for results. If True, the results are + * returned in ascending order, based on the creation date. + *

+ */ + public void setAscendingOrder(Boolean ascendingOrder) { + this.ascendingOrder = ascendingOrder; + } + + /** + *

+ * Specifies the order for results. If True, the results are returned in + * ascending order, based on the creation date. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param ascendingOrder

+ * Specifies the order for results. If True, the results are + * returned in ascending order, based on the creation date. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListOutgoingCertificatesRequest withAscendingOrder(Boolean ascendingOrder) { + this.ascendingOrder = ascendingOrder; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getPageSize() != null) + sb.append("pageSize: " + getPageSize() + ","); + if (getMarker() != null) + sb.append("marker: " + getMarker() + ","); + if (getAscendingOrder() != null) + sb.append("ascendingOrder: " + getAscendingOrder()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getPageSize() == null) ? 0 : getPageSize().hashCode()); + hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); + hashCode = prime * hashCode + + ((getAscendingOrder() == null) ? 0 : getAscendingOrder().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListOutgoingCertificatesRequest == false) + return false; + ListOutgoingCertificatesRequest other = (ListOutgoingCertificatesRequest) obj; + + if (other.getPageSize() == null ^ this.getPageSize() == null) + return false; + if (other.getPageSize() != null && other.getPageSize().equals(this.getPageSize()) == false) + return false; + if (other.getMarker() == null ^ this.getMarker() == null) + return false; + if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) + return false; + if (other.getAscendingOrder() == null ^ this.getAscendingOrder() == null) + return false; + if (other.getAscendingOrder() != null + && other.getAscendingOrder().equals(this.getAscendingOrder()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListOutgoingCertificatesResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListOutgoingCertificatesResult.java new file mode 100644 index 00000000000..c132ddcf323 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListOutgoingCertificatesResult.java @@ -0,0 +1,220 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The output from the ListOutgoingCertificates operation. + *

+ */ +public class ListOutgoingCertificatesResult implements Serializable { + /** + *

+ * The certificates that are being transfered but not yet accepted. + *

+ */ + private java.util.List outgoingCertificates; + + /** + *

+ * The marker for the next set of results. + *

+ */ + private String nextMarker; + + /** + *

+ * The certificates that are being transfered but not yet accepted. + *

+ * + * @return

+ * The certificates that are being transfered but not yet accepted. + *

+ */ + public java.util.List getOutgoingCertificates() { + return outgoingCertificates; + } + + /** + *

+ * The certificates that are being transfered but not yet accepted. + *

+ * + * @param outgoingCertificates

+ * The certificates that are being transfered but not yet + * accepted. + *

+ */ + public void setOutgoingCertificates( + java.util.Collection outgoingCertificates) { + if (outgoingCertificates == null) { + this.outgoingCertificates = null; + return; + } + + this.outgoingCertificates = new java.util.ArrayList( + outgoingCertificates); + } + + /** + *

+ * The certificates that are being transfered but not yet accepted. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param outgoingCertificates

+ * The certificates that are being transfered but not yet + * accepted. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListOutgoingCertificatesResult withOutgoingCertificates( + OutgoingCertificate... outgoingCertificates) { + if (getOutgoingCertificates() == null) { + this.outgoingCertificates = new java.util.ArrayList( + outgoingCertificates.length); + } + for (OutgoingCertificate value : outgoingCertificates) { + this.outgoingCertificates.add(value); + } + return this; + } + + /** + *

+ * The certificates that are being transfered but not yet accepted. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param outgoingCertificates

+ * The certificates that are being transfered but not yet + * accepted. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListOutgoingCertificatesResult withOutgoingCertificates( + java.util.Collection outgoingCertificates) { + setOutgoingCertificates(outgoingCertificates); + return this; + } + + /** + *

+ * The marker for the next set of results. + *

+ * + * @return

+ * The marker for the next set of results. + *

+ */ + public String getNextMarker() { + return nextMarker; + } + + /** + *

+ * The marker for the next set of results. + *

+ * + * @param nextMarker

+ * The marker for the next set of results. + *

+ */ + public void setNextMarker(String nextMarker) { + this.nextMarker = nextMarker; + } + + /** + *

+ * The marker for the next set of results. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param nextMarker

+ * The marker for the next set of results. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListOutgoingCertificatesResult withNextMarker(String nextMarker) { + this.nextMarker = nextMarker; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getOutgoingCertificates() != null) + sb.append("outgoingCertificates: " + getOutgoingCertificates() + ","); + if (getNextMarker() != null) + sb.append("nextMarker: " + getNextMarker()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getOutgoingCertificates() == null) ? 0 : getOutgoingCertificates().hashCode()); + hashCode = prime * hashCode + ((getNextMarker() == null) ? 0 : getNextMarker().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListOutgoingCertificatesResult == false) + return false; + ListOutgoingCertificatesResult other = (ListOutgoingCertificatesResult) obj; + + if (other.getOutgoingCertificates() == null ^ this.getOutgoingCertificates() == null) + return false; + if (other.getOutgoingCertificates() != null + && other.getOutgoingCertificates().equals(this.getOutgoingCertificates()) == false) + return false; + if (other.getNextMarker() == null ^ this.getNextMarker() == null) + return false; + if (other.getNextMarker() != null + && other.getNextMarker().equals(this.getNextMarker()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsRequest.java index 7d4f700d750..8e6a8441698 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsRequest.java @@ -27,14 +27,15 @@ public class ListPrincipalThingsRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*/ private String nextToken; /** *

- * The maximum number of principals to return. + * The maximum number of results to return in this operation. *

*

* Constraints:
@@ -51,11 +52,13 @@ public class ListPrincipalThingsRequest extends AmazonWebServiceRequest implemen /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

* * @return

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public String getNextToken() { @@ -64,11 +67,13 @@ public String getNextToken() { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

* * @param nextToken

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public void setNextToken(String nextToken) { @@ -77,14 +82,16 @@ public void setNextToken(String nextToken) { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param nextToken

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -96,14 +103,14 @@ public ListPrincipalThingsRequest withNextToken(String nextToken) { /** *

- * The maximum number of principals to return. + * The maximum number of results to return in this operation. *

*

* Constraints:
* Range: 1 - 10000
* * @return

- * The maximum number of principals to return. + * The maximum number of results to return in this operation. *

*/ public Integer getMaxResults() { @@ -112,14 +119,14 @@ public Integer getMaxResults() { /** *

- * The maximum number of principals to return. + * The maximum number of results to return in this operation. *

*

* Constraints:
* Range: 1 - 10000
* * @param maxResults

- * The maximum number of principals to return. + * The maximum number of results to return in this operation. *

*/ public void setMaxResults(Integer maxResults) { @@ -128,7 +135,7 @@ public void setMaxResults(Integer maxResults) { /** *

- * The maximum number of principals to return. + * The maximum number of results to return in this operation. *

*

* Returns a reference to this object so that method calls can be chained @@ -138,7 +145,7 @@ public void setMaxResults(Integer maxResults) { * Range: 1 - 10000
* * @param maxResults

- * The maximum number of principals to return. + * The maximum number of results to return in this operation. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsResult.java index fb81b1dcd08..72abfc453b2 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsResult.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListPrincipalThingsResult.java @@ -32,7 +32,8 @@ public class ListPrincipalThingsResult implements Serializable { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*/ private String nextToken; @@ -113,11 +114,13 @@ public ListPrincipalThingsResult withThings(java.util.Collection things) /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

* * @return

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public String getNextToken() { @@ -126,11 +129,13 @@ public String getNextToken() { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

* * @param nextToken

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public void setNextToken(String nextToken) { @@ -139,14 +144,16 @@ public void setNextToken(String nextToken) { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param nextToken

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsRequest.java index 6b2f41031c6..c957d7e1b0a 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsRequest.java @@ -32,7 +32,7 @@ public class ListThingPrincipalsRequest extends AmazonWebServiceRequest implemen *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; @@ -43,7 +43,7 @@ public class ListThingPrincipalsRequest extends AmazonWebServiceRequest implemen *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the thing. @@ -60,7 +60,7 @@ public String getThingName() { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -80,7 +80,7 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsResult.java index 8f069eff8da..287103f1d25 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsResult.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingPrincipalsResult.java @@ -25,18 +25,18 @@ public class ListThingPrincipalsResult implements Serializable { /** *

- * The principals. + * The principals associated with the thing. *

*/ private java.util.List principals; /** *

- * The principals. + * The principals associated with the thing. *

* * @return

- * The principals. + * The principals associated with the thing. *

*/ public java.util.List getPrincipals() { @@ -45,11 +45,11 @@ public java.util.List getPrincipals() { /** *

- * The principals. + * The principals associated with the thing. *

* * @param principals

- * The principals. + * The principals associated with the thing. *

*/ public void setPrincipals(java.util.Collection principals) { @@ -63,14 +63,14 @@ public void setPrincipals(java.util.Collection principals) { /** *

- * The principals. + * The principals associated with the thing. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param principals

- * The principals. + * The principals associated with the thing. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -87,14 +87,14 @@ public ListThingPrincipalsResult withPrincipals(String... principals) { /** *

- * The principals. + * The principals associated with the thing. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param principals

- * The principals. + * The principals associated with the thing. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingTypesRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingTypesRequest.java new file mode 100644 index 00000000000..84d3154eebd --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingTypesRequest.java @@ -0,0 +1,280 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Lists the existing thing types. + *

+ */ +public class ListThingTypesRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ */ + private String nextToken; + + /** + *

+ * The maximum number of results to return in this operation. + *

+ *

+ * Constraints:
+ * Range: 1 - 10000
+ */ + private Integer maxResults; + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ * + * @return

+ * The token for the next set of results, or null if there + * are no additional results. + *

+ */ + public String getNextToken() { + return nextToken; + } + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ * + * @param nextToken

+ * The token for the next set of results, or null if there + * are no additional results. + *

+ */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param nextToken

+ * The token for the next set of results, or null if there + * are no additional results. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListThingTypesRequest withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + *

+ * The maximum number of results to return in this operation. + *

+ *

+ * Constraints:
+ * Range: 1 - 10000
+ * + * @return

+ * The maximum number of results to return in this operation. + *

+ */ + public Integer getMaxResults() { + return maxResults; + } + + /** + *

+ * The maximum number of results to return in this operation. + *

+ *

+ * Constraints:
+ * Range: 1 - 10000
+ * + * @param maxResults

+ * The maximum number of results to return in this operation. + *

+ */ + public void setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + } + + /** + *

+ * The maximum number of results to return in this operation. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Range: 1 - 10000
+ * + * @param maxResults

+ * The maximum number of results to return in this operation. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListThingTypesRequest withMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListThingTypesRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getNextToken() != null) + sb.append("nextToken: " + getNextToken() + ","); + if (getMaxResults() != null) + sb.append("maxResults: " + getMaxResults() + ","); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListThingTypesRequest == false) + return false; + ListThingTypesRequest other = (ListThingTypesRequest) obj; + + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + if (other.getMaxResults() == null ^ this.getMaxResults() == null) + return false; + if (other.getMaxResults() != null + && other.getMaxResults().equals(this.getMaxResults()) == false) + return false; + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingTypesResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingTypesResult.java new file mode 100644 index 00000000000..741d0a007de --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingTypesResult.java @@ -0,0 +1,218 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The output for the ListThingTypes operation. + *

+ */ +public class ListThingTypesResult implements Serializable { + /** + *

+ * The thing types. + *

+ */ + private java.util.List thingTypes; + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ */ + private String nextToken; + + /** + *

+ * The thing types. + *

+ * + * @return

+ * The thing types. + *

+ */ + public java.util.List getThingTypes() { + return thingTypes; + } + + /** + *

+ * The thing types. + *

+ * + * @param thingTypes

+ * The thing types. + *

+ */ + public void setThingTypes(java.util.Collection thingTypes) { + if (thingTypes == null) { + this.thingTypes = null; + return; + } + + this.thingTypes = new java.util.ArrayList(thingTypes); + } + + /** + *

+ * The thing types. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypes

+ * The thing types. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListThingTypesResult withThingTypes(ThingTypeDefinition... thingTypes) { + if (getThingTypes() == null) { + this.thingTypes = new java.util.ArrayList(thingTypes.length); + } + for (ThingTypeDefinition value : thingTypes) { + this.thingTypes.add(value); + } + return this; + } + + /** + *

+ * The thing types. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypes

+ * The thing types. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListThingTypesResult withThingTypes(java.util.Collection thingTypes) { + setThingTypes(thingTypes); + return this; + } + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ * + * @return

+ * The token for the next set of results, or null if there + * are no additional results. + *

+ */ + public String getNextToken() { + return nextToken; + } + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ * + * @param nextToken

+ * The token for the next set of results, or null if there + * are no additional results. + *

+ */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param nextToken

+ * The token for the next set of results, or null if there + * are no additional results. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListThingTypesResult withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypes() != null) + sb.append("thingTypes: " + getThingTypes() + ","); + if (getNextToken() != null) + sb.append("nextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getThingTypes() == null) ? 0 : getThingTypes().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListThingTypesResult == false) + return false; + ListThingTypesResult other = (ListThingTypesResult) obj; + + if (other.getThingTypes() == null ^ this.getThingTypes() == null) + return false; + if (other.getThingTypes() != null + && other.getThingTypes().equals(this.getThingTypes()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsRequest.java index 9cf7db3316f..d7f403fc9c2 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsRequest.java @@ -21,22 +21,25 @@ /** *

- * Lists your things. You can pass an AttributeName or AttributeValue to filter - * your things (for example, - * "ListThings where AttributeName=Color and AttributeValue=Red"). + * Lists your things. Use the attributeName and attributeValue + * parameters to filter your things. For example, calling + * ListThings with attributeName=Color and attributeValue=Red + * retrieves all things in the registry that contain an attribute Color + * with the value Red. *

*/ public class ListThingsRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * The token for the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*/ private String nextToken; /** *

- * The maximum number of results. + * The maximum number of results to return in this operation. *

*

* Constraints:
@@ -46,7 +49,7 @@ public class ListThingsRequest extends AmazonWebServiceRequest implements Serial /** *

- * The attribute name. + * The attribute name used to search for things. *

*

* Constraints:
@@ -57,22 +60,35 @@ public class ListThingsRequest extends AmazonWebServiceRequest implements Serial /** *

- * The attribute value. + * The attribute value used to search for things. *

*

* Constraints:
- * Length: - 1024
- * Pattern: [a-zA-Z0-9_.,@/:#-]+
+ * Length: - 800
+ * Pattern: [a-zA-Z0-9_.,@/:#-]*
*/ private String attributeValue; /** *

- * The token for the next value. + * The name of the thing type used to search for things. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The token for the next set of results, or null if there are no + * additional results. *

* * @return

- * The token for the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public String getNextToken() { @@ -81,11 +97,13 @@ public String getNextToken() { /** *

- * The token for the next value. + * The token for the next set of results, or null if there are no + * additional results. *

* * @param nextToken

- * The token for the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public void setNextToken(String nextToken) { @@ -94,14 +112,16 @@ public void setNextToken(String nextToken) { /** *

- * The token for the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param nextToken

- * The token for the next value. + * The token for the next set of results, or null if there + * are no additional results. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -113,14 +133,14 @@ public ListThingsRequest withNextToken(String nextToken) { /** *

- * The maximum number of results. + * The maximum number of results to return in this operation. *

*

* Constraints:
* Range: 1 - 10000
* * @return

- * The maximum number of results. + * The maximum number of results to return in this operation. *

*/ public Integer getMaxResults() { @@ -129,14 +149,14 @@ public Integer getMaxResults() { /** *

- * The maximum number of results. + * The maximum number of results to return in this operation. *

*

* Constraints:
* Range: 1 - 10000
* * @param maxResults

- * The maximum number of results. + * The maximum number of results to return in this operation. *

*/ public void setMaxResults(Integer maxResults) { @@ -145,7 +165,7 @@ public void setMaxResults(Integer maxResults) { /** *

- * The maximum number of results. + * The maximum number of results to return in this operation. *

*

* Returns a reference to this object so that method calls can be chained @@ -155,7 +175,7 @@ public void setMaxResults(Integer maxResults) { * Range: 1 - 10000
* * @param maxResults

- * The maximum number of results. + * The maximum number of results to return in this operation. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -167,7 +187,7 @@ public ListThingsRequest withMaxResults(Integer maxResults) { /** *

- * The attribute name. + * The attribute name used to search for things. *

*

* Constraints:
@@ -175,7 +195,7 @@ public ListThingsRequest withMaxResults(Integer maxResults) { * Pattern: [a-zA-Z0-9_.,@/:#-]+
* * @return

- * The attribute name. + * The attribute name used to search for things. *

*/ public String getAttributeName() { @@ -184,7 +204,7 @@ public String getAttributeName() { /** *

- * The attribute name. + * The attribute name used to search for things. *

*

* Constraints:
@@ -192,7 +212,7 @@ public String getAttributeName() { * Pattern: [a-zA-Z0-9_.,@/:#-]+
* * @param attributeName

- * The attribute name. + * The attribute name used to search for things. *

*/ public void setAttributeName(String attributeName) { @@ -201,7 +221,7 @@ public void setAttributeName(String attributeName) { /** *

- * The attribute name. + * The attribute name used to search for things. *

*

* Returns a reference to this object so that method calls can be chained @@ -212,7 +232,7 @@ public void setAttributeName(String attributeName) { * Pattern: [a-zA-Z0-9_.,@/:#-]+
* * @param attributeName

- * The attribute name. + * The attribute name used to search for things. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -224,15 +244,15 @@ public ListThingsRequest withAttributeName(String attributeName) { /** *

- * The attribute value. + * The attribute value used to search for things. *

*

* Constraints:
- * Length: - 1024
- * Pattern: [a-zA-Z0-9_.,@/:#-]+
+ * Length: - 800
+ * Pattern: [a-zA-Z0-9_.,@/:#-]*
* * @return

- * The attribute value. + * The attribute value used to search for things. *

*/ public String getAttributeValue() { @@ -241,15 +261,15 @@ public String getAttributeValue() { /** *

- * The attribute value. + * The attribute value used to search for things. *

*

* Constraints:
- * Length: - 1024
- * Pattern: [a-zA-Z0-9_.,@/:#-]+
+ * Length: - 800
+ * Pattern: [a-zA-Z0-9_.,@/:#-]*
* * @param attributeValue

- * The attribute value. + * The attribute value used to search for things. *

*/ public void setAttributeValue(String attributeValue) { @@ -258,18 +278,18 @@ public void setAttributeValue(String attributeValue) { /** *

- * The attribute value. + * The attribute value used to search for things. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
- * Length: - 1024
- * Pattern: [a-zA-Z0-9_.,@/:#-]+
+ * Length: - 800
+ * Pattern: [a-zA-Z0-9_.,@/:#-]*
* * @param attributeValue

- * The attribute value. + * The attribute value used to search for things. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -279,6 +299,63 @@ public ListThingsRequest withAttributeValue(String attributeValue) { return this; } + /** + *

+ * The name of the thing type used to search for things. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type used to search for things. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type used to search for things. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type used to search for things. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type used to search for things. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type used to search for things. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListThingsRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -297,7 +374,9 @@ public String toString() { if (getAttributeName() != null) sb.append("attributeName: " + getAttributeName() + ","); if (getAttributeValue() != null) - sb.append("attributeValue: " + getAttributeValue()); + sb.append("attributeValue: " + getAttributeValue() + ","); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName()); sb.append("}"); return sb.toString(); } @@ -313,6 +392,8 @@ public int hashCode() { + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); hashCode = prime * hashCode + ((getAttributeValue() == null) ? 0 : getAttributeValue().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); return hashCode; } @@ -347,6 +428,11 @@ public boolean equals(Object obj) { if (other.getAttributeValue() != null && other.getAttributeValue().equals(this.getAttributeValue()) == false) return false; + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsResult.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsResult.java index d4d28564688..4707c620213 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsResult.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsResult.java @@ -32,7 +32,8 @@ public class ListThingsResult implements Serializable { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*/ private String nextToken; @@ -113,11 +114,13 @@ public ListThingsResult withThings(java.util.Collection things) /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

* * @return

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public String getNextToken() { @@ -126,11 +129,13 @@ public String getNextToken() { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

* * @param nextToken

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

*/ public void setNextToken(String nextToken) { @@ -139,14 +144,16 @@ public void setNextToken(String nextToken) { /** *

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there are no + * additional results. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param nextToken

- * A token used to retrieve the next value. + * The token for the next set of results, or null if there + * are no additional results. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/OutgoingCertificate.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/OutgoingCertificate.java new file mode 100644 index 00000000000..28425777282 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/OutgoingCertificate.java @@ -0,0 +1,468 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * A certificate that has been transfered but not yet accepted. + *

+ */ +public class OutgoingCertificate implements Serializable { + /** + *

+ * The certificate ARN. + *

+ */ + private String certificateArn; + + /** + *

+ * The certificate ID. + *

+ *

+ * Constraints:
+ * Length: 64 - 64
+ * Pattern: (0x)?[a-fA-F0-9]+
+ */ + private String certificateId; + + /** + *

+ * The AWS account to which the transfer was made. + *

+ *

+ * Constraints:
+ * Pattern: [0-9]{12}
+ */ + private String transferredTo; + + /** + *

+ * The date the transfer was initiated. + *

+ */ + private java.util.Date transferDate; + + /** + *

+ * The transfer message. + *

+ *

+ * Constraints:
+ * Length: - 128
+ */ + private String transferMessage; + + /** + *

+ * The certificate creation date. + *

+ */ + private java.util.Date creationDate; + + /** + *

+ * The certificate ARN. + *

+ * + * @return

+ * The certificate ARN. + *

+ */ + public String getCertificateArn() { + return certificateArn; + } + + /** + *

+ * The certificate ARN. + *

+ * + * @param certificateArn

+ * The certificate ARN. + *

+ */ + public void setCertificateArn(String certificateArn) { + this.certificateArn = certificateArn; + } + + /** + *

+ * The certificate ARN. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param certificateArn

+ * The certificate ARN. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public OutgoingCertificate withCertificateArn(String certificateArn) { + this.certificateArn = certificateArn; + return this; + } + + /** + *

+ * The certificate ID. + *

+ *

+ * Constraints:
+ * Length: 64 - 64
+ * Pattern: (0x)?[a-fA-F0-9]+
+ * + * @return

+ * The certificate ID. + *

+ */ + public String getCertificateId() { + return certificateId; + } + + /** + *

+ * The certificate ID. + *

+ *

+ * Constraints:
+ * Length: 64 - 64
+ * Pattern: (0x)?[a-fA-F0-9]+
+ * + * @param certificateId

+ * The certificate ID. + *

+ */ + public void setCertificateId(String certificateId) { + this.certificateId = certificateId; + } + + /** + *

+ * The certificate ID. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 64 - 64
+ * Pattern: (0x)?[a-fA-F0-9]+
+ * + * @param certificateId

+ * The certificate ID. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public OutgoingCertificate withCertificateId(String certificateId) { + this.certificateId = certificateId; + return this; + } + + /** + *

+ * The AWS account to which the transfer was made. + *

+ *

+ * Constraints:
+ * Pattern: [0-9]{12}
+ * + * @return

+ * The AWS account to which the transfer was made. + *

+ */ + public String getTransferredTo() { + return transferredTo; + } + + /** + *

+ * The AWS account to which the transfer was made. + *

+ *

+ * Constraints:
+ * Pattern: [0-9]{12}
+ * + * @param transferredTo

+ * The AWS account to which the transfer was made. + *

+ */ + public void setTransferredTo(String transferredTo) { + this.transferredTo = transferredTo; + } + + /** + *

+ * The AWS account to which the transfer was made. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Pattern: [0-9]{12}
+ * + * @param transferredTo

+ * The AWS account to which the transfer was made. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public OutgoingCertificate withTransferredTo(String transferredTo) { + this.transferredTo = transferredTo; + return this; + } + + /** + *

+ * The date the transfer was initiated. + *

+ * + * @return

+ * The date the transfer was initiated. + *

+ */ + public java.util.Date getTransferDate() { + return transferDate; + } + + /** + *

+ * The date the transfer was initiated. + *

+ * + * @param transferDate

+ * The date the transfer was initiated. + *

+ */ + public void setTransferDate(java.util.Date transferDate) { + this.transferDate = transferDate; + } + + /** + *

+ * The date the transfer was initiated. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param transferDate

+ * The date the transfer was initiated. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public OutgoingCertificate withTransferDate(java.util.Date transferDate) { + this.transferDate = transferDate; + return this; + } + + /** + *

+ * The transfer message. + *

+ *

+ * Constraints:
+ * Length: - 128
+ * + * @return

+ * The transfer message. + *

+ */ + public String getTransferMessage() { + return transferMessage; + } + + /** + *

+ * The transfer message. + *

+ *

+ * Constraints:
+ * Length: - 128
+ * + * @param transferMessage

+ * The transfer message. + *

+ */ + public void setTransferMessage(String transferMessage) { + this.transferMessage = transferMessage; + } + + /** + *

+ * The transfer message. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: - 128
+ * + * @param transferMessage

+ * The transfer message. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public OutgoingCertificate withTransferMessage(String transferMessage) { + this.transferMessage = transferMessage; + return this; + } + + /** + *

+ * The certificate creation date. + *

+ * + * @return

+ * The certificate creation date. + *

+ */ + public java.util.Date getCreationDate() { + return creationDate; + } + + /** + *

+ * The certificate creation date. + *

+ * + * @param creationDate

+ * The certificate creation date. + *

+ */ + public void setCreationDate(java.util.Date creationDate) { + this.creationDate = creationDate; + } + + /** + *

+ * The certificate creation date. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param creationDate

+ * The certificate creation date. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public OutgoingCertificate withCreationDate(java.util.Date creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCertificateArn() != null) + sb.append("certificateArn: " + getCertificateArn() + ","); + if (getCertificateId() != null) + sb.append("certificateId: " + getCertificateId() + ","); + if (getTransferredTo() != null) + sb.append("transferredTo: " + getTransferredTo() + ","); + if (getTransferDate() != null) + sb.append("transferDate: " + getTransferDate() + ","); + if (getTransferMessage() != null) + sb.append("transferMessage: " + getTransferMessage() + ","); + if (getCreationDate() != null) + sb.append("creationDate: " + getCreationDate()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCertificateArn() == null) ? 0 : getCertificateArn().hashCode()); + hashCode = prime * hashCode + + ((getCertificateId() == null) ? 0 : getCertificateId().hashCode()); + hashCode = prime * hashCode + + ((getTransferredTo() == null) ? 0 : getTransferredTo().hashCode()); + hashCode = prime * hashCode + + ((getTransferDate() == null) ? 0 : getTransferDate().hashCode()); + hashCode = prime * hashCode + + ((getTransferMessage() == null) ? 0 : getTransferMessage().hashCode()); + hashCode = prime * hashCode + + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof OutgoingCertificate == false) + return false; + OutgoingCertificate other = (OutgoingCertificate) obj; + + if (other.getCertificateArn() == null ^ this.getCertificateArn() == null) + return false; + if (other.getCertificateArn() != null + && other.getCertificateArn().equals(this.getCertificateArn()) == false) + return false; + if (other.getCertificateId() == null ^ this.getCertificateId() == null) + return false; + if (other.getCertificateId() != null + && other.getCertificateId().equals(this.getCertificateId()) == false) + return false; + if (other.getTransferredTo() == null ^ this.getTransferredTo() == null) + return false; + if (other.getTransferredTo() != null + && other.getTransferredTo().equals(this.getTransferredTo()) == false) + return false; + if (other.getTransferDate() == null ^ this.getTransferDate() == null) + return false; + if (other.getTransferDate() != null + && other.getTransferDate().equals(this.getTransferDate()) == false) + return false; + if (other.getTransferMessage() == null ^ this.getTransferMessage() == null) + return false; + if (other.getTransferMessage() != null + && other.getTransferMessage().equals(this.getTransferMessage()) == false) + return false; + if (other.getCreationDate() == null ^ this.getCreationDate() == null) + return false; + if (other.getCreationDate() != null + && other.getCreationDate().equals(this.getCreationDate()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/PutItemInput.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/PutItemInput.java new file mode 100644 index 00000000000..a5e41afba47 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/PutItemInput.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The input for the DynamoActionVS action that specifies the DynamoDB table to + * which the message data will be written. + *

+ */ +public class PutItemInput implements Serializable { + /** + *

+ * The table where the message data will be written + *

+ */ + private String tableName; + + /** + *

+ * The table where the message data will be written + *

+ * + * @return

+ * The table where the message data will be written + *

+ */ + public String getTableName() { + return tableName; + } + + /** + *

+ * The table where the message data will be written + *

+ * + * @param tableName

+ * The table where the message data will be written + *

+ */ + public void setTableName(String tableName) { + this.tableName = tableName; + } + + /** + *

+ * The table where the message data will be written + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tableName

+ * The table where the message data will be written + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public PutItemInput withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getTableName() != null) + sb.append("tableName: " + getTableName()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof PutItemInput == false) + return false; + PutItemInput other = (PutItemInput) obj; + + if (other.getTableName() == null ^ this.getTableName() == null) + return false; + if (other.getTableName() != null + && other.getTableName().equals(this.getTableName()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCACertificateRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCACertificateRequest.java index 49d1780db46..6aef6ff983c 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCACertificateRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCACertificateRequest.java @@ -58,6 +58,14 @@ public class RegisterCACertificateRequest extends AmazonWebServiceRequest implem */ private Boolean setAsActive; + /** + *

+ * Allows this CA certificate to be used for auto registration of device + * certificates. + *

+ */ + private Boolean allowAutoRegistration; + /** *

* The CA certificate. @@ -228,6 +236,72 @@ public RegisterCACertificateRequest withSetAsActive(Boolean setAsActive) { return this; } + /** + *

+ * Allows this CA certificate to be used for auto registration of device + * certificates. + *

+ * + * @return

+ * Allows this CA certificate to be used for auto registration of + * device certificates. + *

+ */ + public Boolean isAllowAutoRegistration() { + return allowAutoRegistration; + } + + /** + *

+ * Allows this CA certificate to be used for auto registration of device + * certificates. + *

+ * + * @return

+ * Allows this CA certificate to be used for auto registration of + * device certificates. + *

+ */ + public Boolean getAllowAutoRegistration() { + return allowAutoRegistration; + } + + /** + *

+ * Allows this CA certificate to be used for auto registration of device + * certificates. + *

+ * + * @param allowAutoRegistration

+ * Allows this CA certificate to be used for auto registration of + * device certificates. + *

+ */ + public void setAllowAutoRegistration(Boolean allowAutoRegistration) { + this.allowAutoRegistration = allowAutoRegistration; + } + + /** + *

+ * Allows this CA certificate to be used for auto registration of device + * certificates. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param allowAutoRegistration

+ * Allows this CA certificate to be used for auto registration of + * device certificates. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public RegisterCACertificateRequest withAllowAutoRegistration(Boolean allowAutoRegistration) { + this.allowAutoRegistration = allowAutoRegistration; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -244,7 +318,9 @@ public String toString() { if (getVerificationCertificate() != null) sb.append("verificationCertificate: " + getVerificationCertificate() + ","); if (getSetAsActive() != null) - sb.append("setAsActive: " + getSetAsActive()); + sb.append("setAsActive: " + getSetAsActive() + ","); + if (getAllowAutoRegistration() != null) + sb.append("allowAutoRegistration: " + getAllowAutoRegistration()); sb.append("}"); return sb.toString(); } @@ -262,6 +338,9 @@ public int hashCode() { .hashCode()); hashCode = prime * hashCode + ((getSetAsActive() == null) ? 0 : getSetAsActive().hashCode()); + hashCode = prime + * hashCode + + ((getAllowAutoRegistration() == null) ? 0 : getAllowAutoRegistration().hashCode()); return hashCode; } @@ -291,6 +370,11 @@ public boolean equals(Object obj) { if (other.getSetAsActive() != null && other.getSetAsActive().equals(this.getSetAsActive()) == false) return false; + if (other.getAllowAutoRegistration() == null ^ this.getAllowAutoRegistration() == null) + return false; + if (other.getAllowAutoRegistration() != null + && other.getAllowAutoRegistration().equals(this.getAllowAutoRegistration()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCertificateRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCertificateRequest.java index bf40a2d29db..2bce513d10d 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCertificateRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/RegisterCertificateRequest.java @@ -54,6 +54,15 @@ public class RegisterCertificateRequest extends AmazonWebServiceRequest implemen */ private Boolean setAsActive; + /** + * The new value for the status property for this object. + *

+ * Constraints:
+ * Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, + * REGISTER_INACTIVE, PENDING_ACTIVATION + */ + private String status; + /** *

* The certificate data, in PEM format. @@ -227,6 +236,88 @@ public RegisterCertificateRequest withSetAsActive(Boolean setAsActive) { return this; } + /** + * Returns the value of the status property for this object. + *

+ * Constraints:
+ * Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, + * REGISTER_INACTIVE, PENDING_ACTIVATION + * + * @return The value of the status property for this object. + * @see CertificateStatus + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of status + *

+ * Constraints:
+ * Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, + * REGISTER_INACTIVE, PENDING_ACTIVATION + * + * @param status The new value for the status property for this object. + * @see CertificateStatus + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * Sets the value of the status property for this object. + *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, + * REGISTER_INACTIVE, PENDING_ACTIVATION + * + * @param status The new value for the status property for this object. + * @return A reference to this updated object so that method calls can be + * chained together. + * @see CertificateStatus + */ + public RegisterCertificateRequest withStatus(String status) { + this.status = status; + return this; + } + + /** + * Sets the value of status + *

+ * Constraints:
+ * Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, + * REGISTER_INACTIVE, PENDING_ACTIVATION + * + * @param status The new value for the status property for this object. + * @see CertificateStatus + */ + public void setStatus(CertificateStatus status) { + this.status = status.toString(); + } + + /** + * Sets the value of the status property for this object. + *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, + * REGISTER_INACTIVE, PENDING_ACTIVATION + * + * @param status The new value for the status property for this object. + * @return A reference to this updated object so that method calls can be + * chained together. + * @see CertificateStatus + */ + public RegisterCertificateRequest withStatus(CertificateStatus status) { + this.status = status.toString(); + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -243,7 +334,9 @@ public String toString() { if (getCaCertificatePem() != null) sb.append("caCertificatePem: " + getCaCertificatePem() + ","); if (getSetAsActive() != null) - sb.append("setAsActive: " + getSetAsActive()); + sb.append("setAsActive: " + getSetAsActive() + ","); + if (getStatus() != null) + sb.append("status: " + getStatus()); sb.append("}"); return sb.toString(); } @@ -259,6 +352,7 @@ public int hashCode() { + ((getCaCertificatePem() == null) ? 0 : getCaCertificatePem().hashCode()); hashCode = prime * hashCode + ((getSetAsActive() == null) ? 0 : getSetAsActive().hashCode()); + hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); return hashCode; } @@ -288,6 +382,10 @@ public boolean equals(Object obj) { if (other.getSetAsActive() != null && other.getSetAsActive().equals(this.getSetAsActive()) == false) return false; + if (other.getStatus() == null ^ this.getStatus() == null) + return false; + if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ResourceAlreadyExistsException.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ResourceAlreadyExistsException.java index b3556c749d8..ec78d4652ee 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ResourceAlreadyExistsException.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ResourceAlreadyExistsException.java @@ -25,6 +25,20 @@ public class ResourceAlreadyExistsException extends AmazonServiceException { private static final long serialVersionUID = 1L; + /** + *

+ * The ID of the resource that caused the exception. + *

+ */ + private String resourceId; + + /** + *

+ * The ARN of the resource that caused the exception. + *

+ */ + private String resourceArn; + /** * Constructs a new ResourceAlreadyExistsException with the specified error * message. @@ -34,4 +48,56 @@ public class ResourceAlreadyExistsException extends AmazonServiceException { public ResourceAlreadyExistsException(String message) { super(message); } + + /** + *

+ * The ID of the resource that caused the exception. + *

+ * + * @return

+ * The ID of the resource that caused the exception. + *

+ */ + public String getResourceId() { + return resourceId; + } + + /** + *

+ * The ID of the resource that caused the exception. + *

+ * + * @param resourceId

+ * The ID of the resource that caused the exception. + *

+ */ + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + /** + *

+ * The ARN of the resource that caused the exception. + *

+ * + * @return

+ * The ARN of the resource that caused the exception. + *

+ */ + public String getResourceArn() { + return resourceArn; + } + + /** + *

+ * The ARN of the resource that caused the exception. + *

+ * + * @param resourceArn

+ * The ARN of the resource that caused the exception. + *

+ */ + public void setResourceArn(String resourceArn) { + this.resourceArn = resourceArn; + } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/S3Action.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/S3Action.java index 43936535acb..ae24fe95267 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/S3Action.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/S3Action.java @@ -44,6 +44,21 @@ public class S3Action implements Serializable { */ private String key; + /** + *

+ * The Amazon S3 canned ACL that controls access to the object identified by + * the object key. For more information, see S3 canned ACLs. + *

+ *

+ * Constraints:
+ * Allowed Values: private, public-read, public-read-write, + * aws-exec-read, authenticated-read, bucket-owner-read, + * bucket-owner-full-control, log-delivery-write + */ + private String cannedAcl; + /** *

* The ARN of the IAM role that grants access. @@ -179,6 +194,147 @@ public S3Action withKey(String key) { return this; } + /** + *

+ * The Amazon S3 canned ACL that controls access to the object identified by + * the object key. For more information, see S3 canned ACLs. + *

+ *

+ * Constraints:
+ * Allowed Values: private, public-read, public-read-write, + * aws-exec-read, authenticated-read, bucket-owner-read, + * bucket-owner-full-control, log-delivery-write + * + * @return

+ * The Amazon S3 canned ACL that controls access to the object + * identified by the object key. For more information, see S3 canned ACLs. + *

+ * @see CannedAccessControlList + */ + public String getCannedAcl() { + return cannedAcl; + } + + /** + *

+ * The Amazon S3 canned ACL that controls access to the object identified by + * the object key. For more information, see S3 canned ACLs. + *

+ *

+ * Constraints:
+ * Allowed Values: private, public-read, public-read-write, + * aws-exec-read, authenticated-read, bucket-owner-read, + * bucket-owner-full-control, log-delivery-write + * + * @param cannedAcl

+ * The Amazon S3 canned ACL that controls access to the object + * identified by the object key. For more information, see S3 canned ACLs. + *

+ * @see CannedAccessControlList + */ + public void setCannedAcl(String cannedAcl) { + this.cannedAcl = cannedAcl; + } + + /** + *

+ * The Amazon S3 canned ACL that controls access to the object identified by + * the object key. For more information, see S3 canned ACLs. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: private, public-read, public-read-write, + * aws-exec-read, authenticated-read, bucket-owner-read, + * bucket-owner-full-control, log-delivery-write + * + * @param cannedAcl

+ * The Amazon S3 canned ACL that controls access to the object + * identified by the object key. For more information, see S3 canned ACLs. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see CannedAccessControlList + */ + public S3Action withCannedAcl(String cannedAcl) { + this.cannedAcl = cannedAcl; + return this; + } + + /** + *

+ * The Amazon S3 canned ACL that controls access to the object identified by + * the object key. For more information, see S3 canned ACLs. + *

+ *

+ * Constraints:
+ * Allowed Values: private, public-read, public-read-write, + * aws-exec-read, authenticated-read, bucket-owner-read, + * bucket-owner-full-control, log-delivery-write + * + * @param cannedAcl

+ * The Amazon S3 canned ACL that controls access to the object + * identified by the object key. For more information, see S3 canned ACLs. + *

+ * @see CannedAccessControlList + */ + public void setCannedAcl(CannedAccessControlList cannedAcl) { + this.cannedAcl = cannedAcl.toString(); + } + + /** + *

+ * The Amazon S3 canned ACL that controls access to the object identified by + * the object key. For more information, see S3 canned ACLs. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: private, public-read, public-read-write, + * aws-exec-read, authenticated-read, bucket-owner-read, + * bucket-owner-full-control, log-delivery-write + * + * @param cannedAcl

+ * The Amazon S3 canned ACL that controls access to the object + * identified by the object key. For more information, see S3 canned ACLs. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see CannedAccessControlList + */ + public S3Action withCannedAcl(CannedAccessControlList cannedAcl) { + this.cannedAcl = cannedAcl.toString(); + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -195,7 +351,9 @@ public String toString() { if (getBucketName() != null) sb.append("bucketName: " + getBucketName() + ","); if (getKey() != null) - sb.append("key: " + getKey()); + sb.append("key: " + getKey() + ","); + if (getCannedAcl() != null) + sb.append("cannedAcl: " + getCannedAcl()); sb.append("}"); return sb.toString(); } @@ -208,6 +366,7 @@ public int hashCode() { hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getBucketName() == null) ? 0 : getBucketName().hashCode()); hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); + hashCode = prime * hashCode + ((getCannedAcl() == null) ? 0 : getCannedAcl().hashCode()); return hashCode; } @@ -235,6 +394,11 @@ public boolean equals(Object obj) { return false; if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; + if (other.getCannedAcl() == null ^ this.getCannedAcl() == null) + return false; + if (other.getCannedAcl() != null + && other.getCannedAcl().equals(this.getCannedAcl()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingAttribute.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingAttribute.java index 55c18ce5f6a..8b74e9b995c 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingAttribute.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingAttribute.java @@ -19,7 +19,8 @@ /** *

- * Describes a thing attribute. + * The properties of the thing, including thing name, thing type name, and a + * list of thing attributes. *

*/ public class ThingAttribute implements Serializable { @@ -30,17 +31,35 @@ public class ThingAttribute implements Serializable { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * The attributes. + * The name of the thing type, if the thing has been associated with a type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * A list of thing attributes which are name-value pairs. *

*/ private java.util.Map attributes; + /** + *

+ * The version of the thing record in the registry. + *

+ */ + private Long version; + /** *

* The name of the thing. @@ -48,7 +67,7 @@ public class ThingAttribute implements Serializable { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the thing. @@ -65,7 +84,7 @@ public String getThingName() { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -85,7 +104,7 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing. @@ -100,11 +119,71 @@ public ThingAttribute withThingName(String thingName) { /** *

- * The attributes. + * The name of the thing type, if the thing has been associated with a type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type, if the thing has been associated with + * a type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type, if the thing has been associated with a type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type, if the thing has been associated + * with a type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type, if the thing has been associated with a type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type, if the thing has been associated + * with a type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingAttribute withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * A list of thing attributes which are name-value pairs. *

* * @return

- * The attributes. + * A list of thing attributes which are name-value pairs. *

*/ public java.util.Map getAttributes() { @@ -113,11 +192,11 @@ public java.util.Map getAttributes() { /** *

- * The attributes. + * A list of thing attributes which are name-value pairs. *

* * @param attributes

- * The attributes. + * A list of thing attributes which are name-value pairs. *

*/ public void setAttributes(java.util.Map attributes) { @@ -126,14 +205,14 @@ public void setAttributes(java.util.Map attributes) { /** *

- * The attributes. + * A list of thing attributes which are name-value pairs. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param attributes

- * The attributes. + * A list of thing attributes which are name-value pairs. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -145,7 +224,7 @@ public ThingAttribute withAttributes(java.util.Map attributes) { /** *

- * The attributes. + * A list of thing attributes which are name-value pairs. *

*

* The method adds a new key-value pair into attributes parameter, and @@ -180,6 +259,51 @@ public ThingAttribute clearattributesEntries() { return this; } + /** + *

+ * The version of the thing record in the registry. + *

+ * + * @return

+ * The version of the thing record in the registry. + *

+ */ + public Long getVersion() { + return version; + } + + /** + *

+ * The version of the thing record in the registry. + *

+ * + * @param version

+ * The version of the thing record in the registry. + *

+ */ + public void setVersion(Long version) { + this.version = version; + } + + /** + *

+ * The version of the thing record in the registry. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param version

+ * The version of the thing record in the registry. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingAttribute withVersion(Long version) { + this.version = version; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -193,8 +317,12 @@ public String toString() { sb.append("{"); if (getThingName() != null) sb.append("thingName: " + getThingName() + ","); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); if (getAttributes() != null) - sb.append("attributes: " + getAttributes()); + sb.append("attributes: " + getAttributes() + ","); + if (getVersion() != null) + sb.append("version: " + getVersion()); sb.append("}"); return sb.toString(); } @@ -205,7 +333,10 @@ public int hashCode() { int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); + hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); return hashCode; } @@ -225,11 +356,20 @@ public boolean equals(Object obj) { if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; + if (other.getVersion() == null ^ this.getVersion() == null) + return false; + if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeDefinition.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeDefinition.java new file mode 100644 index 00000000000..74df31d7f32 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeDefinition.java @@ -0,0 +1,278 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The definition of the thing type, including thing type name and description. + *

+ */ +public class ThingTypeDefinition implements Serializable { + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * The ThingTypeProperties for the thing type. + *

+ */ + private ThingTypeProperties thingTypeProperties; + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ */ + private ThingTypeMetadata thingTypeMetadata; + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeDefinition withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * The ThingTypeProperties for the thing type. + *

+ * + * @return

+ * The ThingTypeProperties for the thing type. + *

+ */ + public ThingTypeProperties getThingTypeProperties() { + return thingTypeProperties; + } + + /** + *

+ * The ThingTypeProperties for the thing type. + *

+ * + * @param thingTypeProperties

+ * The ThingTypeProperties for the thing type. + *

+ */ + public void setThingTypeProperties(ThingTypeProperties thingTypeProperties) { + this.thingTypeProperties = thingTypeProperties; + } + + /** + *

+ * The ThingTypeProperties for the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypeProperties

+ * The ThingTypeProperties for the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeDefinition withThingTypeProperties(ThingTypeProperties thingTypeProperties) { + this.thingTypeProperties = thingTypeProperties; + return this; + } + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ * + * @return

+ * The ThingTypeMetadata contains additional information about the + * thing type including: creation date and time, a value indicating + * whether the thing type is deprecated, and a date and time when + * time was deprecated. + *

+ */ + public ThingTypeMetadata getThingTypeMetadata() { + return thingTypeMetadata; + } + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ * + * @param thingTypeMetadata

+ * The ThingTypeMetadata contains additional information about + * the thing type including: creation date and time, a value + * indicating whether the thing type is deprecated, and a date + * and time when time was deprecated. + *

+ */ + public void setThingTypeMetadata(ThingTypeMetadata thingTypeMetadata) { + this.thingTypeMetadata = thingTypeMetadata; + } + + /** + *

+ * The ThingTypeMetadata contains additional information about the thing + * type including: creation date and time, a value indicating whether the + * thing type is deprecated, and a date and time when time was deprecated. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param thingTypeMetadata

+ * The ThingTypeMetadata contains additional information about + * the thing type including: creation date and time, a value + * indicating whether the thing type is deprecated, and a date + * and time when time was deprecated. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeDefinition withThingTypeMetadata(ThingTypeMetadata thingTypeMetadata) { + this.thingTypeMetadata = thingTypeMetadata; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); + if (getThingTypeProperties() != null) + sb.append("thingTypeProperties: " + getThingTypeProperties() + ","); + if (getThingTypeMetadata() != null) + sb.append("thingTypeMetadata: " + getThingTypeMetadata()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeProperties() == null) ? 0 : getThingTypeProperties().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeMetadata() == null) ? 0 : getThingTypeMetadata().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ThingTypeDefinition == false) + return false; + ThingTypeDefinition other = (ThingTypeDefinition) obj; + + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; + if (other.getThingTypeProperties() == null ^ this.getThingTypeProperties() == null) + return false; + if (other.getThingTypeProperties() != null + && other.getThingTypeProperties().equals(this.getThingTypeProperties()) == false) + return false; + if (other.getThingTypeMetadata() == null ^ this.getThingTypeMetadata() == null) + return false; + if (other.getThingTypeMetadata() != null + && other.getThingTypeMetadata().equals(this.getThingTypeMetadata()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeMetadata.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeMetadata.java new file mode 100644 index 00000000000..b734206aee7 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeMetadata.java @@ -0,0 +1,268 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The ThingTypeMetadata contains additional information about the thing type + * including: creation date and time, a value indicating whether the thing type + * is deprecated, and a date and time when time was deprecated. + *

+ */ +public class ThingTypeMetadata implements Serializable { + /** + *

+ * Whether the thing type is deprecated. If true, no new things could + * be associated with this type. + *

+ */ + private Boolean deprecated; + + /** + *

+ * The date and time when the thing type was deprecated. + *

+ */ + private java.util.Date deprecationDate; + + /** + *

+ * The date and time when the thing type was created. + *

+ */ + private java.util.Date creationDate; + + /** + *

+ * Whether the thing type is deprecated. If true, no new things could + * be associated with this type. + *

+ * + * @return

+ * Whether the thing type is deprecated. If true, no new + * things could be associated with this type. + *

+ */ + public Boolean isDeprecated() { + return deprecated; + } + + /** + *

+ * Whether the thing type is deprecated. If true, no new things could + * be associated with this type. + *

+ * + * @return

+ * Whether the thing type is deprecated. If true, no new + * things could be associated with this type. + *

+ */ + public Boolean getDeprecated() { + return deprecated; + } + + /** + *

+ * Whether the thing type is deprecated. If true, no new things could + * be associated with this type. + *

+ * + * @param deprecated

+ * Whether the thing type is deprecated. If true, no new + * things could be associated with this type. + *

+ */ + public void setDeprecated(Boolean deprecated) { + this.deprecated = deprecated; + } + + /** + *

+ * Whether the thing type is deprecated. If true, no new things could + * be associated with this type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param deprecated

+ * Whether the thing type is deprecated. If true, no new + * things could be associated with this type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeMetadata withDeprecated(Boolean deprecated) { + this.deprecated = deprecated; + return this; + } + + /** + *

+ * The date and time when the thing type was deprecated. + *

+ * + * @return

+ * The date and time when the thing type was deprecated. + *

+ */ + public java.util.Date getDeprecationDate() { + return deprecationDate; + } + + /** + *

+ * The date and time when the thing type was deprecated. + *

+ * + * @param deprecationDate

+ * The date and time when the thing type was deprecated. + *

+ */ + public void setDeprecationDate(java.util.Date deprecationDate) { + this.deprecationDate = deprecationDate; + } + + /** + *

+ * The date and time when the thing type was deprecated. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param deprecationDate

+ * The date and time when the thing type was deprecated. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeMetadata withDeprecationDate(java.util.Date deprecationDate) { + this.deprecationDate = deprecationDate; + return this; + } + + /** + *

+ * The date and time when the thing type was created. + *

+ * + * @return

+ * The date and time when the thing type was created. + *

+ */ + public java.util.Date getCreationDate() { + return creationDate; + } + + /** + *

+ * The date and time when the thing type was created. + *

+ * + * @param creationDate

+ * The date and time when the thing type was created. + *

+ */ + public void setCreationDate(java.util.Date creationDate) { + this.creationDate = creationDate; + } + + /** + *

+ * The date and time when the thing type was created. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param creationDate

+ * The date and time when the thing type was created. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeMetadata withCreationDate(java.util.Date creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getDeprecated() != null) + sb.append("deprecated: " + getDeprecated() + ","); + if (getDeprecationDate() != null) + sb.append("deprecationDate: " + getDeprecationDate() + ","); + if (getCreationDate() != null) + sb.append("creationDate: " + getCreationDate()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getDeprecated() == null) ? 0 : getDeprecated().hashCode()); + hashCode = prime * hashCode + + ((getDeprecationDate() == null) ? 0 : getDeprecationDate().hashCode()); + hashCode = prime * hashCode + + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ThingTypeMetadata == false) + return false; + ThingTypeMetadata other = (ThingTypeMetadata) obj; + + if (other.getDeprecated() == null ^ this.getDeprecated() == null) + return false; + if (other.getDeprecated() != null + && other.getDeprecated().equals(this.getDeprecated()) == false) + return false; + if (other.getDeprecationDate() == null ^ this.getDeprecationDate() == null) + return false; + if (other.getDeprecationDate() != null + && other.getDeprecationDate().equals(this.getDeprecationDate()) == false) + return false; + if (other.getCreationDate() == null ^ this.getCreationDate() == null) + return false; + if (other.getCreationDate() != null + && other.getCreationDate().equals(this.getCreationDate()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeProperties.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeProperties.java new file mode 100644 index 00000000000..d7ef969df7e --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ThingTypeProperties.java @@ -0,0 +1,231 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import java.io.Serializable; + +/** + *

+ * The ThingTypeProperties contains information about the thing type including: + * a thing type description, and a list of searchable thing attribute names. + *

+ */ +public class ThingTypeProperties implements Serializable { + /** + *

+ * The description of the thing type. + *

+ *

+ * Constraints:
+ * Length: - 2028
+ * Pattern: [\p{Graph}\x20]*
+ */ + private String thingTypeDescription; + + /** + *

+ * A list of searchable thing attribute names. + *

+ */ + private java.util.List searchableAttributes; + + /** + *

+ * The description of the thing type. + *

+ *

+ * Constraints:
+ * Length: - 2028
+ * Pattern: [\p{Graph}\x20]*
+ * + * @return

+ * The description of the thing type. + *

+ */ + public String getThingTypeDescription() { + return thingTypeDescription; + } + + /** + *

+ * The description of the thing type. + *

+ *

+ * Constraints:
+ * Length: - 2028
+ * Pattern: [\p{Graph}\x20]*
+ * + * @param thingTypeDescription

+ * The description of the thing type. + *

+ */ + public void setThingTypeDescription(String thingTypeDescription) { + this.thingTypeDescription = thingTypeDescription; + } + + /** + *

+ * The description of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: - 2028
+ * Pattern: [\p{Graph}\x20]*
+ * + * @param thingTypeDescription

+ * The description of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeProperties withThingTypeDescription(String thingTypeDescription) { + this.thingTypeDescription = thingTypeDescription; + return this; + } + + /** + *

+ * A list of searchable thing attribute names. + *

+ * + * @return

+ * A list of searchable thing attribute names. + *

+ */ + public java.util.List getSearchableAttributes() { + return searchableAttributes; + } + + /** + *

+ * A list of searchable thing attribute names. + *

+ * + * @param searchableAttributes

+ * A list of searchable thing attribute names. + *

+ */ + public void setSearchableAttributes(java.util.Collection searchableAttributes) { + if (searchableAttributes == null) { + this.searchableAttributes = null; + return; + } + + this.searchableAttributes = new java.util.ArrayList(searchableAttributes); + } + + /** + *

+ * A list of searchable thing attribute names. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param searchableAttributes

+ * A list of searchable thing attribute names. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeProperties withSearchableAttributes(String... searchableAttributes) { + if (getSearchableAttributes() == null) { + this.searchableAttributes = new java.util.ArrayList(searchableAttributes.length); + } + for (String value : searchableAttributes) { + this.searchableAttributes.add(value); + } + return this; + } + + /** + *

+ * A list of searchable thing attribute names. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param searchableAttributes

+ * A list of searchable thing attribute names. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ThingTypeProperties withSearchableAttributes( + java.util.Collection searchableAttributes) { + setSearchableAttributes(searchableAttributes); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getThingTypeDescription() != null) + sb.append("thingTypeDescription: " + getThingTypeDescription() + ","); + if (getSearchableAttributes() != null) + sb.append("searchableAttributes: " + getSearchableAttributes()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getThingTypeDescription() == null) ? 0 : getThingTypeDescription().hashCode()); + hashCode = prime * hashCode + + ((getSearchableAttributes() == null) ? 0 : getSearchableAttributes().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ThingTypeProperties == false) + return false; + ThingTypeProperties other = (ThingTypeProperties) obj; + + if (other.getThingTypeDescription() == null ^ this.getThingTypeDescription() == null) + return false; + if (other.getThingTypeDescription() != null + && other.getThingTypeDescription().equals(this.getThingTypeDescription()) == false) + return false; + if (other.getSearchableAttributes() == null ^ this.getSearchableAttributes() == null) + return false; + if (other.getSearchableAttributes() != null + && other.getSearchableAttributes().equals(this.getSearchableAttributes()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCACertificateRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCACertificateRequest.java index 58323d35a2a..27a5583750a 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCACertificateRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCACertificateRequest.java @@ -50,6 +50,17 @@ public class UpdateCACertificateRequest extends AmazonWebServiceRequest implemen */ private String newStatus; + /** + *

+ * The new value for the auto registration status. Valid values are: + * "ENABLE" or "DISABLE". + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + */ + private String newAutoRegistrationStatus; + /** *

* The CA certificate identifier. @@ -244,6 +255,114 @@ public UpdateCACertificateRequest withNewStatus(CACertificateStatus newStatus) { return this; } + /** + *

+ * The new value for the auto registration status. Valid values are: + * "ENABLE" or "DISABLE". + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @return

+ * The new value for the auto registration status. Valid values are: + * "ENABLE" or "DISABLE". + *

+ * @see AutoRegistrationStatus + */ + public String getNewAutoRegistrationStatus() { + return newAutoRegistrationStatus; + } + + /** + *

+ * The new value for the auto registration status. Valid values are: + * "ENABLE" or "DISABLE". + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param newAutoRegistrationStatus

+ * The new value for the auto registration status. Valid values + * are: "ENABLE" or "DISABLE". + *

+ * @see AutoRegistrationStatus + */ + public void setNewAutoRegistrationStatus(String newAutoRegistrationStatus) { + this.newAutoRegistrationStatus = newAutoRegistrationStatus; + } + + /** + *

+ * The new value for the auto registration status. Valid values are: + * "ENABLE" or "DISABLE". + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param newAutoRegistrationStatus

+ * The new value for the auto registration status. Valid values + * are: "ENABLE" or "DISABLE". + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoRegistrationStatus + */ + public UpdateCACertificateRequest withNewAutoRegistrationStatus(String newAutoRegistrationStatus) { + this.newAutoRegistrationStatus = newAutoRegistrationStatus; + return this; + } + + /** + *

+ * The new value for the auto registration status. Valid values are: + * "ENABLE" or "DISABLE". + *

+ *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param newAutoRegistrationStatus

+ * The new value for the auto registration status. Valid values + * are: "ENABLE" or "DISABLE". + *

+ * @see AutoRegistrationStatus + */ + public void setNewAutoRegistrationStatus(AutoRegistrationStatus newAutoRegistrationStatus) { + this.newAutoRegistrationStatus = newAutoRegistrationStatus.toString(); + } + + /** + *

+ * The new value for the auto registration status. Valid values are: + * "ENABLE" or "DISABLE". + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ENABLE, DISABLE + * + * @param newAutoRegistrationStatus

+ * The new value for the auto registration status. Valid values + * are: "ENABLE" or "DISABLE". + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoRegistrationStatus + */ + public UpdateCACertificateRequest withNewAutoRegistrationStatus( + AutoRegistrationStatus newAutoRegistrationStatus) { + this.newAutoRegistrationStatus = newAutoRegistrationStatus.toString(); + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -258,7 +377,9 @@ public String toString() { if (getCertificateId() != null) sb.append("certificateId: " + getCertificateId() + ","); if (getNewStatus() != null) - sb.append("newStatus: " + getNewStatus()); + sb.append("newStatus: " + getNewStatus() + ","); + if (getNewAutoRegistrationStatus() != null) + sb.append("newAutoRegistrationStatus: " + getNewAutoRegistrationStatus()); sb.append("}"); return sb.toString(); } @@ -271,6 +392,10 @@ public int hashCode() { hashCode = prime * hashCode + ((getCertificateId() == null) ? 0 : getCertificateId().hashCode()); hashCode = prime * hashCode + ((getNewStatus() == null) ? 0 : getNewStatus().hashCode()); + hashCode = prime + * hashCode + + ((getNewAutoRegistrationStatus() == null) ? 0 : getNewAutoRegistrationStatus() + .hashCode()); return hashCode; } @@ -295,6 +420,12 @@ public boolean equals(Object obj) { if (other.getNewStatus() != null && other.getNewStatus().equals(this.getNewStatus()) == false) return false; + if (other.getNewAutoRegistrationStatus() == null + ^ this.getNewAutoRegistrationStatus() == null) + return false; + if (other.getNewAutoRegistrationStatus() != null + && other.getNewAutoRegistrationStatus().equals(this.getNewAutoRegistrationStatus()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCertificateRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCertificateRequest.java index 7021c5962bc..c89e4d85a7f 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCertificateRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateCertificateRequest.java @@ -62,7 +62,7 @@ public class UpdateCertificateRequest extends AmazonWebServiceRequest implements *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION */ private String newStatus; @@ -139,7 +139,7 @@ public UpdateCertificateRequest withCertificateId(String certificateId) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @return

* The new status. @@ -175,7 +175,7 @@ public String getNewStatus() { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param newStatus

* The new status. @@ -215,7 +215,7 @@ public void setNewStatus(String newStatus) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param newStatus

* The new status. @@ -255,7 +255,7 @@ public UpdateCertificateRequest withNewStatus(String newStatus) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param newStatus

* The new status. @@ -295,7 +295,7 @@ public void setNewStatus(CertificateStatus newStatus) { *

* Constraints:
* Allowed Values: ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, - * REGISTER_INACTIVE + * REGISTER_INACTIVE, PENDING_ACTIVATION * * @param newStatus

* The new status. diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateThingRequest.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateThingRequest.java index 701a4d2691d..a9874a5ee88 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateThingRequest.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateThingRequest.java @@ -27,34 +27,69 @@ public class UpdateThingRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * The thing name. + * The name of the thing to update. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

- * The attribute payload, a JSON string containing up to three key-value - * pairs (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ */ + private String thingTypeName; + + /** + *

+ * A list of thing attributes, a JSON string containing name-value pairs. + * For example: + *

+ *

+ * {\"attributes\":{\"name1\":\"value2\"}}) + *

+ *

+ * This data is used to add new attributes or update existing attributes. *

*/ private AttributePayload attributePayload; /** *

- * The thing name. + * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the UpdateThing request is + * rejected with a VersionConflictException. + *

+ */ + private Long expectedVersion; + + /** + *

+ * Remove a thing type association. If true, the assocation is + * removed. + *

+ */ + private Boolean removeThingType; + + /** + *

+ * The name of the thing to update. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @return

- * The thing name. + * The name of the thing to update. *

*/ public String getThingName() { @@ -63,15 +98,15 @@ public String getThingName() { /** *

- * The thing name. + * The name of the thing to update. *

*

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The thing name. + * The name of the thing to update. *

*/ public void setThingName(String thingName) { @@ -80,7 +115,7 @@ public void setThingName(String thingName) { /** *

- * The thing name. + * The name of the thing to update. *

*

* Returns a reference to this object so that method calls can be chained @@ -88,10 +123,10 @@ public void setThingName(String thingName) { *

* Constraints:
* Length: 1 - 128
- * Pattern: [a-zA-Z0-9_-]+
+ * Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

- * The thing name. + * The name of the thing to update. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -103,14 +138,83 @@ public UpdateThingRequest withThingName(String thingName) { /** *

- * The attribute payload, a JSON string containing up to three key-value - * pairs (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @return

+ * The name of the thing type. + *

+ */ + public String getThingTypeName() { + return thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ */ + public void setThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + } + + /** + *

+ * The name of the thing type. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9:_-]+
+ * + * @param thingTypeName

+ * The name of the thing type. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateThingRequest withThingTypeName(String thingTypeName) { + this.thingTypeName = thingTypeName; + return this; + } + + /** + *

+ * A list of thing attributes, a JSON string containing name-value pairs. + * For example: + *

+ *

+ * {\"attributes\":{\"name1\":\"value2\"}}) + *

+ *

+ * This data is used to add new attributes or update existing attributes. *

* * @return

- * The attribute payload, a JSON string containing up to three - * key-value pairs (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * A list of thing attributes, a JSON string containing name-value + * pairs. For example: + *

+ *

+ * {\"attributes\":{\"name1\":\"value2\"}}) + *

+ *

+ * This data is used to add new attributes or update existing + * attributes. *

*/ public AttributePayload getAttributePayload() { @@ -119,14 +223,26 @@ public AttributePayload getAttributePayload() { /** *

- * The attribute payload, a JSON string containing up to three key-value - * pairs (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * A list of thing attributes, a JSON string containing name-value pairs. + * For example: + *

+ *

+ * {\"attributes\":{\"name1\":\"value2\"}}) + *

+ *

+ * This data is used to add new attributes or update existing attributes. *

* * @param attributePayload

- * The attribute payload, a JSON string containing up to three - * key-value pairs (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * A list of thing attributes, a JSON string containing + * name-value pairs. For example: + *

+ *

+ * {\"attributes\":{\"name1\":\"value2\"}}) + *

+ *

+ * This data is used to add new attributes or update existing + * attributes. *

*/ public void setAttributePayload(AttributePayload attributePayload) { @@ -135,17 +251,29 @@ public void setAttributePayload(AttributePayload attributePayload) { /** *

- * The attribute payload, a JSON string containing up to three key-value - * pairs (for example, {\"attributes\":{\"string1\":\"string2\"}}). + * A list of thing attributes, a JSON string containing name-value pairs. + * For example: + *

+ *

+ * {\"attributes\":{\"name1\":\"value2\"}}) + *

+ *

+ * This data is used to add new attributes or update existing attributes. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param attributePayload

- * The attribute payload, a JSON string containing up to three - * key-value pairs (for example, - * {\"attributes\":{\"string1\":\"string2\"}}). + * A list of thing attributes, a JSON string containing + * name-value pairs. For example: + *

+ *

+ * {\"attributes\":{\"name1\":\"value2\"}}) + *

+ *

+ * This data is used to add new attributes or update existing + * attributes. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -155,6 +283,137 @@ public UpdateThingRequest withAttributePayload(AttributePayload attributePayload return this; } + /** + *

+ * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the UpdateThing request is + * rejected with a VersionConflictException. + *

+ * + * @return

+ * The expected version of the thing record in the registry. If the + * version of the record in the registry does not match the expected + * version specified in the request, the UpdateThing + * request is rejected with a VersionConflictException. + *

+ */ + public Long getExpectedVersion() { + return expectedVersion; + } + + /** + *

+ * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the UpdateThing request is + * rejected with a VersionConflictException. + *

+ * + * @param expectedVersion

+ * The expected version of the thing record in the registry. If + * the version of the record in the registry does not match the + * expected version specified in the request, the + * UpdateThing request is rejected with a + * VersionConflictException. + *

+ */ + public void setExpectedVersion(Long expectedVersion) { + this.expectedVersion = expectedVersion; + } + + /** + *

+ * The expected version of the thing record in the registry. If the version + * of the record in the registry does not match the expected version + * specified in the request, the UpdateThing request is + * rejected with a VersionConflictException. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param expectedVersion

+ * The expected version of the thing record in the registry. If + * the version of the record in the registry does not match the + * expected version specified in the request, the + * UpdateThing request is rejected with a + * VersionConflictException. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateThingRequest withExpectedVersion(Long expectedVersion) { + this.expectedVersion = expectedVersion; + return this; + } + + /** + *

+ * Remove a thing type association. If true, the assocation is + * removed. + *

+ * + * @return

+ * Remove a thing type association. If true, the assocation + * is removed. + *

+ */ + public Boolean isRemoveThingType() { + return removeThingType; + } + + /** + *

+ * Remove a thing type association. If true, the assocation is + * removed. + *

+ * + * @return

+ * Remove a thing type association. If true, the assocation + * is removed. + *

+ */ + public Boolean getRemoveThingType() { + return removeThingType; + } + + /** + *

+ * Remove a thing type association. If true, the assocation is + * removed. + *

+ * + * @param removeThingType

+ * Remove a thing type association. If true, the + * assocation is removed. + *

+ */ + public void setRemoveThingType(Boolean removeThingType) { + this.removeThingType = removeThingType; + } + + /** + *

+ * Remove a thing type association. If true, the assocation is + * removed. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param removeThingType

+ * Remove a thing type association. If true, the + * assocation is removed. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateThingRequest withRemoveThingType(Boolean removeThingType) { + this.removeThingType = removeThingType; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -168,8 +427,14 @@ public String toString() { sb.append("{"); if (getThingName() != null) sb.append("thingName: " + getThingName() + ","); + if (getThingTypeName() != null) + sb.append("thingTypeName: " + getThingTypeName() + ","); if (getAttributePayload() != null) - sb.append("attributePayload: " + getAttributePayload()); + sb.append("attributePayload: " + getAttributePayload() + ","); + if (getExpectedVersion() != null) + sb.append("expectedVersion: " + getExpectedVersion() + ","); + if (getRemoveThingType() != null) + sb.append("removeThingType: " + getRemoveThingType()); sb.append("}"); return sb.toString(); } @@ -180,8 +445,14 @@ public int hashCode() { int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); + hashCode = prime * hashCode + + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributePayload() == null) ? 0 : getAttributePayload().hashCode()); + hashCode = prime * hashCode + + ((getExpectedVersion() == null) ? 0 : getExpectedVersion().hashCode()); + hashCode = prime * hashCode + + ((getRemoveThingType() == null) ? 0 : getRemoveThingType().hashCode()); return hashCode; } @@ -201,11 +472,26 @@ public boolean equals(Object obj) { if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; + if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) + return false; + if (other.getThingTypeName() != null + && other.getThingTypeName().equals(this.getThingTypeName()) == false) + return false; if (other.getAttributePayload() == null ^ this.getAttributePayload() == null) return false; if (other.getAttributePayload() != null && other.getAttributePayload().equals(this.getAttributePayload()) == false) return false; + if (other.getExpectedVersion() == null ^ this.getExpectedVersion() == null) + return false; + if (other.getExpectedVersion() != null + && other.getExpectedVersion().equals(this.getExpectedVersion()) == false) + return false; + if (other.getRemoveThingType() == null ^ this.getRemoveThingType() == null) + return false; + if (other.getRemoveThingType() != null + && other.getRemoveThingType().equals(this.getRemoveThingType()) == false) + return false; return true; } } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/VersionConflictException.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/VersionConflictException.java new file mode 100644 index 00000000000..e0ca37f572f --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/VersionConflictException.java @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model; + +import com.amazonaws.AmazonServiceException; + +/** + *

+ * An exception thrown when the version of a thing passed to a command is + * different than the version specified with the --version parameter. + *

+ */ +public class VersionConflictException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new VersionConflictException with the specified error + * message. + * + * @param message Describes the error encountered. + */ + public VersionConflictException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonMarshaller.java index 11c53b12083..617c4650cbb 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonMarshaller.java @@ -30,6 +30,11 @@ public void marshall(Action action, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.name("dynamoDB"); DynamoDBActionJsonMarshaller.getInstance().marshall(dynamoDB, jsonWriter); } + if (action.getDynamoDBv2() != null) { + DynamoDBv2Action dynamoDBv2 = action.getDynamoDBv2(); + jsonWriter.name("dynamoDBv2"); + DynamoDBv2ActionJsonMarshaller.getInstance().marshall(dynamoDBv2, jsonWriter); + } if (action.getLambda() != null) { LambdaAction lambda = action.getLambda(); jsonWriter.name("lambda"); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonUnmarshaller.java index c1bac7d6e3d..3fd952ecece 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ActionJsonUnmarshaller.java @@ -38,6 +38,9 @@ public Action unmarshall(JsonUnmarshallerContext context) throws Exception { if (name.equals("dynamoDB")) { action.setDynamoDB(DynamoDBActionJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("dynamoDBv2")) { + action.setDynamoDBv2(DynamoDBv2ActionJsonUnmarshaller.getInstance() + .unmarshall(context)); } else if (name.equals("lambda")) { action.setLambda(LambdaActionJsonUnmarshaller.getInstance() .unmarshall(context)); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonMarshaller.java index 07de5a69590..1523960a172 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonMarshaller.java @@ -39,6 +39,11 @@ public void marshall(AttributePayload attributePayload, AwsJsonWriter jsonWriter } jsonWriter.endObject(); } + if (attributePayload.getMerge() != null) { + Boolean merge = attributePayload.getMerge(); + jsonWriter.name("merge"); + jsonWriter.value(merge); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonUnmarshaller.java index aa53de535da..3d54b0b940b 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/AttributePayloadJsonUnmarshaller.java @@ -41,6 +41,9 @@ public AttributePayload unmarshall(JsonUnmarshallerContext context) throws Excep .getInstance() ) .unmarshall(context)); + } else if (name.equals("merge")) { + attributePayload.setMerge(BooleanJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonMarshaller.java index fbb399f72ee..4fd31a4a4f4 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonMarshaller.java @@ -56,6 +56,11 @@ public void marshall(CACertificateDescription cACertificateDescription, AwsJsonW jsonWriter.name("creationDate"); jsonWriter.value(creationDate); } + if (cACertificateDescription.getAutoRegistrationStatus() != null) { + String autoRegistrationStatus = cACertificateDescription.getAutoRegistrationStatus(); + jsonWriter.name("autoRegistrationStatus"); + jsonWriter.value(autoRegistrationStatus); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonUnmarshaller.java index 44432bc1554..f320de92f20 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CACertificateDescriptionJsonUnmarshaller.java @@ -54,6 +54,10 @@ public CACertificateDescription unmarshall(JsonUnmarshallerContext context) thro } else if (name.equals("creationDate")) { cACertificateDescription.setCreationDate(DateJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("autoRegistrationStatus")) { + cACertificateDescription.setAutoRegistrationStatus(StringJsonUnmarshaller + .getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingRequestMarshaller.java index 2e9614c1244..e3418a47841 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingRequestMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingRequestMarshaller.java @@ -61,6 +61,11 @@ public Request marshall(CreateThingRequest createThingReques AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); jsonWriter.beginObject(); + if (createThingRequest.getThingTypeName() != null) { + String thingTypeName = createThingRequest.getThingTypeName(); + jsonWriter.name("thingTypeName"); + jsonWriter.value(thingTypeName); + } if (createThingRequest.getAttributePayload() != null) { AttributePayload attributePayload = createThingRequest.getAttributePayload(); jsonWriter.name("attributePayload"); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingTypeRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingTypeRequestMarshaller.java new file mode 100644 index 00000000000..8fb60ae835f --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingTypeRequestMarshaller.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for CreateThingTypeRequest + */ +public class CreateThingTypeRequestMarshaller implements + Marshaller, CreateThingTypeRequest> { + + public Request marshall(CreateThingTypeRequest createThingTypeRequest) { + if (createThingTypeRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(CreateThingTypeRequest)"); + } + + Request request = new DefaultRequest( + createThingTypeRequest, "AWSIot"); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/thing-types/{thingTypeName}"; + uriResourcePath = uriResourcePath.replace( + "{thingTypeName}", + (createThingTypeRequest.getThingTypeName() == null) ? "" : StringUtils + .fromString(createThingTypeRequest.getThingTypeName())); + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (createThingTypeRequest.getThingTypeProperties() != null) { + ThingTypeProperties thingTypeProperties = createThingTypeRequest + .getThingTypeProperties(); + jsonWriter.name("thingTypeProperties"); + ThingTypePropertiesJsonMarshaller.getInstance().marshall(thingTypeProperties, + jsonWriter); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.0"); + } + + return request; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingTypeResultJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingTypeResultJsonUnmarshaller.java new file mode 100644 index 00000000000..cb7e6cd11f9 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/CreateThingTypeResultJsonUnmarshaller.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response CreateThingTypeResult + */ +public class CreateThingTypeResultJsonUnmarshaller implements + Unmarshaller { + + public CreateThingTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception { + CreateThingTypeResult createThingTypeResult = new CreateThingTypeResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("thingTypeName")) { + createThingTypeResult.setThingTypeName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("thingTypeArn")) { + createThingTypeResult.setThingTypeArn(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return createThingTypeResult; + } + + private static CreateThingTypeResultJsonUnmarshaller instance; + + public static CreateThingTypeResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new CreateThingTypeResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingRequestMarshaller.java index c5bd14197f3..b98d458dd3b 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingRequestMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingRequestMarshaller.java @@ -55,6 +55,10 @@ public Request marshall(DeleteThingRequest deleteThingReques "{thingName}", (deleteThingRequest.getThingName() == null) ? "" : StringUtils .fromString(deleteThingRequest.getThingName())); + if (deleteThingRequest.getExpectedVersion() != null) { + request.addParameter("expectedVersion", + StringUtils.fromLong(deleteThingRequest.getExpectedVersion())); + } request.setResourcePath(uriResourcePath); if (!request.getHeaders().containsKey("Content-Type")) { request.addHeader("Content-Type", "application/x-amz-json-1.0"); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingTypeRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingTypeRequestMarshaller.java new file mode 100644 index 00000000000..2a290cae8ec --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingTypeRequestMarshaller.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DeleteThingTypeRequest + */ +public class DeleteThingTypeRequestMarshaller implements + Marshaller, DeleteThingTypeRequest> { + + public Request marshall(DeleteThingTypeRequest deleteThingTypeRequest) { + if (deleteThingTypeRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DeleteThingTypeRequest)"); + } + + Request request = new DefaultRequest( + deleteThingTypeRequest, "AWSIot"); + request.setHttpMethod(HttpMethodName.DELETE); + + String uriResourcePath = "/thing-types/{thingTypeName}"; + uriResourcePath = uriResourcePath.replace( + "{thingTypeName}", + (deleteThingTypeRequest.getThingTypeName() == null) ? "" : StringUtils + .fromString(deleteThingTypeRequest.getThingTypeName())); + request.setResourcePath(uriResourcePath); + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.0"); + } + + return request; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingTypeResultJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingTypeResultJsonUnmarshaller.java new file mode 100644 index 00000000000..67d4f3f29da --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeleteThingTypeResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DeleteThingTypeResult + */ +public class DeleteThingTypeResultJsonUnmarshaller implements + Unmarshaller { + + public DeleteThingTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DeleteThingTypeResult deleteThingTypeResult = new DeleteThingTypeResult(); + + return deleteThingTypeResult; + } + + private static DeleteThingTypeResultJsonUnmarshaller instance; + + public static DeleteThingTypeResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DeleteThingTypeResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeprecateThingTypeRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeprecateThingTypeRequestMarshaller.java new file mode 100644 index 00000000000..660a201dd51 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeprecateThingTypeRequestMarshaller.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DeprecateThingTypeRequest + */ +public class DeprecateThingTypeRequestMarshaller implements + Marshaller, DeprecateThingTypeRequest> { + + public Request marshall( + DeprecateThingTypeRequest deprecateThingTypeRequest) { + if (deprecateThingTypeRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DeprecateThingTypeRequest)"); + } + + Request request = new DefaultRequest( + deprecateThingTypeRequest, "AWSIot"); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/thing-types/{thingTypeName}/deprecate"; + uriResourcePath = uriResourcePath.replace( + "{thingTypeName}", + (deprecateThingTypeRequest.getThingTypeName() == null) ? "" : StringUtils + .fromString(deprecateThingTypeRequest.getThingTypeName())); + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (deprecateThingTypeRequest.getUndoDeprecate() != null) { + Boolean undoDeprecate = deprecateThingTypeRequest.getUndoDeprecate(); + jsonWriter.name("undoDeprecate"); + jsonWriter.value(undoDeprecate); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.0"); + } + + return request; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeprecateThingTypeResultJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeprecateThingTypeResultJsonUnmarshaller.java new file mode 100644 index 00000000000..ef214413ca3 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DeprecateThingTypeResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DeprecateThingTypeResult + */ +public class DeprecateThingTypeResultJsonUnmarshaller implements + Unmarshaller { + + public DeprecateThingTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DeprecateThingTypeResult deprecateThingTypeResult = new DeprecateThingTypeResult(); + + return deprecateThingTypeResult; + } + + private static DeprecateThingTypeResultJsonUnmarshaller instance; + + public static DeprecateThingTypeResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DeprecateThingTypeResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingResultJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingResultJsonUnmarshaller.java index bc5ba003347..35a497178da 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingResultJsonUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingResultJsonUnmarshaller.java @@ -39,11 +39,17 @@ public DescribeThingResult unmarshall(JsonUnmarshallerContext context) throws Ex } else if (name.equals("thingName")) { describeThingResult.setThingName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("thingTypeName")) { + describeThingResult.setThingTypeName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); } else if (name.equals("attributes")) { describeThingResult.setAttributes(new MapUnmarshaller( StringJsonUnmarshaller.getInstance() ) .unmarshall(context)); + } else if (name.equals("version")) { + describeThingResult.setVersion(LongJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingTypeRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingTypeRequestMarshaller.java new file mode 100644 index 00000000000..ae27ecb64f5 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingTypeRequestMarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DescribeThingTypeRequest + */ +public class DescribeThingTypeRequestMarshaller implements + Marshaller, DescribeThingTypeRequest> { + + public Request marshall( + DescribeThingTypeRequest describeThingTypeRequest) { + if (describeThingTypeRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DescribeThingTypeRequest)"); + } + + Request request = new DefaultRequest( + describeThingTypeRequest, "AWSIot"); + request.setHttpMethod(HttpMethodName.GET); + + String uriResourcePath = "/thing-types/{thingTypeName}"; + uriResourcePath = uriResourcePath.replace( + "{thingTypeName}", + (describeThingTypeRequest.getThingTypeName() == null) ? "" : StringUtils + .fromString(describeThingTypeRequest.getThingTypeName())); + request.setResourcePath(uriResourcePath); + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.0"); + } + + return request; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingTypeResultJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingTypeResultJsonUnmarshaller.java new file mode 100644 index 00000000000..c2ff990e3f3 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DescribeThingTypeResultJsonUnmarshaller.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DescribeThingTypeResult + */ +public class DescribeThingTypeResultJsonUnmarshaller implements + Unmarshaller { + + public DescribeThingTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DescribeThingTypeResult describeThingTypeResult = new DescribeThingTypeResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("thingTypeName")) { + describeThingTypeResult.setThingTypeName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("thingTypeProperties")) { + describeThingTypeResult.setThingTypeProperties(ThingTypePropertiesJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else if (name.equals("thingTypeMetadata")) { + describeThingTypeResult.setThingTypeMetadata(ThingTypeMetadataJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return describeThingTypeResult; + } + + private static DescribeThingTypeResultJsonUnmarshaller instance; + + public static DescribeThingTypeResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DescribeThingTypeResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DynamoDBv2ActionJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DynamoDBv2ActionJsonMarshaller.java new file mode 100644 index 00000000000..1e437deeb29 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DynamoDBv2ActionJsonMarshaller.java @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO DynamoDBv2Action + */ +class DynamoDBv2ActionJsonMarshaller { + + public void marshall(DynamoDBv2Action dynamoDBv2Action, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (dynamoDBv2Action.getRoleArn() != null) { + String roleArn = dynamoDBv2Action.getRoleArn(); + jsonWriter.name("roleArn"); + jsonWriter.value(roleArn); + } + if (dynamoDBv2Action.getPutItem() != null) { + PutItemInput putItem = dynamoDBv2Action.getPutItem(); + jsonWriter.name("putItem"); + PutItemInputJsonMarshaller.getInstance().marshall(putItem, jsonWriter); + } + jsonWriter.endObject(); + } + + private static DynamoDBv2ActionJsonMarshaller instance; + + public static DynamoDBv2ActionJsonMarshaller getInstance() { + if (instance == null) + instance = new DynamoDBv2ActionJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DynamoDBv2ActionJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DynamoDBv2ActionJsonUnmarshaller.java new file mode 100644 index 00000000000..240ddd69237 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/DynamoDBv2ActionJsonUnmarshaller.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO DynamoDBv2Action + */ +class DynamoDBv2ActionJsonUnmarshaller implements + Unmarshaller { + + public DynamoDBv2Action unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + DynamoDBv2Action dynamoDBv2Action = new DynamoDBv2Action(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("roleArn")) { + dynamoDBv2Action.setRoleArn(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("putItem")) { + dynamoDBv2Action.setPutItem(PutItemInputJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return dynamoDBv2Action; + } + + private static DynamoDBv2ActionJsonUnmarshaller instance; + + public static DynamoDBv2ActionJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DynamoDBv2ActionJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonMarshaller.java index dd6f24d25c4..7249bdcc7ec 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonMarshaller.java @@ -35,6 +35,11 @@ public void marshall(FirehoseAction firehoseAction, AwsJsonWriter jsonWriter) th jsonWriter.name("deliveryStreamName"); jsonWriter.value(deliveryStreamName); } + if (firehoseAction.getSeparator() != null) { + String separator = firehoseAction.getSeparator(); + jsonWriter.name("separator"); + jsonWriter.value(separator); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonUnmarshaller.java index 70c67521ca4..361fb6d601c 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/FirehoseActionJsonUnmarshaller.java @@ -42,6 +42,9 @@ public FirehoseAction unmarshall(JsonUnmarshallerContext context) throws Excepti } else if (name.equals("deliveryStreamName")) { firehoseAction.setDeliveryStreamName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("separator")) { + firehoseAction.setSeparator(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListOutgoingCertificatesRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListOutgoingCertificatesRequestMarshaller.java new file mode 100644 index 00000000000..62c34e390fc --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListOutgoingCertificatesRequestMarshaller.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for ListOutgoingCertificatesRequest + */ +public class ListOutgoingCertificatesRequestMarshaller implements + Marshaller, ListOutgoingCertificatesRequest> { + + public Request marshall( + ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) { + if (listOutgoingCertificatesRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(ListOutgoingCertificatesRequest)"); + } + + Request request = new DefaultRequest( + listOutgoingCertificatesRequest, "AWSIot"); + request.setHttpMethod(HttpMethodName.GET); + + String uriResourcePath = "/certificates-out-going"; + if (listOutgoingCertificatesRequest.getPageSize() != null) { + request.addParameter("pageSize", + StringUtils.fromInteger(listOutgoingCertificatesRequest.getPageSize())); + } + if (listOutgoingCertificatesRequest.getMarker() != null) { + request.addParameter("marker", + StringUtils.fromString(listOutgoingCertificatesRequest.getMarker())); + } + if (listOutgoingCertificatesRequest.getAscendingOrder() != null) { + request.addParameter("isAscendingOrder", + StringUtils.fromBoolean(listOutgoingCertificatesRequest.getAscendingOrder())); + } + request.setResourcePath(uriResourcePath); + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.0"); + } + + return request; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListOutgoingCertificatesResultJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListOutgoingCertificatesResultJsonUnmarshaller.java new file mode 100644 index 00000000000..4907b937533 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListOutgoingCertificatesResultJsonUnmarshaller.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response ListOutgoingCertificatesResult + */ +public class ListOutgoingCertificatesResultJsonUnmarshaller implements + Unmarshaller { + + public ListOutgoingCertificatesResult unmarshall(JsonUnmarshallerContext context) + throws Exception { + ListOutgoingCertificatesResult listOutgoingCertificatesResult = new ListOutgoingCertificatesResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("outgoingCertificates")) { + listOutgoingCertificatesResult + .setOutgoingCertificates(new ListUnmarshaller( + OutgoingCertificateJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("nextMarker")) { + listOutgoingCertificatesResult.setNextMarker(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return listOutgoingCertificatesResult; + } + + private static ListOutgoingCertificatesResultJsonUnmarshaller instance; + + public static ListOutgoingCertificatesResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ListOutgoingCertificatesResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingTypesRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingTypesRequestMarshaller.java new file mode 100644 index 00000000000..751785fdcf3 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingTypesRequestMarshaller.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for ListThingTypesRequest + */ +public class ListThingTypesRequestMarshaller implements + Marshaller, ListThingTypesRequest> { + + public Request marshall(ListThingTypesRequest listThingTypesRequest) { + if (listThingTypesRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(ListThingTypesRequest)"); + } + + Request request = new DefaultRequest( + listThingTypesRequest, "AWSIot"); + request.setHttpMethod(HttpMethodName.GET); + + String uriResourcePath = "/thing-types"; + if (listThingTypesRequest.getNextToken() != null) { + request.addParameter("nextToken", + StringUtils.fromString(listThingTypesRequest.getNextToken())); + } + if (listThingTypesRequest.getMaxResults() != null) { + request.addParameter("maxResults", + StringUtils.fromInteger(listThingTypesRequest.getMaxResults())); + } + if (listThingTypesRequest.getThingTypeName() != null) { + request.addParameter("thingTypeName", + StringUtils.fromString(listThingTypesRequest.getThingTypeName())); + } + request.setResourcePath(uriResourcePath); + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.0"); + } + + return request; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingTypesResultJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingTypesResultJsonUnmarshaller.java new file mode 100644 index 00000000000..db361db344e --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingTypesResultJsonUnmarshaller.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response ListThingTypesResult + */ +public class ListThingTypesResultJsonUnmarshaller implements + Unmarshaller { + + public ListThingTypesResult unmarshall(JsonUnmarshallerContext context) throws Exception { + ListThingTypesResult listThingTypesResult = new ListThingTypesResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("thingTypes")) { + listThingTypesResult.setThingTypes(new ListUnmarshaller( + ThingTypeDefinitionJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("nextToken")) { + listThingTypesResult.setNextToken(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return listThingTypesResult; + } + + private static ListThingTypesResultJsonUnmarshaller instance; + + public static ListThingTypesResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ListThingTypesResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingsRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingsRequestMarshaller.java index 3ef04084b7b..bafc26f9c96 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingsRequestMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ListThingsRequestMarshaller.java @@ -67,6 +67,10 @@ public Request marshall(ListThingsRequest listThingsRequest) request.addParameter("attributeValue", StringUtils.fromString(listThingsRequest.getAttributeValue())); } + if (listThingsRequest.getThingTypeName() != null) { + request.addParameter("thingTypeName", + StringUtils.fromString(listThingsRequest.getThingTypeName())); + } request.setResourcePath(uriResourcePath); if (!request.getHeaders().containsKey("Content-Type")) { request.addHeader("Content-Type", "application/x-amz-json-1.0"); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/OutgoingCertificateJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/OutgoingCertificateJsonMarshaller.java new file mode 100644 index 00000000000..de43879fda4 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/OutgoingCertificateJsonMarshaller.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO OutgoingCertificate + */ +class OutgoingCertificateJsonMarshaller { + + public void marshall(OutgoingCertificate outgoingCertificate, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (outgoingCertificate.getCertificateArn() != null) { + String certificateArn = outgoingCertificate.getCertificateArn(); + jsonWriter.name("certificateArn"); + jsonWriter.value(certificateArn); + } + if (outgoingCertificate.getCertificateId() != null) { + String certificateId = outgoingCertificate.getCertificateId(); + jsonWriter.name("certificateId"); + jsonWriter.value(certificateId); + } + if (outgoingCertificate.getTransferredTo() != null) { + String transferredTo = outgoingCertificate.getTransferredTo(); + jsonWriter.name("transferredTo"); + jsonWriter.value(transferredTo); + } + if (outgoingCertificate.getTransferDate() != null) { + java.util.Date transferDate = outgoingCertificate.getTransferDate(); + jsonWriter.name("transferDate"); + jsonWriter.value(transferDate); + } + if (outgoingCertificate.getTransferMessage() != null) { + String transferMessage = outgoingCertificate.getTransferMessage(); + jsonWriter.name("transferMessage"); + jsonWriter.value(transferMessage); + } + if (outgoingCertificate.getCreationDate() != null) { + java.util.Date creationDate = outgoingCertificate.getCreationDate(); + jsonWriter.name("creationDate"); + jsonWriter.value(creationDate); + } + jsonWriter.endObject(); + } + + private static OutgoingCertificateJsonMarshaller instance; + + public static OutgoingCertificateJsonMarshaller getInstance() { + if (instance == null) + instance = new OutgoingCertificateJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/OutgoingCertificateJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/OutgoingCertificateJsonUnmarshaller.java new file mode 100644 index 00000000000..770e50648e5 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/OutgoingCertificateJsonUnmarshaller.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO OutgoingCertificate + */ +class OutgoingCertificateJsonUnmarshaller implements + Unmarshaller { + + public OutgoingCertificate unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + OutgoingCertificate outgoingCertificate = new OutgoingCertificate(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("certificateArn")) { + outgoingCertificate.setCertificateArn(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("certificateId")) { + outgoingCertificate.setCertificateId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("transferredTo")) { + outgoingCertificate.setTransferredTo(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("transferDate")) { + outgoingCertificate.setTransferDate(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("transferMessage")) { + outgoingCertificate.setTransferMessage(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("creationDate")) { + outgoingCertificate.setCreationDate(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return outgoingCertificate; + } + + private static OutgoingCertificateJsonUnmarshaller instance; + + public static OutgoingCertificateJsonUnmarshaller getInstance() { + if (instance == null) + instance = new OutgoingCertificateJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/PutItemInputJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/PutItemInputJsonMarshaller.java new file mode 100644 index 00000000000..f5f8482ec3a --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/PutItemInputJsonMarshaller.java @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO PutItemInput + */ +class PutItemInputJsonMarshaller { + + public void marshall(PutItemInput putItemInput, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (putItemInput.getTableName() != null) { + String tableName = putItemInput.getTableName(); + jsonWriter.name("tableName"); + jsonWriter.value(tableName); + } + jsonWriter.endObject(); + } + + private static PutItemInputJsonMarshaller instance; + + public static PutItemInputJsonMarshaller getInstance() { + if (instance == null) + instance = new PutItemInputJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/PutItemInputJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/PutItemInputJsonUnmarshaller.java new file mode 100644 index 00000000000..3a892bfa063 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/PutItemInputJsonUnmarshaller.java @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO PutItemInput + */ +class PutItemInputJsonUnmarshaller implements Unmarshaller { + + public PutItemInput unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + PutItemInput putItemInput = new PutItemInput(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("tableName")) { + putItemInput.setTableName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return putItemInput; + } + + private static PutItemInputJsonUnmarshaller instance; + + public static PutItemInputJsonUnmarshaller getInstance() { + if (instance == null) + instance = new PutItemInputJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCACertificateRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCACertificateRequestMarshaller.java index 574d49a4a47..f61d638c1ea 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCACertificateRequestMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCACertificateRequestMarshaller.java @@ -56,6 +56,10 @@ public Request marshall( request.addParameter("setAsActive", StringUtils.fromBoolean(registerCACertificateRequest.getSetAsActive())); } + if (registerCACertificateRequest.getAllowAutoRegistration() != null) { + request.addParameter("allowAutoRegistration", StringUtils + .fromBoolean(registerCACertificateRequest.getAllowAutoRegistration())); + } request.setResourcePath(uriResourcePath); try { StringWriter stringWriter = new StringWriter(); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCertificateRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCertificateRequestMarshaller.java index 6d4ca7546bb..4ddafb00eb6 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCertificateRequestMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/RegisterCertificateRequestMarshaller.java @@ -72,6 +72,11 @@ public Request marshall( jsonWriter.name("caCertificatePem"); jsonWriter.value(caCertificatePem); } + if (registerCertificateRequest.getStatus() != null) { + String status = registerCertificateRequest.getStatus(); + jsonWriter.name("status"); + jsonWriter.value(status); + } jsonWriter.endObject(); jsonWriter.close(); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ResourceAlreadyExistsExceptionUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ResourceAlreadyExistsExceptionUnmarshaller.java index 9f619dc2af1..535bb890446 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ResourceAlreadyExistsExceptionUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ResourceAlreadyExistsExceptionUnmarshaller.java @@ -36,6 +36,9 @@ public AmazonServiceException unmarshall(JsonErrorResponse error) throws Excepti ResourceAlreadyExistsException e = (ResourceAlreadyExistsException) super.unmarshall(error); e.setErrorCode("ResourceAlreadyExistsException"); + e.setResourceId(String.valueOf(error.get("resourceId"))); + + e.setResourceArn(String.valueOf(error.get("resourceArn"))); return e; } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonMarshaller.java index bb0f856f540..5738d763b88 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonMarshaller.java @@ -40,6 +40,11 @@ public void marshall(S3Action s3Action, AwsJsonWriter jsonWriter) throws Excepti jsonWriter.name("key"); jsonWriter.value(key); } + if (s3Action.getCannedAcl() != null) { + String cannedAcl = s3Action.getCannedAcl(); + jsonWriter.name("cannedAcl"); + jsonWriter.value(cannedAcl); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonUnmarshaller.java index b61a0cfbba6..6c8e385bb8c 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/S3ActionJsonUnmarshaller.java @@ -44,6 +44,9 @@ public S3Action unmarshall(JsonUnmarshallerContext context) throws Exception { } else if (name.equals("key")) { s3Action.setKey(StringJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("cannedAcl")) { + s3Action.setCannedAcl(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonMarshaller.java index 1e3687dd2a5..f40966697a3 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonMarshaller.java @@ -30,6 +30,11 @@ public void marshall(ThingAttribute thingAttribute, AwsJsonWriter jsonWriter) th jsonWriter.name("thingName"); jsonWriter.value(thingName); } + if (thingAttribute.getThingTypeName() != null) { + String thingTypeName = thingAttribute.getThingTypeName(); + jsonWriter.name("thingTypeName"); + jsonWriter.value(thingTypeName); + } if (thingAttribute.getAttributes() != null) { java.util.Map attributes = thingAttribute.getAttributes(); jsonWriter.name("attributes"); @@ -43,6 +48,11 @@ public void marshall(ThingAttribute thingAttribute, AwsJsonWriter jsonWriter) th } jsonWriter.endObject(); } + if (thingAttribute.getVersion() != null) { + Long version = thingAttribute.getVersion(); + jsonWriter.name("version"); + jsonWriter.value(version); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonUnmarshaller.java index b0b98785747..1e2ca0a4e87 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonUnmarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingAttributeJsonUnmarshaller.java @@ -39,11 +39,17 @@ public ThingAttribute unmarshall(JsonUnmarshallerContext context) throws Excepti if (name.equals("thingName")) { thingAttribute.setThingName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("thingTypeName")) { + thingAttribute.setThingTypeName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); } else if (name.equals("attributes")) { thingAttribute.setAttributes(new MapUnmarshaller(StringJsonUnmarshaller .getInstance() ) .unmarshall(context)); + } else if (name.equals("version")) { + thingAttribute.setVersion(LongJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeDefinitionJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeDefinitionJsonMarshaller.java new file mode 100644 index 00000000000..c42f3ae727c --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeDefinitionJsonMarshaller.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO ThingTypeDefinition + */ +class ThingTypeDefinitionJsonMarshaller { + + public void marshall(ThingTypeDefinition thingTypeDefinition, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (thingTypeDefinition.getThingTypeName() != null) { + String thingTypeName = thingTypeDefinition.getThingTypeName(); + jsonWriter.name("thingTypeName"); + jsonWriter.value(thingTypeName); + } + if (thingTypeDefinition.getThingTypeProperties() != null) { + ThingTypeProperties thingTypeProperties = thingTypeDefinition.getThingTypeProperties(); + jsonWriter.name("thingTypeProperties"); + ThingTypePropertiesJsonMarshaller.getInstance().marshall(thingTypeProperties, + jsonWriter); + } + if (thingTypeDefinition.getThingTypeMetadata() != null) { + ThingTypeMetadata thingTypeMetadata = thingTypeDefinition.getThingTypeMetadata(); + jsonWriter.name("thingTypeMetadata"); + ThingTypeMetadataJsonMarshaller.getInstance().marshall(thingTypeMetadata, jsonWriter); + } + jsonWriter.endObject(); + } + + private static ThingTypeDefinitionJsonMarshaller instance; + + public static ThingTypeDefinitionJsonMarshaller getInstance() { + if (instance == null) + instance = new ThingTypeDefinitionJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeDefinitionJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeDefinitionJsonUnmarshaller.java new file mode 100644 index 00000000000..b03a953e8a5 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeDefinitionJsonUnmarshaller.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO ThingTypeDefinition + */ +class ThingTypeDefinitionJsonUnmarshaller implements + Unmarshaller { + + public ThingTypeDefinition unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + ThingTypeDefinition thingTypeDefinition = new ThingTypeDefinition(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("thingTypeName")) { + thingTypeDefinition.setThingTypeName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("thingTypeProperties")) { + thingTypeDefinition.setThingTypeProperties(ThingTypePropertiesJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else if (name.equals("thingTypeMetadata")) { + thingTypeDefinition.setThingTypeMetadata(ThingTypeMetadataJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return thingTypeDefinition; + } + + private static ThingTypeDefinitionJsonUnmarshaller instance; + + public static ThingTypeDefinitionJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ThingTypeDefinitionJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeMetadataJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeMetadataJsonMarshaller.java new file mode 100644 index 00000000000..5790d136d14 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeMetadataJsonMarshaller.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO ThingTypeMetadata + */ +class ThingTypeMetadataJsonMarshaller { + + public void marshall(ThingTypeMetadata thingTypeMetadata, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (thingTypeMetadata.getDeprecated() != null) { + Boolean deprecated = thingTypeMetadata.getDeprecated(); + jsonWriter.name("deprecated"); + jsonWriter.value(deprecated); + } + if (thingTypeMetadata.getDeprecationDate() != null) { + java.util.Date deprecationDate = thingTypeMetadata.getDeprecationDate(); + jsonWriter.name("deprecationDate"); + jsonWriter.value(deprecationDate); + } + if (thingTypeMetadata.getCreationDate() != null) { + java.util.Date creationDate = thingTypeMetadata.getCreationDate(); + jsonWriter.name("creationDate"); + jsonWriter.value(creationDate); + } + jsonWriter.endObject(); + } + + private static ThingTypeMetadataJsonMarshaller instance; + + public static ThingTypeMetadataJsonMarshaller getInstance() { + if (instance == null) + instance = new ThingTypeMetadataJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeMetadataJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeMetadataJsonUnmarshaller.java new file mode 100644 index 00000000000..8f9c5c79dee --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypeMetadataJsonUnmarshaller.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO ThingTypeMetadata + */ +class ThingTypeMetadataJsonUnmarshaller implements + Unmarshaller { + + public ThingTypeMetadata unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + ThingTypeMetadata thingTypeMetadata = new ThingTypeMetadata(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("deprecated")) { + thingTypeMetadata.setDeprecated(BooleanJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("deprecationDate")) { + thingTypeMetadata.setDeprecationDate(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("creationDate")) { + thingTypeMetadata.setCreationDate(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return thingTypeMetadata; + } + + private static ThingTypeMetadataJsonUnmarshaller instance; + + public static ThingTypeMetadataJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ThingTypeMetadataJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypePropertiesJsonMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypePropertiesJsonMarshaller.java new file mode 100644 index 00000000000..714094b3763 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypePropertiesJsonMarshaller.java @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO ThingTypeProperties + */ +class ThingTypePropertiesJsonMarshaller { + + public void marshall(ThingTypeProperties thingTypeProperties, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (thingTypeProperties.getThingTypeDescription() != null) { + String thingTypeDescription = thingTypeProperties.getThingTypeDescription(); + jsonWriter.name("thingTypeDescription"); + jsonWriter.value(thingTypeDescription); + } + if (thingTypeProperties.getSearchableAttributes() != null) { + java.util.List searchableAttributes = thingTypeProperties + .getSearchableAttributes(); + jsonWriter.name("searchableAttributes"); + jsonWriter.beginArray(); + for (String searchableAttributesItem : searchableAttributes) { + if (searchableAttributesItem != null) { + jsonWriter.value(searchableAttributesItem); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static ThingTypePropertiesJsonMarshaller instance; + + public static ThingTypePropertiesJsonMarshaller getInstance() { + if (instance == null) + instance = new ThingTypePropertiesJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypePropertiesJsonUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypePropertiesJsonUnmarshaller.java new file mode 100644 index 00000000000..0d776907a09 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/ThingTypePropertiesJsonUnmarshaller.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.services.iot.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO ThingTypeProperties + */ +class ThingTypePropertiesJsonUnmarshaller implements + Unmarshaller { + + public ThingTypeProperties unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + ThingTypeProperties thingTypeProperties = new ThingTypeProperties(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("thingTypeDescription")) { + thingTypeProperties.setThingTypeDescription(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("searchableAttributes")) { + thingTypeProperties.setSearchableAttributes(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return thingTypeProperties; + } + + private static ThingTypePropertiesJsonUnmarshaller instance; + + public static ThingTypePropertiesJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ThingTypePropertiesJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateCACertificateRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateCACertificateRequestMarshaller.java index a48f5344b05..1c448084d43 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateCACertificateRequestMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateCACertificateRequestMarshaller.java @@ -60,6 +60,10 @@ public Request marshall( request.addParameter("newStatus", StringUtils.fromString(updateCACertificateRequest.getNewStatus())); } + if (updateCACertificateRequest.getNewAutoRegistrationStatus() != null) { + request.addParameter("newAutoRegistrationStatus", StringUtils + .fromString(updateCACertificateRequest.getNewAutoRegistrationStatus())); + } request.setResourcePath(uriResourcePath); request.addHeader("Content-Length", "0"); request.setContent(new ByteArrayInputStream(new byte[0])); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateThingRequestMarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateThingRequestMarshaller.java index 93f8e3ee290..ad0b344d1d4 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateThingRequestMarshaller.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/UpdateThingRequestMarshaller.java @@ -61,11 +61,26 @@ public Request marshall(UpdateThingRequest updateThingReques AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); jsonWriter.beginObject(); + if (updateThingRequest.getThingTypeName() != null) { + String thingTypeName = updateThingRequest.getThingTypeName(); + jsonWriter.name("thingTypeName"); + jsonWriter.value(thingTypeName); + } if (updateThingRequest.getAttributePayload() != null) { AttributePayload attributePayload = updateThingRequest.getAttributePayload(); jsonWriter.name("attributePayload"); AttributePayloadJsonMarshaller.getInstance().marshall(attributePayload, jsonWriter); } + if (updateThingRequest.getExpectedVersion() != null) { + Long expectedVersion = updateThingRequest.getExpectedVersion(); + jsonWriter.name("expectedVersion"); + jsonWriter.value(expectedVersion); + } + if (updateThingRequest.getRemoveThingType() != null) { + Boolean removeThingType = updateThingRequest.getRemoveThingType(); + jsonWriter.name("removeThingType"); + jsonWriter.value(removeThingType); + } jsonWriter.endObject(); jsonWriter.close(); diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/VersionConflictExceptionUnmarshaller.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/VersionConflictExceptionUnmarshaller.java new file mode 100644 index 00000000000..d53b2b4e7d1 --- /dev/null +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/VersionConflictExceptionUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.iot.model.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.iot.model.VersionConflictException; + +public class VersionConflictExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public VersionConflictExceptionUnmarshaller() { + super(VersionConflictException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("VersionConflictException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + VersionConflictException e = (VersionConflictException) super.unmarshall(error); + e.setErrorCode("VersionConflictException"); + + return e; + } +} diff --git a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iotdata/AWSIotDataClient.java b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iotdata/AWSIotDataClient.java index 69281a0accb..b6d327ebba0 100644 --- a/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iotdata/AWSIotDataClient.java +++ b/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iotdata/AWSIotDataClient.java @@ -276,6 +276,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("data.iot.us-east-1.amazonaws.com"); + this.endpointPrefix = "data.iot"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-kinesis/pom.xml b/aws-android-sdk-kinesis/pom.xml index fd8a7fe5690..67df2574fc6 100644 --- a/aws-android-sdk-kinesis/pom.xml +++ b/aws-android-sdk-kinesis/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3
junit diff --git a/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisClient.java b/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisClient.java index 7fb019fb97b..2934057fe3a 100644 --- a/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisClient.java +++ b/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisClient.java @@ -271,6 +271,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("kinesis.us-east-1.amazonaws.com"); + this.endpointPrefix = "kinesis"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/AmazonKinesisFirehoseClient.java b/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/AmazonKinesisFirehoseClient.java index 27c5574a343..ed9297b6a94 100644 --- a/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/AmazonKinesisFirehoseClient.java +++ b/aws-android-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/AmazonKinesisFirehoseClient.java @@ -272,6 +272,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("firehose.us-east-1.amazonaws.com"); + this.endpointPrefix = "firehose"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-kms/pom.xml b/aws-android-sdk-kms/pom.xml index 557f9fdf2c5..3455bd0878c 100644 --- a/aws-android-sdk-kms/pom.xml +++ b/aws-android-sdk-kms/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3
diff --git a/aws-android-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSClient.java b/aws-android-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSClient.java index 6b7ebdef28f..9368dbe06b4 100644 --- a/aws-android-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSClient.java +++ b/aws-android-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSClient.java @@ -403,6 +403,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("kms.us-east-1.amazonaws.com"); + this.endpointPrefix = "kms"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-lambda/pom.xml b/aws-android-sdk-lambda/pom.xml index a1882c7e965..5cde161a934 100644 --- a/aws-android-sdk-lambda/pom.xml +++ b/aws-android-sdk-lambda/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java index 4f107b85b64..f63d8ed0521 100644 --- a/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java +++ b/aws-android-sdk-lambda/src/main/java/com/amazonaws/services/lambda/AWSLambdaClient.java @@ -288,6 +288,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("lambda.us-east-1.amazonaws.com"); + this.endpointPrefix = "lambda"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-lex/pom.xml b/aws-android-sdk-lex/pom.xml index ea87f132d6d..cc9081c3e6c 100644 --- a/aws-android-sdk-lex/pom.xml +++ b/aws-android-sdk-lex/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -33,7 +33,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 com.google.android diff --git a/aws-android-sdk-lex/src/main/java/com/amazonaws/services/lexrts/AmazonLexRuntimeClient.java b/aws-android-sdk-lex/src/main/java/com/amazonaws/services/lexrts/AmazonLexRuntimeClient.java index fbb75a5faff..e5282fc4f8a 100644 --- a/aws-android-sdk-lex/src/main/java/com/amazonaws/services/lexrts/AmazonLexRuntimeClient.java +++ b/aws-android-sdk-lex/src/main/java/com/amazonaws/services/lexrts/AmazonLexRuntimeClient.java @@ -292,6 +292,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("runtime.lex.us-east-1.amazonaws.com"); + this.endpointPrefix = "runtime.lex"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-logs/pom.xml b/aws-android-sdk-logs/pom.xml index e98a140dd8e..6608e08f3e5 100644 --- a/aws-android-sdk-logs/pom.xml +++ b/aws-android-sdk-logs/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-logs/src/main/java/com/amazonaws/services/logs/AmazonCloudWatchLogsClient.java b/aws-android-sdk-logs/src/main/java/com/amazonaws/services/logs/AmazonCloudWatchLogsClient.java index bc95d1440e6..a6baa31a325 100644 --- a/aws-android-sdk-logs/src/main/java/com/amazonaws/services/logs/AmazonCloudWatchLogsClient.java +++ b/aws-android-sdk-logs/src/main/java/com/amazonaws/services/logs/AmazonCloudWatchLogsClient.java @@ -315,6 +315,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://logs.us-east-1.amazonaws.com"); + this.endpointPrefix = "logs"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-machinelearning/pom.xml b/aws-android-sdk-machinelearning/pom.xml index f25abc3067c..cdf25cf022d 100644 --- a/aws-android-sdk-machinelearning/pom.xml +++ b/aws-android-sdk-machinelearning/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-machinelearning/src/main/java/com/amazonaws/services/machinelearning/AmazonMachineLearningClient.java b/aws-android-sdk-machinelearning/src/main/java/com/amazonaws/services/machinelearning/AmazonMachineLearningClient.java index fa9cce9c350..762b2328f49 100644 --- a/aws-android-sdk-machinelearning/src/main/java/com/amazonaws/services/machinelearning/AmazonMachineLearningClient.java +++ b/aws-android-sdk-machinelearning/src/main/java/com/amazonaws/services/machinelearning/AmazonMachineLearningClient.java @@ -269,6 +269,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("machinelearning.us-east-1.amazonaws.com"); + this.endpointPrefix = "machinelearning"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-mobileanalytics/pom.xml b/aws-android-sdk-mobileanalytics/pom.xml index d12c51ec681..c68c983b7d4 100644 --- a/aws-android-sdk-mobileanalytics/pom.xml +++ b/aws-android-sdk-mobileanalytics/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-mobileanalytics/src/main/java/com/amazonaws/services/mobileanalytics/AmazonMobileAnalyticsClient.java b/aws-android-sdk-mobileanalytics/src/main/java/com/amazonaws/services/mobileanalytics/AmazonMobileAnalyticsClient.java index 638ec0b415b..9a8cf4f5c66 100644 --- a/aws-android-sdk-mobileanalytics/src/main/java/com/amazonaws/services/mobileanalytics/AmazonMobileAnalyticsClient.java +++ b/aws-android-sdk-mobileanalytics/src/main/java/com/amazonaws/services/mobileanalytics/AmazonMobileAnalyticsClient.java @@ -268,6 +268,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("mobileanalytics.us-east-1.amazonaws.com"); + this.endpointPrefix = "mobileanalytics"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-pinpoint/pom.xml b/aws-android-sdk-pinpoint/pom.xml index 1d8fa2363d7..33bf1d0e9e4 100644 --- a/aws-android-sdk-pinpoint/pom.xml +++ b/aws-android-sdk-pinpoint/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/PinpointConfiguration.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/PinpointConfiguration.java index c04ac4ee59a..76658ca2168 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/PinpointConfiguration.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/PinpointConfiguration.java @@ -15,10 +15,12 @@ package com.amazonaws.mobileconnectors.pinpoint; +import android.content.Context; + import com.amazonaws.ClientConfiguration; import com.amazonaws.auth.AWSCredentialsProvider; +import com.amazonaws.mobileconnectors.pinpoint.targeting.notification.AppLevelOptOutProvider; import com.amazonaws.regions.Regions; -import android.content.Context; /** * The PinpointConfiguration class allows developers to configure the Pinpoint SDK. @@ -33,6 +35,7 @@ public class PinpointConfiguration { private ClientConfiguration clientConfiguration; private AWSCredentialsProvider credentialsProvider; private PinpointCallback initCompletionCallback; + private AppLevelOptOutProvider appLevelOptOutProvider; /** * Create an {@link PinpointConfiguration} object with the specified parameters. @@ -224,4 +227,27 @@ public PinpointConfiguration withInitCompletionCallback(final PinpointCallback

MAX_EVENT_TYPE_LENGTH) { log.error("The event type is too long, the max event type length is " + MAX_EVENT_TYPE_LENGTH - + " characters"); + + " characters."); throw new IllegalArgumentException("The eventType passed into create event was too long"); } @@ -163,7 +163,7 @@ protected AnalyticsEvent createEvent(String eventType, long sessionStart, */ public void recordEvent(AnalyticsEvent event) { if (event == null) { - log.info("The provided event was null"); + log.info("The provided event was null."); return; } final AnalyticsEvent recordEvent = AnalyticsEvent @@ -181,7 +181,7 @@ public void recordEvent(AnalyticsEvent event) { * for customizing which Internet connection the SDK can submit on. */ public void submitEvents() { - log.info("Submitting events"); + log.info("Submitting events."); eventRecorder.submitEvents(); } @@ -196,13 +196,12 @@ public void submitEvents() { public void addGlobalAttribute(String attributeName, String attributeValue) { if (attributeName == null) { - log.info("Null attribute name provided to addGlobalAttribute"); + log.info("Null attribute name provided to addGlobalAttribute."); return; } if (attributeValue == null) { - log.debug("Null attribute value provided to addGlobalAttribute. attribute name:" - + attributeName); + log.debug("Null attribute value provided to addGlobalAttribute."); return; } globalAttributes.put(attributeName, attributeValue); @@ -220,7 +219,7 @@ public void addGlobalAttribute(String attributeName, public void addGlobalAttribute(String eventType, String attributeName, String attributeValue) { if (eventType == null) { - log.warn("Null eventType provided to addGlobalAttribute"); + log.warn("Null eventType provided to addGlobalAttribute."); return; } @@ -232,8 +231,7 @@ public void addGlobalAttribute(String eventType, String attributeName, if (attributeValue == null) { log.warn("Null value provided to addGlobalAttribute. eventType:" + - eventType - + ", attributeName:" + attributeName); + eventType); return; } @@ -255,13 +253,12 @@ public void addGlobalAttribute(String eventType, String attributeName, */ public void addGlobalMetric(String metricName, Double metricValue) { if (metricName == null) { - log.warn("Null metric name provided to addGlobalMetric"); + log.warn("Null metric name provided to addGlobalMetric."); return; } if (metricValue == null) { - log.warn("Null metric value provided to addGlobalMetric. metric name:" + - metricName); + log.warn("Null metric value provided to addGlobalMetric."); return; } @@ -280,7 +277,7 @@ public void addGlobalMetric(String metricName, Double metricValue) { public void addGlobalMetric(String eventType, String metricName, Double metricValue) { if (eventType == null) { - log.warn("Null eventType provided to addGlobalMetric"); + log.warn("Null eventType provided to addGlobalMetric."); return; } @@ -292,8 +289,7 @@ public void addGlobalMetric(String eventType, String metricName, if (metricValue == null) { log.warn("Null metric value provided to addGlobalMetric. eventType:" + - eventType - + ", metric name:" + metricName); + eventType); return; } @@ -313,7 +309,7 @@ public void addGlobalMetric(String eventType, String metricName, */ public void removeGlobalAttribute(String attributeName) { if (attributeName == null) { - log.warn("Null attribute name provided to removeGlobalAttribute"); + log.warn("Null attribute name provided to removeGlobalAttribute."); return; } @@ -329,12 +325,12 @@ public void removeGlobalAttribute(String attributeName) { */ public void removeGlobalAttribute(String eventType, String attributeName) { if (eventType == null) { - log.warn("Null eventType provided to removeGlobalAttribute"); + log.warn("Null eventType provided to removeGlobalAttribute."); return; } if (attributeName == null) { - log.warn("Null attribute name provided to removeGlobalAttribute"); + log.warn("Null attribute name provided to removeGlobalAttribute."); return; } @@ -353,7 +349,7 @@ public void removeGlobalAttribute(String eventType, String attributeName) { */ public void removeGlobalMetric(String metricName) { if (metricName == null) { - log.warn("Null metric name provided to removeGlobalMetric"); + log.warn("Null metric name provided to removeGlobalMetric."); return; } @@ -369,12 +365,12 @@ public void removeGlobalMetric(String metricName) { */ public void removeGlobalMetric(String eventType, String metricName) { if (eventType == null) { - log.warn("Null eventType provided to removeGlobalMetric"); + log.warn("Null eventType provided to removeGlobalMetric."); return; } if (metricName == null) { - log.warn("Null metric name provided to removeGlobalMetric"); + log.warn("Null metric name provided to removeGlobalMetric."); return; } @@ -395,7 +391,7 @@ public void removeGlobalMetric(String eventType, String metricName) { */ public void setCampaignAttributes(Map campaign) { if (campaign == null) { - log.warn("Null campaign attributes provided to setCampaignAttributes"); + log.warn("Null campaign attributes provided to setCampaignAttributes."); return; } @@ -438,8 +434,8 @@ public JSONObject toJSONObject() { attr.put(entry.getKey(), entry.getValue()); globalAttrs.put(attr); } catch (final JSONException e) { - log.error("Error parsing Global Attributes: " + - e.toString()); + // Do not log e due to potentially sensitive information + log.error("Error parsing Global Attributes."); } } } @@ -452,7 +448,8 @@ public JSONObject toJSONObject() { attr.put(entry.getKey(), entry.getValue()); globalMets.put(attr); } catch (final JSONException e) { - log.error("Error parsing Global Metrics: " + e.toString()); + // Do not log e due to potentially sensitive information + log.error("Error parsing Global Metrics."); } } } @@ -473,8 +470,8 @@ public JSONObject toJSONObject() { eventTypesAttributesJson .put(entry.getKey(), eventTypeAttrs); } catch (final JSONException e) { - log.error("Error parsing Event Type Attributes: " + - e.toString()); + // Do not log e due to potentially sensitive information + log.error("Error parsing Event Type Attributes."); } } } @@ -493,8 +490,8 @@ public JSONObject toJSONObject() { } eventTypesMetricsJson.put(entry.getKey(), eventTypeMets); } catch (final JSONException e) { - log.error("Error parsing Event Type Metrics: " + - e.toString()); + // Do not log e due to potentially sensitive information + log.error("Error parsing Event Type Metrics."); } } } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/analytics/AnalyticsEvent.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/analytics/AnalyticsEvent.java index c4bd8792bd6..8b6c2216a59 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/analytics/AnalyticsEvent.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/analytics/AnalyticsEvent.java @@ -213,7 +213,7 @@ private static String processAttributeMetricKey(String key) { if (trimmedKey.length() < key.length()) { log.warn("The attribute key has been trimmed to a length of " + MAX_EVENT_ATTRIBUTE_METRIC_KEY_LENGTH + - " characters"); + " characters."); } return trimmedKey; } @@ -225,7 +225,7 @@ private static String processAttributeValue(String value) { if (trimmedValue.length() < value.length()) { log.warn("The attribute value has been trimmed to a length of " + MAX_EVENT_ATTRIBUTE_VALUE_LENGTH + - " characters"); + " characters."); } return trimmedValue; } @@ -312,8 +312,8 @@ public static AnalyticsEvent translateToEvent(JSONObject source) try { metrics.put(key, metricsJSON.getDouble(key)); } catch (final JSONException e) { - log.error("Failed to convert metric back to double from JSON value", - e); + // Do not log e due to potentially sensitive information + log.error("Failed to convert metric back to double from JSON value."); } } } @@ -360,9 +360,8 @@ public void addAttribute(String name, String value) { currentNumOfAttributesAndMetrics.incrementAndGet(); } else { log.warn("Max number of attributes/metrics reached(" - + MAX_NUM_OF_METRICS_AND_ATTRIBUTES + - "). The attribute key " + name + - " has been ignored."); + + MAX_NUM_OF_METRICS_AND_ATTRIBUTES + + ")."); } } else { attributes.remove(name); @@ -405,8 +404,7 @@ public void addMetric(String name, Double value) { } else { log.warn("Max number of attributes/metrics reached(" + MAX_NUM_OF_METRICS_AND_ATTRIBUTES + - "). The metric key " + name + - " has been ignored."); + ")."); } } else { metrics.remove(name); @@ -623,9 +621,8 @@ public JSONObject toJSONObject() { try { attributesJson.put(entry.getKey(), entry.getValue()); } catch (final JSONException e) { - log.error("error serializing attribite. key:'" + - entry.getKey() + "', value: " - + entry.getValue().toString(), e); + // Do not log e due to potentially sensitive information + log.error("Error serializing attribute for eventType: " + eventType); } } @@ -634,9 +631,8 @@ public JSONObject toJSONObject() { try { metricsJson.put(entry.getKey(), entry.getValue()); } catch (final JSONException e) { - log.error("error serializing metric. key:'" + entry.getKey() + - "', value: " - + entry.getValue().toString(), e); + // Do not log e due to potentially sensitive information + log.error("Error serializing metric for eventType: " + eventType); } } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/configuration/AndroidPreferencesConfiguration.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/configuration/AndroidPreferencesConfiguration.java index bbddb4b4f50..c35c6f5cab9 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/configuration/AndroidPreferencesConfiguration.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/configuration/AndroidPreferencesConfiguration.java @@ -58,7 +58,8 @@ public class AndroidPreferencesConfiguration { try { configJson = new JSONObject(configurationJsonString); } catch (final JSONException e) { - log.error("Could not create Json object of Config", e); + // Do not log e due to potential sensitive information. + log.error("Could not create Json object of Config."); } } } @@ -79,8 +80,8 @@ public Long getLong(String propertyName) { try { value = Long.decode(valueString); } catch (Exception ex) { - log.error(String.format("Could not get Long for propertyName: %s", - propertyName), ex); + // Do not log property due to potential sensitive information. + log.error("Could not get Long for property."); } } @@ -102,8 +103,8 @@ public Integer getInt(String propertyName) { try { value = Integer.decode(valueString); } catch (Exception ex) { - log.error(String.format("Could not get Integer for propertyName: %s", - propertyName), ex); + // Do not log property due to potential sensitive information. + log.error("Could not get Integer for property."); } } @@ -118,8 +119,8 @@ public Double getDouble(String propertyName) { try { value = Double.parseDouble(valueString); } catch (Exception ex) { - log.error(String.format("Could not get Double for propertyName: %s", - propertyName), ex); + // Do not log property due to potential sensitive information. + log.error("Could not get Double for property."); } } @@ -134,8 +135,8 @@ public Boolean getBoolean(String propertyName) { try { value = Boolean.parseBoolean(valueString); } catch (Exception ex) { - log.error(String.format("Could not get Boolean for propertyName: %s", - propertyName), ex); + // Do not log property due to potential sensitive information. + log.error("Could not get Boolean for property."); } } @@ -152,8 +153,8 @@ public Short getShort(String propertyName) { value = Short.decode(valueString); } } catch (Exception ex) { - log.error(String.format("Could not get Short for propertyName: %s", - propertyName), ex); + // Do not log property due to potential sensitive information. + log.error("Could not get Short for property."); } } @@ -208,7 +209,8 @@ private void updateMappings(JSONObject configJson) { String value = configJson.getString(key); newProperties.put(key, value); } catch (JSONException e) { - log.error("Could not update property mappings", e); + // Do not log property mappings due to potential sensitive information. + log.error("Could not update property mappings."); } } } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/idresolver/SharedPrefsUniqueIdService.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/idresolver/SharedPrefsUniqueIdService.java index 8517802a704..615dc41853f 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/idresolver/SharedPrefsUniqueIdService.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/core/idresolver/SharedPrefsUniqueIdService.java @@ -52,7 +52,7 @@ public SharedPrefsUniqueIdService(String appId, public String getUniqueId(PinpointContext context) { if (context == null || context.getSystem() == null || context.getSystem().getPreferences() == null) { - log.debug("Unable to generate unique id, pinpointContext has not been fully initialized"); + log.debug("Unable to generate unique id, pinpointContext has not been fully initialized."); return ""; } @@ -94,8 +94,8 @@ private void storeUniqueId(AndroidPreferences preferences, try { preferences.putString(UNIQUE_ID_KEY, uniqueId); } catch (Exception ex) { - log.error("There was an exception when trying to store the unique id into the Preferences", - ex); + // Do not log ex due to potentially sensitive information + log.error("There was an exception when trying to store the unique id into the Preferences."); } } } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/ClientContext.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/ClientContext.java index cb56b9c82f5..86e7a25a4d5 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/ClientContext.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/ClientContext.java @@ -93,7 +93,8 @@ public JSONObject toJSONObject() { clientContextJSON.put(CUSTOM_OBJECT_KEY, customObj); clientContextJSON.put(SERVICES_OBJECT_KEY, servicesObj); } catch (final JSONException e) { - log.error("Error creating clientContextJSON", e); + // Do not log clientContextJSON/exception due to potential sensitive information. + log.error("Error creating clientContextJSON."); return clientContextJSON; } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/EventRecorder.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/EventRecorder.java index 9d6fa67406f..c7951dec8bb 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/EventRecorder.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/internal/event/EventRecorder.java @@ -105,8 +105,12 @@ public void closeDB() { } public Uri recordEvent(AnalyticsEvent event) { - log.info(String.format("Event Recorded to database: %s", - event.toString())); + if (event != null) { + log.info(String.format("Event Recorded to database with EventType: %s", StringUtil + .clipString(event.getEventType(), + CLIPPED_EVENT_LENGTH, + true))); + } long maxPendingSize = pinpointContext.getConfiguration().optLong( KEY_MAX_PENDING_SIZE, DEFAULT_MAX_PENDING_SIZE); @@ -137,7 +141,7 @@ public Uri recordEvent(AnalyticsEvent event) { return uri; } else { - log.warn(String.format("Event: '%s' failed to record to local database", + log.warn(String.format("Event: '%s' failed to record to local database.", StringUtil .clipString(event.getEventType(), CLIPPED_EVENT_LENGTH, @@ -151,7 +155,7 @@ JSONObject translateFromCursor(Cursor cursor) { return new JSONObject(cursor.getString(EventTable.COLUMN_INDEX.JSON .getValue())); } catch (final JSONException e) { - log.error(String.format("Unable to format events")); + log.error(String.format("Unable to format events.")); } return null; } @@ -291,7 +295,7 @@ boolean submitEvents(final JSONArray eventArray) { try { pinpointContext.getAnalyticsServiceClient().putEvents(request); submitted = true; - log.info(String.format("Successful submission of %d events", + log.info(String.format("Successful submission of %d events.", eventArray.length())); return submitted; @@ -354,7 +358,8 @@ public PutEventsRequest createRecordEventsRequest(JSONArray events, eventJSON = events.getJSONObject(i); internalEvent = AnalyticsEvent.translateToEvent(eventJSON); } catch (final JSONException e) { - log.error("Stored event was invalid JSON", e); + // Do not log JSONException due to potentially sensitive information + log.error("Stored event was invalid JSON."); continue; } clientContext = internalEvent.createClientContext(networkType); @@ -367,10 +372,10 @@ public PutEventsRequest createRecordEventsRequest(JSONArray events, final Map customAttribute = new HashMap(); customAttribute.put("endpoint", endpoint); clientContext.setCustom(customAttribute); - log.info("Recorded profile to client pinpointContext: " + - clientContext.toJSONObject()); + // Do not log client context due to potentially sensitive information + log.info("Recorded profile to client pinpointContext."); } else { - log.error("Event Client is null"); + log.error("Event Client is null."); } final Event event = new Event(); @@ -413,7 +418,7 @@ public PutEventsRequest createRecordEventsRequest(JSONArray events, .toString() .getBytes())); } else { - log.error("ClientContext is null or event list is empty"); + log.error("ClientContext is null or event list is empty."); } return putRequest; } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/TargetingClient.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/TargetingClient.java index 3f74a62ab10..c4e14b51374 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/TargetingClient.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/TargetingClient.java @@ -244,14 +244,10 @@ private void executeUpdate(EndpointProfile endpointProfile) { @Override public void run() { try { - log.info(String.format("Updating EndpointProfile : %s", - updateEndpointRequest - .toString())); + log.info("Updating EndpointProfile."); context.getPinpointServiceClient() .updateEndpoint(updateEndpointRequest); - log.info(String.format("EndpointProfile updated successfully: %s", - updateEndpointRequest - .toString())); + log.info("EndpointProfile updated successfully."); } catch (final AmazonServiceException e) { log.error("AmazonServiceException occurred during endpoint update:", e); @@ -334,13 +330,12 @@ private Map loadMetrics() { public void addAttribute(final String attributeName, final java.util.List attributeValues) { if (attributeName == null) { - log.debug("Null attribute name provided to addGlobalAttribute"); + log.debug("Null attribute name provided to addGlobalAttribute."); return; } if (attributeValues == null) { - log.debug("Null attribute values provided to addGlobalAttribute. attribute name:" - + attributeName); + log.debug("Null attribute values provided to addGlobalAttribute."); return; } globalAttributes.put(attributeName, attributeValues); @@ -355,7 +350,7 @@ public void addAttribute(final String attributeName, */ public void removeAttribute(final String attributeName) { if (attributeName == null) { - log.warn("Null attribute name provided to removeGlobalAttribute"); + log.warn("Null attribute name provided to removeGlobalAttribute."); return; } this.endpointProfile.addAttribute(attributeName, null); @@ -373,13 +368,12 @@ public void removeAttribute(final String attributeName) { */ public void addMetric(String metricName, Double metricValue) { if (metricName == null) { - log.warn("Null metric name provided to addGlobalMetric"); + log.warn("Null metric name provided to addGlobalMetric."); return; } if (metricValue == null) { - log.warn("Null metric value provided to addGlobalMetric. metric name:" + - metricName); + log.warn("Null metric value provided to addGlobalMetric."); return; } @@ -394,7 +388,7 @@ public void addMetric(String metricName, Double metricValue) { */ public void removeMetric(String metricName) { if (metricName == null) { - log.warn("Null metric name provided to removeGlobalMetric"); + log.warn("Null metric name provided to removeGlobalMetric."); return; } this.endpointProfile.addMetric(metricName, null); diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/endpointProfile/EndpointProfile.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/endpointProfile/EndpointProfile.java index 8f2d7b2294a..c458b52123c 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/endpointProfile/EndpointProfile.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/endpointProfile/EndpointProfile.java @@ -66,7 +66,7 @@ public class EndpointProfile implements JSONSerializable { */ public EndpointProfile(final PinpointContext pinpointContext) { checkNotNull(pinpointContext, - "A valid pinpointContext must be provided"); + "A valid pinpointContext must be provided."); this.pinpointContext = pinpointContext; this.effectiveDate = DateUtil.getCorrectedDate().getTime(); @@ -84,7 +84,7 @@ private static String processAttributeMetricKey(String key) { if (trimmedKey.length() < key.length()) { log.warn("The attribute key has been trimmed to a length of " + MAX_ENDPOINT_ATTRIBUTE_METRIC_KEY_LENGTH + - " characters"); + " characters."); } return trimmedKey; @@ -101,12 +101,12 @@ private static java.util.List processAttributeValues(java.util.List= MAX_ENDPOINT_ATTRIBUTE_VALUES) { log.warn("The attribute values has been reduced to" - + MAX_ENDPOINT_ATTRIBUTE_VALUES + " values"); + + MAX_ENDPOINT_ATTRIBUTE_VALUES + " values."); break; } } @@ -243,8 +243,7 @@ public void addAttribute(String name, java.util.List values) { } else { log.warn("Max number of attributes/metrics reached(" + MAX_NUM_OF_METRICS_AND_ATTRIBUTES + - "). The attribute key " + name + - " has been ignored."); + ")."); } } else { attributes.remove(name); @@ -331,8 +330,7 @@ public void addMetric(String name, Double value) { } else { log.warn("Max number of attributes/metrics reached(" + MAX_NUM_OF_METRICS_AND_ATTRIBUTES + - "). The metric key " + name + - " has been ignored."); + ")."); } } else { metrics.remove(name); @@ -442,7 +440,8 @@ public JSONObject toJSONObject() { final JSONArray array = new JSONArray(entry.getValue()); attributesJson.put(entry.getKey(), array); } catch (final JSONException e) { - log.warn("json error", e); + // Do not log e due to potentially sensitive information + log.warn("Error serializing attributes."); } } @@ -457,9 +456,8 @@ public JSONObject toJSONObject() { try { metricsJson.put(entry.getKey(), entry.getValue()); } catch (final JSONException e) { - log.error("error serializing metric. key:'" + entry.getKey() + - "', value: " - + entry.getValue().toString(), e); + // Do not log e due to potentially sensitive information + log.error("Error serializing metric."); } } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/AppLevelOptOutProvider.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/AppLevelOptOutProvider.java new file mode 100644 index 00000000000..97fa04708aa --- /dev/null +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/AppLevelOptOutProvider.java @@ -0,0 +1,11 @@ +package com.amazonaws.mobileconnectors.pinpoint.targeting.notification; + +/** + * Interface providing an app-level opt-out value. This can be used to override the system-level opt out. + */ +public interface AppLevelOptOutProvider { + /** + * @return True if the app should not receive notifications, false otherwise. + */ + boolean isOptedOut(); +} diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClient.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClient.java index bad1167bb5d..98e3535caf9 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClient.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClient.java @@ -448,7 +448,7 @@ private Notification createNotification(final int iconResId, final String title, private PendingIntent createOpenAppPendingIntent(final Bundle pushBundle, final Class targetClass, String campaignId, int requestId, String intentAction) { PendingIntent contentIntent = null; - if (intentAction == GCM_INTENT_ACTION) { + if (intentAction.equals(GCM_INTENT_ACTION)) { contentIntent = PendingIntent.getService(pinpointContext.getApplicationContext(), requestId, this.notificationIntent(pushBundle, campaignId, requestId, GCM_INTENT_ACTION, targetClass), @@ -726,9 +726,10 @@ private CampaignPushResult handleCampaignPush(final String from, } /** - * On devices using Android API level 19 and above this method properly - * returns whether local notifications are enabled for the app. For devices - * before API level 19, this method always returns true. Disabling + * If app-level opt-out is enabled, this method always returns false. Otherwise, + * the following logic applies: On devices using Android API level 19 and above, + * this method properly returns whether local notifications are enabled for the app. + * For devices before API level 19, this method always returns true. Disabling * notifications was a feature added on devices supporting API Level 16 and * above, so devices from API level 16 to 18 will return true from this * method even when local notifications have been disabled for the app. @@ -737,6 +738,15 @@ private CampaignPushResult handleCampaignPush(final String from, * false. */ public boolean areAppNotificationsEnabled() { + final AppLevelOptOutProvider provider = pinpointContext.getPinpointConfiguration().getAppLevelOptOutProvider(); + if (provider != null && provider.isOptedOut()) { + return false; + } + + return areAppNotificationsEnabledOnPlatform(); + } + + boolean areAppNotificationsEnabledOnPlatform() { if (android.os.Build.VERSION.SDK_INT < ANDROID_KITKAT) { return true; } diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/AmazonPinpointClient.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/AmazonPinpointClient.java index bee787c41fd..110a253168e 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/AmazonPinpointClient.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/AmazonPinpointClient.java @@ -264,6 +264,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("pinpoint.us-east-1.amazonaws.com"); + this.endpointPrefix = "pinpoint"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpointanalytics/AmazonPinpointAnalyticsClient.java b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpointanalytics/AmazonPinpointAnalyticsClient.java index dcde8037912..66c45d8bf84 100644 --- a/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpointanalytics/AmazonPinpointAnalyticsClient.java +++ b/aws-android-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpointanalytics/AmazonPinpointAnalyticsClient.java @@ -266,6 +266,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("mobileanalytics.us-east-1.amazonaws.com"); + this.endpointPrefix = "mobileanalytics"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-pinpoint/src/test/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClientTest.java b/aws-android-sdk-pinpoint/src/test/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClientTest.java index 71978309d35..737e81fd7bf 100644 --- a/aws-android-sdk-pinpoint/src/test/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClientTest.java +++ b/aws-android-sdk-pinpoint/src/test/java/com/amazonaws/mobileconnectors/pinpoint/targeting/notification/NotificationClientTest.java @@ -38,6 +38,8 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; @RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) @@ -154,4 +156,30 @@ public void testEmptyBundle() { assertEquals(NotificationClient.CampaignPushResult.NOT_HANDLED, result); } + @Test + public void testAreAppNotificationsEnabled_returnsFalse_whenOptOutProviderReturnsTrue() { + mockAppLevelOptOutProvider(true); + assertEquals(false, target.areAppNotificationsEnabled()); + } + + @Test + public void testAreAppNotificationsEnabled_callsPlatformMethod_whenOptOutProviderReturnsFalse() { + mockAppLevelOptOutProvider(false); + + final NotificationClient notificationClient = spy(target); + notificationClient.areAppNotificationsEnabled(); + + verify(notificationClient).areAppNotificationsEnabledOnPlatform(); + } + + private void mockAppLevelOptOutProvider(final boolean returnValue) { + when(mockPinpointConfiguration.getAppLevelOptOutProvider()).thenReturn( + new AppLevelOptOutProvider() { + public boolean isOptedOut() { + return returnValue; + } + } + ); + } + } diff --git a/aws-android-sdk-polly/pom.xml b/aws-android-sdk-polly/pom.xml index 40259400c70..6efefce3f07 100644 --- a/aws-android-sdk-polly/pom.xml +++ b/aws-android-sdk-polly/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/AmazonPollyClient.java b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/AmazonPollyClient.java index 8a86757990c..6c4804b9874 100644 --- a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/AmazonPollyClient.java +++ b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/AmazonPollyClient.java @@ -281,6 +281,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("https://polly.us-east-1.amazonaws.com"); + this.endpointPrefix = "polly"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechPresignRequest.java b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechPresignRequest.java index a8dd3b8e64a..acfd599481e 100644 --- a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechPresignRequest.java +++ b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechPresignRequest.java @@ -122,7 +122,7 @@ public class SynthesizeSpeechPresignRequest implements Serializable { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki */ private String voiceId; @@ -778,7 +778,7 @@ public SynthesizeSpeechPresignRequest withTextType(TextType textType) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @return

* Voice ID to use for the synthesis. You can get a list of @@ -806,7 +806,7 @@ public String getVoiceId() { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of @@ -837,7 +837,7 @@ public void setVoiceId(String voiceId) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Liv, Lotte, Ruben, Ewa, * Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of @@ -868,7 +868,7 @@ public SynthesizeSpeechPresignRequest withVoiceId(String voiceId) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of @@ -899,7 +899,7 @@ public void setVoiceId(VoiceId voiceId) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Liv, Lotte, Ruben, Ewa, * Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of diff --git a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechRequest.java b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechRequest.java index 03b6faee4b6..8d413850e84 100644 --- a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechRequest.java +++ b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/SynthesizeSpeechRequest.java @@ -111,7 +111,7 @@ public class SynthesizeSpeechRequest extends AmazonWebServiceRequest implements * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki */ private String voiceId; @@ -716,7 +716,7 @@ public SynthesizeSpeechRequest withTextType(TextType textType) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @return

* Voice ID to use for the synthesis. You can get a list of @@ -744,7 +744,7 @@ public String getVoiceId() { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of @@ -775,7 +775,7 @@ public void setVoiceId(String voiceId) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of @@ -806,7 +806,7 @@ public SynthesizeSpeechRequest withVoiceId(String voiceId) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of @@ -837,7 +837,7 @@ public void setVoiceId(VoiceId voiceId) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param voiceId

* Voice ID to use for the synthesis. You can get a list of diff --git a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/Voice.java b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/Voice.java index 13f039856df..5a1e583bcbb 100644 --- a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/Voice.java +++ b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/Voice.java @@ -45,7 +45,7 @@ public class Voice implements Serializable { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki */ private String id; @@ -185,7 +185,7 @@ public Voice withGender(Gender gender) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @return

* Amazon Polly assigned voice ID. This is the ID that you specify @@ -209,7 +209,7 @@ public String getId() { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param id

* Amazon Polly assigned voice ID. This is the ID that you @@ -237,7 +237,7 @@ public void setId(String id) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param id

* Amazon Polly assigned voice ID. This is the ID that you @@ -265,7 +265,7 @@ public Voice withId(String id) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param id

* Amazon Polly assigned voice ID. This is the ID that you @@ -293,7 +293,7 @@ public void setId(VoiceId id) { * Kendra, Kimberly, Salli, Conchita, Enrique, Miguel, Penelope, Chantal, * Celine, Mathieu, Dora, Karl, Carla, Giorgio, Mizuki, Liv, Lotte, Ruben, * Ewa, Jacek, Jan, Maja, Ricardo, Vitoria, Cristiano, Ines, Carmen, Maxim, - * Tatyana, Astrid, Filiz + * Tatyana, Astrid, Filiz, Vicki * * @param id

* Amazon Polly assigned voice ID. This is the ID that you diff --git a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/VoiceId.java b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/VoiceId.java index a5ec6c4f4d3..1b9cc523b8d 100644 --- a/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/VoiceId.java +++ b/aws-android-sdk-polly/src/main/java/com/amazonaws/services/polly/model/VoiceId.java @@ -69,7 +69,8 @@ public enum VoiceId { Maxim("Maxim"), Tatyana("Tatyana"), Astrid("Astrid"), - Filiz("Filiz"); + Filiz("Filiz"), + Vicki("Vicki"); private String value; @@ -132,6 +133,7 @@ public String toString() { enumMap.put("Tatyana", Tatyana); enumMap.put("Astrid", Astrid); enumMap.put("Filiz", Filiz); + enumMap.put("Vicki", Vicki); } /** diff --git a/aws-android-sdk-rekognition/pom.xml b/aws-android-sdk-rekognition/pom.xml index f358ae582eb..c6976bd2d92 100644 --- a/aws-android-sdk-rekognition/pom.xml +++ b/aws-android-sdk-rekognition/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java index 33b92ccaed7..0693c7b9e31 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java @@ -273,6 +273,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("rekognition.us-east-1.amazonaws.com"); + this.endpointPrefix = "rekognition"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-s3/pom.xml b/aws-android-sdk-s3/pom.xml index b9c9c72721f..68486cb4b86 100644 --- a/aws-android-sdk-s3/pom.xml +++ b/aws-android-sdk-s3/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,13 +20,13 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 com.amazonaws aws-android-sdk-kms false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/DownloadTask.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/DownloadTask.java index 51fd2b801b4..af2cecf7625 100644 --- a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/DownloadTask.java +++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/DownloadTask.java @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.SocketTimeoutException; import java.util.concurrent.Callable; /** @@ -114,7 +115,8 @@ public Boolean call() throws Exception { * set by caller who interrupted */ LOGGER.debug("Transfer " + download.id + " is interrupted by user"); - } else if (e.getCause() != null && e.getCause() instanceof IOException + } else if (e.getCause() != null && + (e.getCause() instanceof IOException || e.getCause() instanceof AmazonClientException) && !networkInfo.isNetworkConnected()) { LOGGER.debug("Transfer " + download.id + " waits for network"); updater.updateState(download.id, TransferState.WAITING_FOR_NETWORK); @@ -149,6 +151,11 @@ private void saveToFile(InputStream is, File file) { while ((bytesRead = is.read(buffer)) != -1) { os.write(buffer, 0, bytesRead); } + } catch (final SocketTimeoutException socketTimeoutException) { + String errorString = "SocketTimeoutException: Unable to retrieve contents over network: " + + socketTimeoutException.getMessage(); + LOGGER.error(errorString); + throw new AmazonClientException(errorString, socketTimeoutException); } catch (final IOException e) { throw new AmazonClientException( "Unable to store object contents to disk: " + e.getMessage(), e); diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferDBUtil.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferDBUtil.java index cc51a26fa1d..daad599276f 100644 --- a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferDBUtil.java +++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferDBUtil.java @@ -546,6 +546,35 @@ public List getNonCompletedPartRequestsFromDB(int mainUploadI return list; } + /** + * Queries waiting for network partUpload tasks of a multipart upload and returns + * true if one such partUpload tasks + * + * @param mainUploadId The mainUploadId of a multipart upload task + * @return If a partUpload task waiting for network exist + */ + public boolean checkWaitingForNetworkPartRequestsFromDB(int mainUploadId) { + boolean isNetworkInterrupted = false; + Cursor c = null; + + try { + c = transferDBBase.query(getPartUri(mainUploadId), null, TransferTable.COLUMN_STATE + "=?", + new String[] { + TransferState.WAITING_FOR_NETWORK.toString() + }, null); + while (c.moveToNext()) { + isNetworkInterrupted = true; + break; + } + } finally { + if (c != null) { + c.close(); + } + } + + return isNetworkInterrupted; + } + /** * Generates a ContentValues object to insert into the database with the * given values for a multipart upload record. diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferService.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferService.java index 624c29e54dc..82697f44323 100644 --- a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferService.java +++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/TransferService.java @@ -311,7 +311,9 @@ void execCommand(Intent intent) { LOGGER.error("Can't find transfer: " + id); } } - transfer.start(s3, dbUtil, updater, networkInfoReceiver); + if (transfer != null) { + transfer.start(s3, dbUtil, updater, networkInfoReceiver); + } } else if (INTENT_ACTION_TRANSFER_CANCEL.equals(action)) { TransferRecord transfer = updater.getTransfer(id); if (transfer == null) { diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadPartTask.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadPartTask.java index 6ea358f2e7c..8d313df5858 100644 --- a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadPartTask.java +++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadPartTask.java @@ -16,6 +16,7 @@ package com.amazonaws.mobileconnectors.s3.transferutility; +import com.amazonaws.mobileconnectors.s3.transferutility.TransferService.NetworkInfoReceiver; import com.amazonaws.retry.RetryUtils; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.model.UploadPartRequest; @@ -33,11 +34,25 @@ class UploadPartTask implements Callable { private final UploadPartRequest request; private final AmazonS3 s3; private final TransferDBUtil dbUtil; + private final NetworkInfoReceiver networkInfoReceiver; - public UploadPartTask(UploadPartRequest request, AmazonS3 s3, TransferDBUtil dbUtil) { + public UploadPartTask(UploadPartRequest request, + AmazonS3 s3, + TransferDBUtil dbUtil) { this.request = request; this.s3 = s3; this.dbUtil = dbUtil; + this.networkInfoReceiver = null; + } + + public UploadPartTask(UploadPartRequest request, + AmazonS3 s3, + TransferDBUtil dbUtil, + NetworkInfoReceiver networkInfoReceiver) { + this.request = request; + this.s3 = s3; + this.dbUtil = dbUtil; + this.networkInfoReceiver = networkInfoReceiver; } /* @@ -51,12 +66,23 @@ public Boolean call() throws Exception { dbUtil.updateETag(request.getId(), putPartResult.getETag()); return true; } catch (final Exception e) { - dbUtil.updateState(request.getId(), TransferState.FAILED); if (RetryUtils.isInterrupted(e)) { // thread interrupted by user return false; } - LOGGER.error("Encountered error uploading part ", e); + if (networkInfoReceiver != null + && !networkInfoReceiver.isNetworkConnected()) { + /* + * Network connection is being interrupted. Moving the TransferState + * to WAITING_FOR_NETWORK till the network availability resumes. + */ + dbUtil.updateState(request.getId(), TransferState.WAITING_FOR_NETWORK); + LOGGER.debug("Network Connection Interrupted: " + + "Moving the TransferState to WAITING_FOR_NETWORK"); + } else { + dbUtil.updateState(request.getId(), TransferState.FAILED); + LOGGER.error("Encountered error uploading part ", e); + } throw e; } } diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadTask.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadTask.java index a18054fcf14..676bb2052db 100644 --- a/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadTask.java +++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/mobileconnectors/s3/transferutility/UploadTask.java @@ -129,7 +129,7 @@ private Boolean uploadMultipartAndWaitForCompletion() throws ExecutionException for (final UploadPartRequest request : requestList) { TransferUtility.appendMultipartTransferServiceUserAgentString(request); request.setGeneralProgressListener(updater.newProgressListener(upload.id)); - futures.add(TransferThreadPool.submitTask(new UploadPartTask(request, s3, dbUtil))); + futures.add(TransferThreadPool.submitTask(new UploadPartTask(request, s3, dbUtil, networkInfo))); } try { boolean isSuccess = true; @@ -159,7 +159,15 @@ private Boolean uploadMultipartAndWaitForCompletion() throws ExecutionException return false; } catch (final ExecutionException ee) { // handle pause, cancel, etc + boolean isNetworkInterrupted = false; if (ee.getCause() != null && ee.getCause() instanceof Exception) { + // check for network interruption and pause the transfer instead of failing them + isNetworkInterrupted = dbUtil.checkWaitingForNetworkPartRequestsFromDB(upload.id); + if (isNetworkInterrupted) { + LOGGER.debug("Network Connection Interrupted: Transfer " + upload.id + " waits for network"); + updater.updateState(upload.id, TransferState.WAITING_FOR_NETWORK); + return false; + } final Exception e = (Exception) ee.getCause(); if (RetryUtils.isInterrupted(e)) { /* @@ -215,6 +223,12 @@ private Boolean uploadSinglePartAndWaitForCompletion() { */ LOGGER.debug("Transfer " + upload.id + " is interrupted by user"); return false; + } else if (e.getCause() != null && e.getCause() instanceof AmazonClientException + && !networkInfo.isNetworkConnected()) { + // check for network interruption and pause the transfer instead of failing them + LOGGER.debug("Network Connection Interrupted: Transfer " + upload.id + " waits for network"); + updater.updateState(upload.id, TransferState.WAITING_FOR_NETWORK); + return false; } else if (e.getCause() != null && e.getCause() instanceof IOException && !networkInfo.isNetworkConnected()) { LOGGER.debug("Transfer " + upload.id + " waits for network"); diff --git a/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java b/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java index 892a222a44b..fd1efd0ea7c 100644 --- a/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java +++ b/aws-android-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java @@ -423,6 +423,7 @@ public AmazonS3Client(ClientConfiguration clientConfiguration) { private void init() { // calling this.setEndpoint(...) will also modify the signer accordingly setEndpoint(Constants.S3_HOSTNAME); + this.endpointPrefix = "s3"; final HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-sdb/pom.xml b/aws-android-sdk-sdb/pom.xml index bba79f802da..79e5618e879 100644 --- a/aws-android-sdk-sdb/pom.xml +++ b/aws-android-sdk-sdb/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 junit diff --git a/aws-android-sdk-ses/pom.xml b/aws-android-sdk-ses/pom.xml index be8d0fbb132..c012be5be87 100644 --- a/aws-android-sdk-ses/pom.xml +++ b/aws-android-sdk-ses/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/AmazonSimpleEmailServiceClient.java b/aws-android-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/AmazonSimpleEmailServiceClient.java index cbd5890bb49..a16af92befb 100644 --- a/aws-android-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/AmazonSimpleEmailServiceClient.java +++ b/aws-android-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/AmazonSimpleEmailServiceClient.java @@ -289,6 +289,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("email.us-east-1.amazonaws.com"); + this.endpointPrefix = "email"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-sns/pom.xml b/aws-android-sdk-sns/pom.xml index 7404873f1d5..48f9f1287a6 100644 --- a/aws-android-sdk-sns/pom.xml +++ b/aws-android-sdk-sns/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,13 +20,13 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 com.amazonaws aws-android-sdk-sqs false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-sns/src/main/java/com/amazonaws/services/sns/AmazonSNSClient.java b/aws-android-sdk-sns/src/main/java/com/amazonaws/services/sns/AmazonSNSClient.java index 5aa04f87c69..711ee4d0a49 100644 --- a/aws-android-sdk-sns/src/main/java/com/amazonaws/services/sns/AmazonSNSClient.java +++ b/aws-android-sdk-sns/src/main/java/com/amazonaws/services/sns/AmazonSNSClient.java @@ -290,6 +290,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sns.us-east-1.amazonaws.com"); + this.endpointPrefix = "sns"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/aws-android-sdk-sqs/pom.xml b/aws-android-sdk-sqs/pom.xml index ca99e684cc1..0864377ae36 100644 --- a/aws-android-sdk-sqs/pom.xml +++ b/aws-android-sdk-sqs/pom.xml @@ -12,7 +12,7 @@ com.amazonaws aws-android-sdk-pom - 2.4.2 + 2.4.3 @@ -20,7 +20,7 @@ com.amazonaws aws-android-sdk-core false - 2.4.2 + 2.4.3 diff --git a/aws-android-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AmazonSQSClient.java b/aws-android-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AmazonSQSClient.java index 5845b3e4c14..300ede28952 100644 --- a/aws-android-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AmazonSQSClient.java +++ b/aws-android-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AmazonSQSClient.java @@ -369,6 +369,7 @@ private void init() { // calling this.setEndPoint(...) will also modify the signer accordingly this.setEndpoint("sqs.us-east-1.amazonaws.com"); + this.endpointPrefix = "sqs"; HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain( diff --git a/pom.xml b/pom.xml index cb8bc8a54fb..a9ccc721fea 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ aws-android-sdk-pom pom AWS SDK for Android - 2.4.2 + 2.4.3 The Amazon Web Services SDK for Android provides Android APIs for building software on AWS’ cost-effective, scalable, and reliable infrastructure products. The AWS SDK for Android allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Auto Scaling, etc). http://aws.amazon.com/sdkforandroid