├── .github
└── PULL_REQUEST_TEMPLATE.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── NOTICE.txt
├── README.md
├── pom.xml
└── src
└── main
├── java
└── com
│ └── amazonaws
│ ├── mobileconnectors
│ └── cognito
│ │ ├── CognitoSyncManager.java
│ │ ├── Dataset.java
│ │ ├── DatasetMetadata.java
│ │ ├── DefaultDataset.java
│ │ ├── DefaultSyncCallback.java
│ │ ├── PushSyncUpdate.java
│ │ ├── Record.java
│ │ ├── SyncConflict.java
│ │ ├── exceptions
│ │ ├── DataAccessNotAuthorizedException.java
│ │ ├── DataConflictException.java
│ │ ├── DataLimitExceededException.java
│ │ ├── DataStorageException.java
│ │ ├── DatasetNotFoundException.java
│ │ ├── NetworkException.java
│ │ ├── RegistrationFailedException.java
│ │ ├── SubscribeFailedException.java
│ │ ├── UnsubscribeFailedException.java
│ │ └── package-info.java
│ │ ├── internal
│ │ ├── storage
│ │ │ ├── CognitoSyncStorage.java
│ │ │ ├── LocalStorage.java
│ │ │ ├── RemoteDataStorage.java
│ │ │ └── SQLiteLocalStorage.java
│ │ └── util
│ │ │ ├── DatasetUtils.java
│ │ │ └── StringUtils.java
│ │ └── package-info.java
│ └── services
│ └── cognitosync
│ ├── AmazonCognitoSync.java
│ ├── AmazonCognitoSyncClient.java
│ ├── model
│ ├── BulkPublishStatus.java
│ ├── Dataset.java
│ ├── DeleteDatasetRequest.java
│ ├── DeleteDatasetResult.java
│ ├── DescribeDatasetRequest.java
│ ├── DescribeDatasetResult.java
│ ├── InternalErrorException.java
│ ├── InvalidConfigurationException.java
│ ├── InvalidLambdaFunctionOutputException.java
│ ├── InvalidParameterException.java
│ ├── LambdaThrottledException.java
│ ├── LimitExceededException.java
│ ├── ListDatasetsRequest.java
│ ├── ListDatasetsResult.java
│ ├── ListRecordsRequest.java
│ ├── ListRecordsResult.java
│ ├── NotAuthorizedException.java
│ ├── Operation.java
│ ├── Platform.java
│ ├── Record.java
│ ├── RecordPatch.java
│ ├── RegisterDeviceRequest.java
│ ├── RegisterDeviceResult.java
│ ├── ResourceConflictException.java
│ ├── ResourceNotFoundException.java
│ ├── StreamingStatus.java
│ ├── SubscribeToDatasetRequest.java
│ ├── SubscribeToDatasetResult.java
│ ├── TooManyRequestsException.java
│ ├── UnsubscribeFromDatasetRequest.java
│ ├── UnsubscribeFromDatasetResult.java
│ ├── UpdateRecordsRequest.java
│ ├── UpdateRecordsResult.java
│ ├── package-info.java
│ └── transform
│ │ ├── DatasetJsonUnmarshaller.java
│ │ ├── DeleteDatasetRequestMarshaller.java
│ │ ├── DeleteDatasetResultJsonUnmarshaller.java
│ │ ├── DescribeDatasetRequestMarshaller.java
│ │ ├── DescribeDatasetResultJsonUnmarshaller.java
│ │ ├── InternalErrorExceptionUnmarshaller.java
│ │ ├── InvalidConfigurationExceptionUnmarshaller.java
│ │ ├── InvalidLambdaFunctionOutputExceptionUnmarshaller.java
│ │ ├── InvalidParameterExceptionUnmarshaller.java
│ │ ├── LambdaThrottledExceptionUnmarshaller.java
│ │ ├── LimitExceededExceptionUnmarshaller.java
│ │ ├── ListDatasetsRequestMarshaller.java
│ │ ├── ListDatasetsResultJsonUnmarshaller.java
│ │ ├── ListRecordsRequestMarshaller.java
│ │ ├── ListRecordsResultJsonUnmarshaller.java
│ │ ├── NotAuthorizedExceptionUnmarshaller.java
│ │ ├── RecordJsonUnmarshaller.java
│ │ ├── RegisterDeviceRequestMarshaller.java
│ │ ├── RegisterDeviceResultJsonUnmarshaller.java
│ │ ├── ResourceConflictExceptionUnmarshaller.java
│ │ ├── ResourceNotFoundExceptionUnmarshaller.java
│ │ ├── SubscribeToDatasetRequestMarshaller.java
│ │ ├── SubscribeToDatasetResultJsonUnmarshaller.java
│ │ ├── TooManyRequestsExceptionUnmarshaller.java
│ │ ├── UnsubscribeFromDatasetRequestMarshaller.java
│ │ ├── UnsubscribeFromDatasetResultJsonUnmarshaller.java
│ │ ├── UpdateRecordsRequestMarshaller.java
│ │ ├── UpdateRecordsResultJsonUnmarshaller.java
│ │ └── package-info.java
│ └── package-info.java
└── resources
└── fabric
└── com.amazonaws.aws-android-sdk-cognito.properties
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | *Issue #, if available:*
2 |
3 | *Description of changes:*
4 |
5 |
6 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
7 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ## Code of Conduct
2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4 | opensource-codeofconduct@amazon.com with any additional questions or comments.
5 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing Guidelines
2 |
3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4 | documentation, we greatly value feedback and contributions from our community.
5 |
6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7 | information to effectively respond to your bug report or contribution.
8 |
9 |
10 | ## Reporting Bugs/Feature Requests
11 |
12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13 |
14 | When filing an issue, please check [existing open](https://github.com/aws/amazon-cognito-android/issues), or [recently closed](https://github.com/aws/amazon-cognito-android/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16 |
17 | * A reproducible test case or series of steps
18 | * The version of our code being used
19 | * Any modifications you've made relevant to the bug
20 | * Anything unusual about your environment or deployment
21 |
22 |
23 | ## Contributing via Pull Requests
24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25 |
26 | 1. You are working against the latest source on the *master* branch.
27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29 |
30 | To send us a pull request, please:
31 |
32 | 1. Fork the repository.
33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34 | 3. Ensure local tests pass.
35 | 4. Commit to your fork using clear commit messages.
36 | 5. Send us a pull request, answering any default questions in the pull request interface.
37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38 |
39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41 |
42 |
43 | ## Finding contributions to work on
44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws/amazon-cognito-android/labels/help%20wanted) issues is a great place to start.
45 |
46 |
47 | ## Code of Conduct
48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50 | opensource-codeofconduct@amazon.com with any additional questions or comments.
51 |
52 |
53 | ## Security issue notifications
54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
55 |
56 |
57 | ## Licensing
58 |
59 | See the [LICENSE](https://github.com/aws/amazon-cognito-android/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
60 |
61 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
62 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Amazon Software License
2 | This Amazon Software License (“License”) governs your use, reproduction, and distribution of the accompanying software as specified below.
3 | 1. Definitions
4 | “Licensor” means any person or entity that distributes its Work.
5 |
6 | “Software” means the original work of authorship made available under this License.
7 |
8 | “Work” means the Software and any additions to or derivative works of the Software that are made available under this License.
9 |
10 | The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the meaning as provided under U.S. copyright law; provided, however, that for the purposes of this License, derivative works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work.
11 |
12 | Works, including the Software, are “made available” under this License by including in or with the Work either (a) a copyright notice referencing the applicability of this License to the Work, or (b) a copy of this License.
13 | 2. License Grants
14 | 2.1 Copyright Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free, copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense and distribute its Work and any resulting derivative works in any form.
15 | 2.2 Patent Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free patent license to make, have made, use, sell, offer for sale, import, and otherwise transfer its Work, in whole or in part. The foregoing license applies only to the patent claims licensable by Licensor that would be infringed by Licensor’s Work (or portion thereof) individually and excluding any combinations with any other materials or technology.
16 | 3. Limitations
17 | 3.1 Redistribution. You may reproduce or distribute the Work only if (a) you do so under this License, (b) you include a complete copy of this License with your distribution, and (c) you retain without modification any copyright, patent, trademark, or attribution notices that are present in the Work.
18 | 3.2 Derivative Works. You may specify that additional or different terms apply to the use, reproduction, and distribution of your derivative works of the Work (“Your Terms”) only if (a) Your Terms provide that the use limitation in Section 3.3 applies to your derivative works, and (b) you identify the specific derivative works that are subject to Your Terms. Notwithstanding Your Terms, this License (including the redistribution requirements in Section 3.1) will continue to apply to the Work itself.
19 | 3.3 Use Limitation. The Work and any derivative works thereof only may be used or intended for use with the web services, computing platforms or applications provided by Amazon.com, Inc. or its affiliates, including Amazon Web Services, Inc.
20 | 3.4 Patent Claims. If you bring or threaten to bring a patent claim against any Licensor (including any claim, cross-claim or counterclaim in a lawsuit) to enforce any patents that you allege are infringed by any Work, then your rights under this License from such Licensor (including the grants in Sections 2.1 and 2.2) will terminate immediately.
21 | 3.5 Trademarks. This License does not grant any rights to use any Licensor’s or its affiliates’ names, logos, or trademarks, except as necessary to reproduce the notices described in this License.
22 | 3.6 Termination. If you violate any term of this License, then your rights under this License (including the grants in Sections 2.1 and 2.2) will terminate immediately.
23 | 4. Disclaimer of Warranty.
24 | THE WORK IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF M ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER THIS LICENSE. SOME STATES’ CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.
25 | 5. Limitation of Liability.
26 | EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER COMM ERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
27 | Effective Date – April 18, 2008 © 2008 Amazon.com, Inc. or its affiliates. All rights reserved.
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/amazon-cognito-android/f44f76c2039755068b41a499a22d4c3a4a017946/NOTICE.txt
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [MOVED] AWS SDK for Android (Amazon Cognito)
2 |
3 | **This repository has been merged into [AWS SDK for Android](https://github.com/aws/aws-sdk-android). All the code is moved under [aws-sdk-android/aws-android-sdk-cognito](https://github.com/aws/aws-sdk-android/tree/master/aws-android-sdk-cognito). Amazon Cognito Sync will continue to be developed and maintained in the master repo. Any future issues regarding Amazon Cognito should be posted at [aws-sdk-android/issues](https://github.com/aws/aws-sdk-android/issues). This repo will be inactive and is pending removal if necessary.**
4 |
5 | [Amazon Cognito](http://aws.amazon.com/cognito/) is a simple user identity and synchronization service that helps you securely manage and synchronize app data for your users across their mobile devices. With Amazon Cognito, you can save any kind of data, such as app preferences or game state, in the AWS Cloud without writing any backend code or managing any infrastructure.
6 |
7 | ## To learn more about Android Development
8 |
9 | For more information on Andorid development, see the Android developer site at: [developer.android.com](http://developer.android.com/index.html)
10 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
31 | * // open or create dataset 32 | * Dataset dataset = cognitoClient.openOrCreate("new dataset"); 33 | * // synchronize. It pulls down latest changes from remote storage 34 | * // and push local changes to remote storage 35 | * dataset.synchronize(syncCallback); 36 | * // reads value 37 | * String highScore = dataset.getValue("high_score"); 38 | * String name = dataset.getValue("name"); 39 | * // sets value 40 | * dataset.put("high_score", "90"); 41 | * dataset.put("name", "John"); 42 | * // push changes to remote if needed 43 | * dataset.synchronizesyncCallback); 44 | *45 | */ 46 | public interface Dataset { 47 | 48 | /** 49 | * Retrieves the associated {@link DatasetMetadata} from local storage. 50 | * 51 | * @return metadata 52 | */ 53 | DatasetMetadata getDatasetMetadata(); 54 | 55 | /** 56 | * Synchronize {@link Dataset} between local storage and remote storage. 57 | * 58 | * @param callback call back 59 | */ 60 | void synchronize(SyncCallback callback); 61 | 62 | /** 63 | * Attempt to synchronize {@link Dataset} when connectivity is available. If 64 | * the connectivity is available right away, it behaves the same as 65 | * {@link #synchronize(SyncCallback)}. Otherwise it listens to connectivity 66 | * changes, and will do a sync once the connectivity is back. Note that if 67 | * this method is called multiple times, only the last synchronize request 68 | * is kept and only the last callback will fire. If either the dataset or 69 | * the callback is garbage collected, this method will not perform a sync 70 | * and the callback won't fire. 71 | * 72 | * @param callback call back 73 | */ 74 | void synchronizeOnConnectivity(SyncCallback callback); 75 | 76 | /** 77 | * Gets the value of a {@link Record} with the given key. If the 78 | * {@link Record} doesn't exist or is marked deleted, null will be returned. 79 | * 80 | * @param key key of the record in the dataset. 81 | * @return the string value of the record, or null if the record doesn't 82 | * exist or is marked deleted. 83 | */ 84 | String get(String key); 85 | 86 | /** 87 | * Puts a {@link Record} with the given key and value into the 88 | * {@link Dataset}. If a {@link Record} with the same key exists, its value 89 | * will be overwritten. If a {@link Record} is marked as deleted previously, 90 | * then it will be resurrected with new value while the sync count continues 91 | * with previous value. No matter whether the value changes or not, the 92 | * record is considered as updated, and it will be written to Cognito Sync 93 | * service on next synchronize operation. If value is null, a 94 | * {@link NullPointerException} will be thrown. 95 | * 96 | * @param key key of the record 97 | * @param value string value of a {@link Record} to be put into the 98 | * {@link Dataset} 99 | */ 100 | void put(String key, String value); 101 | 102 | /** 103 | * @param values 104 | */ 105 | void putAll(Map
214 | * List<Record> resolved = new ArrayList<Record>(); 215 | * for (SyncConflict conflict : conflicts) { 216 | * resolved.add(conflicts.resolveWithRemoteRecord()); 217 | * } 218 | * dataset.save(resolved); 219 | * return true; // so that synchronize() can retry 220 | *221 | * 222 | * If you prefer to add additional logic when resolving conflict, you 223 | * can use {@link SyncConflict#resolveWithValue(String)} 224 | * 225 | *
226 | * int remoteMoney = Integer.valueOf(conflicts.getRemote().getValue()); 227 | * int localMoney = Integer.valueOf(conflicts.getLocal().getValue()); 228 | * int total = remoteMoney + localMoney; 229 | * Record resolve = conflicts.resolveWithValue(String.valueOf(total)); 230 | *231 | * 232 | * @param dataset the dataset that performed sync 233 | * @param conflicts conflicting records 234 | * @return true if conflicts are resolved so that synchronize will 235 | * retry, false otherwise. 236 | */ 237 | boolean onConflict(Dataset dataset, List
11 | * CognitoCachingCredentialsProvider provider = new CognitoCachingCredentialsProvider( 12 | * context, awsAccountId, identityPoolId, unauthRoleArn, authRoleArn, Regions.US_EAST_1); 13 | * CognitoSyncManager client = new CognitoSyncManager(context, identityPoolId, provider); 14 | * 15 | * Dataset dataset = client.openOrCreateDataset("default_dataset"); 16 | * dataset.put("high_score", "100"); 17 | * dataset.synchronize(new SyncCallback() { 18 | * // override callbacks 19 | * }); 20 | *21 | * 22 | * Please refer to {@link com.amazonaws.mobileconnectors.cognito.CognitoSyncManager} and 23 | * {@link com.amazonaws.mobileconnectors.cognito.Dataset} for more details. 24 | */ 25 | 26 | package com.amazonaws.mobileconnectors.cognito; 27 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/BulkPublishStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | /** 18 | * Bulk Publish Status 19 | */ 20 | public enum BulkPublishStatus { 21 | 22 | NOT_STARTED("NOT_STARTED"), 23 | IN_PROGRESS("IN_PROGRESS"), 24 | FAILED("FAILED"), 25 | SUCCEEDED("SUCCEEDED"); 26 | 27 | private String value; 28 | 29 | private BulkPublishStatus(String value) { 30 | this.value = value; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return this.value; 36 | } 37 | 38 | /** 39 | * Use this in place of valueOf. 40 | * 41 | * @param value 42 | * real value 43 | * @return BulkPublishStatus corresponding to the value 44 | */ 45 | public static BulkPublishStatus fromValue(String value) { 46 | if (value == null || "".equals(value)) { 47 | throw new IllegalArgumentException("Value cannot be null or empty!"); 48 | 49 | } else if ("NOT_STARTED".equals(value)) { 50 | return BulkPublishStatus.NOT_STARTED; 51 | } else if ("IN_PROGRESS".equals(value)) { 52 | return BulkPublishStatus.IN_PROGRESS; 53 | } else if ("FAILED".equals(value)) { 54 | return BulkPublishStatus.FAILED; 55 | } else if ("SUCCEEDED".equals(value)) { 56 | return BulkPublishStatus.SUCCEEDED; 57 | } else { 58 | throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/DeleteDatasetResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import java.io.Serializable; 18 | 19 | /** 20 | *
21 | * Response to a successful DeleteDataset request. 22 | *
23 | */ 24 | public class DeleteDatasetResult implements Serializable { 25 | 26 | /** 27 | * A collection of data for an identity pool. An identity pool can have 28 | * multiple datasets. A dataset is per identity and can be general or 29 | * associated with a particular entity in an application (like a saved 30 | * game). Datasets are automatically created if they don't exist. Data is 31 | * synced by dataset, and a dataset can hold up to 1MB of key-value 32 | * pairs. 33 | */ 34 | private Dataset dataset; 35 | 36 | /** 37 | * A collection of data for an identity pool. An identity pool can have 38 | * multiple datasets. A dataset is per identity and can be general or 39 | * associated with a particular entity in an application (like a saved 40 | * game). Datasets are automatically created if they don't exist. Data is 41 | * synced by dataset, and a dataset can hold up to 1MB of key-value 42 | * pairs. 43 | * 44 | * @return A collection of data for an identity pool. An identity pool can have 45 | * multiple datasets. A dataset is per identity and can be general or 46 | * associated with a particular entity in an application (like a saved 47 | * game). Datasets are automatically created if they don't exist. Data is 48 | * synced by dataset, and a dataset can hold up to 1MB of key-value 49 | * pairs. 50 | */ 51 | public Dataset getDataset() { 52 | return dataset; 53 | } 54 | 55 | /** 56 | * A collection of data for an identity pool. An identity pool can have 57 | * multiple datasets. A dataset is per identity and can be general or 58 | * associated with a particular entity in an application (like a saved 59 | * game). Datasets are automatically created if they don't exist. Data is 60 | * synced by dataset, and a dataset can hold up to 1MB of key-value 61 | * pairs. 62 | * 63 | * @param dataset A collection of data for an identity pool. An identity pool can have 64 | * multiple datasets. A dataset is per identity and can be general or 65 | * associated with a particular entity in an application (like a saved 66 | * game). Datasets are automatically created if they don't exist. Data is 67 | * synced by dataset, and a dataset can hold up to 1MB of key-value 68 | * pairs. 69 | */ 70 | public void setDataset(Dataset dataset) { 71 | this.dataset = dataset; 72 | } 73 | 74 | /** 75 | * A collection of data for an identity pool. An identity pool can have 76 | * multiple datasets. A dataset is per identity and can be general or 77 | * associated with a particular entity in an application (like a saved 78 | * game). Datasets are automatically created if they don't exist. Data is 79 | * synced by dataset, and a dataset can hold up to 1MB of key-value 80 | * pairs. 81 | *82 | * Returns a reference to this object so that method calls can be chained together. 83 | * 84 | * @param dataset A collection of data for an identity pool. An identity pool can have 85 | * multiple datasets. A dataset is per identity and can be general or 86 | * associated with a particular entity in an application (like a saved 87 | * game). Datasets are automatically created if they don't exist. Data is 88 | * synced by dataset, and a dataset can hold up to 1MB of key-value 89 | * pairs. 90 | * 91 | * @return A reference to this updated object so that method calls can be chained 92 | * together. 93 | */ 94 | public DeleteDatasetResult withDataset(Dataset dataset) { 95 | this.dataset = dataset; 96 | return this; 97 | } 98 | 99 | /** 100 | * Returns a string representation of this object; useful for testing and 101 | * debugging. 102 | * 103 | * @return A string representation of this object. 104 | * 105 | * @see java.lang.Object#toString() 106 | */ 107 | @Override 108 | public String toString() { 109 | StringBuilder sb = new StringBuilder(); 110 | sb.append("{"); 111 | if (getDataset() != null) sb.append("Dataset: " + getDataset() ); 112 | sb.append("}"); 113 | return sb.toString(); 114 | } 115 | 116 | @Override 117 | public int hashCode() { 118 | final int prime = 31; 119 | int hashCode = 1; 120 | 121 | hashCode = prime * hashCode + ((getDataset() == null) ? 0 : getDataset().hashCode()); 122 | return hashCode; 123 | } 124 | 125 | @Override 126 | public boolean equals(Object obj) { 127 | if (this == obj) return true; 128 | if (obj == null) return false; 129 | 130 | if (obj instanceof DeleteDatasetResult == false) return false; 131 | DeleteDatasetResult other = (DeleteDatasetResult)obj; 132 | 133 | if (other.getDataset() == null ^ this.getDataset() == null) return false; 134 | if (other.getDataset() != null && other.getDataset().equals(this.getDataset()) == false) return false; 135 | return true; 136 | } 137 | 138 | } 139 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/DescribeDatasetResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import java.io.Serializable; 18 | 19 | /** 20 | *
21 | * Response to a successful DescribeDataset request. 22 | *
23 | */ 24 | public class DescribeDatasetResult implements Serializable { 25 | 26 | /** 27 | * Meta data for a collection of data for an identity. An identity can 28 | * have multiple datasets. A dataset can be general or associated with a 29 | * particular entity in an application (like a saved game). Datasets are 30 | * automatically created if they don't exist. Data is synced by dataset, 31 | * and a dataset can hold up to 1MB of key-value pairs. 32 | */ 33 | private Dataset dataset; 34 | 35 | /** 36 | * Meta data for a collection of data for an identity. An identity can 37 | * have multiple datasets. A dataset can be general or associated with a 38 | * particular entity in an application (like a saved game). Datasets are 39 | * automatically created if they don't exist. Data is synced by dataset, 40 | * and a dataset can hold up to 1MB of key-value pairs. 41 | * 42 | * @return Meta data for a collection of data for an identity. An identity can 43 | * have multiple datasets. A dataset can be general or associated with a 44 | * particular entity in an application (like a saved game). Datasets are 45 | * automatically created if they don't exist. Data is synced by dataset, 46 | * and a dataset can hold up to 1MB of key-value pairs. 47 | */ 48 | public Dataset getDataset() { 49 | return dataset; 50 | } 51 | 52 | /** 53 | * Meta data for a collection of data for an identity. An identity can 54 | * have multiple datasets. A dataset can be general or associated with a 55 | * particular entity in an application (like a saved game). Datasets are 56 | * automatically created if they don't exist. Data is synced by dataset, 57 | * and a dataset can hold up to 1MB of key-value pairs. 58 | * 59 | * @param dataset Meta data for a collection of data for an identity. An identity can 60 | * have multiple datasets. A dataset can be general or associated with a 61 | * particular entity in an application (like a saved game). Datasets are 62 | * automatically created if they don't exist. Data is synced by dataset, 63 | * and a dataset can hold up to 1MB of key-value pairs. 64 | */ 65 | public void setDataset(Dataset dataset) { 66 | this.dataset = dataset; 67 | } 68 | 69 | /** 70 | * Meta data for a collection of data for an identity. An identity can 71 | * have multiple datasets. A dataset can be general or associated with a 72 | * particular entity in an application (like a saved game). Datasets are 73 | * automatically created if they don't exist. Data is synced by dataset, 74 | * and a dataset can hold up to 1MB of key-value pairs. 75 | *76 | * Returns a reference to this object so that method calls can be chained together. 77 | * 78 | * @param dataset Meta data for a collection of data for an identity. An identity can 79 | * have multiple datasets. A dataset can be general or associated with a 80 | * particular entity in an application (like a saved game). Datasets are 81 | * automatically created if they don't exist. Data is synced by dataset, 82 | * and a dataset can hold up to 1MB of key-value pairs. 83 | * 84 | * @return A reference to this updated object so that method calls can be chained 85 | * together. 86 | */ 87 | public DescribeDatasetResult withDataset(Dataset dataset) { 88 | this.dataset = dataset; 89 | return this; 90 | } 91 | 92 | /** 93 | * Returns a string representation of this object; useful for testing and 94 | * debugging. 95 | * 96 | * @return A string representation of this object. 97 | * 98 | * @see java.lang.Object#toString() 99 | */ 100 | @Override 101 | public String toString() { 102 | StringBuilder sb = new StringBuilder(); 103 | sb.append("{"); 104 | if (getDataset() != null) sb.append("Dataset: " + getDataset() ); 105 | sb.append("}"); 106 | return sb.toString(); 107 | } 108 | 109 | @Override 110 | public int hashCode() { 111 | final int prime = 31; 112 | int hashCode = 1; 113 | 114 | hashCode = prime * hashCode + ((getDataset() == null) ? 0 : getDataset().hashCode()); 115 | return hashCode; 116 | } 117 | 118 | @Override 119 | public boolean equals(Object obj) { 120 | if (this == obj) return true; 121 | if (obj == null) return false; 122 | 123 | if (obj instanceof DescribeDatasetResult == false) return false; 124 | DescribeDatasetResult other = (DescribeDatasetResult)obj; 125 | 126 | if (other.getDataset() == null ^ this.getDataset() == null) return false; 127 | if (other.getDataset() != null && other.getDataset().equals(this.getDataset()) == false) return false; 128 | return true; 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/InternalErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import com.amazonaws.AmazonServiceException; 18 | 19 | /** 20 | *
21 | * Indicates an internal service error. 22 | *
23 | */ 24 | public class InternalErrorException extends AmazonServiceException { 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * Constructs a new InternalErrorException with the specified error 29 | * message. 30 | * 31 | * @param message Describes the error encountered. 32 | */ 33 | public InternalErrorException(String message) { 34 | super(message); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/InvalidConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import com.amazonaws.AmazonServiceException; 18 | 19 | /** 20 | * 21 | */ 22 | public class InvalidConfigurationException extends AmazonServiceException { 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * Constructs a new InvalidConfigurationException with the specified error 27 | * message. 28 | * 29 | * @param message Describes the error encountered. 30 | */ 31 | public InvalidConfigurationException(String message) { 32 | super(message); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/InvalidLambdaFunctionOutputException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import com.amazonaws.AmazonServiceException; 18 | 19 | /** 20 | *21 | * The AWS Lambda function returned invalid output or an exception. 22 | *
23 | */ 24 | public class InvalidLambdaFunctionOutputException extends AmazonServiceException { 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * Constructs a new InvalidLambdaFunctionOutputException with the specified error 29 | * message. 30 | * 31 | * @param message Describes the error encountered. 32 | */ 33 | public InvalidLambdaFunctionOutputException(String message) { 34 | super(message); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/InvalidParameterException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import com.amazonaws.AmazonServiceException; 18 | 19 | /** 20 | *21 | * Thrown when a request parameter does not comply with the associated 22 | * constraints. 23 | *
24 | */ 25 | public class InvalidParameterException extends AmazonServiceException { 26 | private static final long serialVersionUID = 1L; 27 | 28 | /** 29 | * Constructs a new InvalidParameterException with the specified error 30 | * message. 31 | * 32 | * @param message Describes the error encountered. 33 | */ 34 | public InvalidParameterException(String message) { 35 | super(message); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/LambdaThrottledException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import com.amazonaws.AmazonServiceException; 18 | 19 | /** 20 | *21 | * AWS Lambda throttled your account, please contact AWS Support 22 | *
23 | */ 24 | public class LambdaThrottledException extends AmazonServiceException { 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * Constructs a new LambdaThrottledException with the specified error 29 | * message. 30 | * 31 | * @param message Describes the error encountered. 32 | */ 33 | public LambdaThrottledException(String message) { 34 | super(message); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/LimitExceededException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import com.amazonaws.AmazonServiceException; 18 | 19 | /** 20 | *21 | * Thrown when the limit on the number of objects or operations has been 22 | * exceeded. 23 | *
24 | */ 25 | public class LimitExceededException extends AmazonServiceException { 26 | private static final long serialVersionUID = 1L; 27 | 28 | /** 29 | * Constructs a new LimitExceededException with the specified error 30 | * message. 31 | * 32 | * @param message Describes the error encountered. 33 | */ 34 | public LimitExceededException(String message) { 35 | super(message); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/services/cognitosync/model/ListDatasetsResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | package com.amazonaws.services.cognitosync.model; 16 | 17 | import java.io.Serializable; 18 | 19 | /** 20 | *21 | * Returned for a successful ListDatasets request. 22 | *
23 | */ 24 | public class ListDatasetsResult implements Serializable { 25 | 26 | /** 27 | * A set of datasets. 28 | */ 29 | private com.amazonaws.internal.ListWithAutoConstructFlag
72 | * Returns a reference to this object so that method calls can be chained together.
73 | *
74 | * @param datasets A set of datasets.
75 | *
76 | * @return A reference to this updated object so that method calls can be chained
77 | * together.
78 | */
79 | public ListDatasetsResult withDatasets(Dataset... datasets) {
80 | if (getDatasets() == null) setDatasets(new java.util.ArrayList
90 | * Returns a reference to this object so that method calls can be chained together.
91 | *
92 | * @param datasets A set of datasets.
93 | *
94 | * @return A reference to this updated object so that method calls can be chained
95 | * together.
96 | */
97 | public ListDatasetsResult withDatasets(java.util.Collection
130 | * Returns a reference to this object so that method calls can be chained together.
131 | *
132 | * @param count Number of datasets returned.
133 | *
134 | * @return A reference to this updated object so that method calls can be chained
135 | * together.
136 | */
137 | public ListDatasetsResult withCount(Integer count) {
138 | this.count = count;
139 | return this;
140 | }
141 |
142 | /**
143 | * A pagination token for obtaining the next page of results.
144 | *
145 | * @return A pagination token for obtaining the next page of results.
146 | */
147 | public String getNextToken() {
148 | return nextToken;
149 | }
150 |
151 | /**
152 | * A pagination token for obtaining the next page of results.
153 | *
154 | * @param nextToken A pagination token for obtaining the next page of results.
155 | */
156 | public void setNextToken(String nextToken) {
157 | this.nextToken = nextToken;
158 | }
159 |
160 | /**
161 | * A pagination token for obtaining the next page of results.
162 | *
163 | * Returns a reference to this object so that method calls can be chained together.
164 | *
165 | * @param nextToken A pagination token for obtaining the next page of results.
166 | *
167 | * @return A reference to this updated object so that method calls can be chained
168 | * together.
169 | */
170 | public ListDatasetsResult withNextToken(String nextToken) {
171 | this.nextToken = nextToken;
172 | return this;
173 | }
174 |
175 | /**
176 | * Returns a string representation of this object; useful for testing and
177 | * debugging.
178 | *
179 | * @return A string representation of this object.
180 | *
181 | * @see java.lang.Object#toString()
182 | */
183 | @Override
184 | public String toString() {
185 | StringBuilder sb = new StringBuilder();
186 | sb.append("{");
187 | if (getDatasets() != null) sb.append("Datasets: " + getDatasets() + ",");
188 | if (getCount() != null) sb.append("Count: " + getCount() + ",");
189 | if (getNextToken() != null) sb.append("NextToken: " + getNextToken() );
190 | sb.append("}");
191 | return sb.toString();
192 | }
193 |
194 | @Override
195 | public int hashCode() {
196 | final int prime = 31;
197 | int hashCode = 1;
198 |
199 | hashCode = prime * hashCode + ((getDatasets() == null) ? 0 : getDatasets().hashCode());
200 | hashCode = prime * hashCode + ((getCount() == null) ? 0 : getCount().hashCode());
201 | hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
202 | return hashCode;
203 | }
204 |
205 | @Override
206 | public boolean equals(Object obj) {
207 | if (this == obj) return true;
208 | if (obj == null) return false;
209 |
210 | if (obj instanceof ListDatasetsResult == false) return false;
211 | ListDatasetsResult other = (ListDatasetsResult)obj;
212 |
213 | if (other.getDatasets() == null ^ this.getDatasets() == null) return false;
214 | if (other.getDatasets() != null && other.getDatasets().equals(this.getDatasets()) == false) return false;
215 | if (other.getCount() == null ^ this.getCount() == null) return false;
216 | if (other.getCount() != null && other.getCount().equals(this.getCount()) == false) return false;
217 | if (other.getNextToken() == null ^ this.getNextToken() == null) return false;
218 | if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false;
219 | return true;
220 | }
221 |
222 | }
223 |
--------------------------------------------------------------------------------
/src/main/java/com/amazonaws/services/cognitosync/model/NotAuthorizedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://aws.amazon.com/apache2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 | package com.amazonaws.services.cognitosync.model;
16 |
17 | import com.amazonaws.AmazonServiceException;
18 |
19 | /**
20 | *
21 | * Thrown when a user is not authorized to access the requested resource.
22 | *
21 | * Response to a RegisterDevice request.
22 | *
29 | * Constraints:
37 | * Constraints:
49 | * Constraints:
61 | * Returns a reference to this object so that method calls can be chained together.
62 | *
63 | * Constraints:
21 | * Thrown if an update can't be applied because the resource was changed
22 | * by another call and this would result in a conflict.
23 | *
21 | * Thrown if the resource doesn't exist.
22 | *
21 | * Response to a SubscribeToDataset request.
22 | *
21 | * Thrown if the request is throttled.
22 | *
21 | * Response to an UnsubscribeFromDataset request.
22 | *
21 | * Returned for a successful UpdateRecordsRequest.
22 | *
62 | * Returns a reference to this object so that method calls can be chained together.
63 | *
64 | * @param records A list of records that have been updated.
65 | *
66 | * @return A reference to this updated object so that method calls can be chained
67 | * together.
68 | */
69 | public UpdateRecordsResult withRecords(Record... records) {
70 | if (getRecords() == null) setRecords(new java.util.ArrayList
80 | * Returns a reference to this object so that method calls can be chained together.
81 | *
82 | * @param records A list of records that have been updated.
83 | *
84 | * @return A reference to this updated object so that method calls can be chained
85 | * together.
86 | */
87 | public UpdateRecordsResult withRecords(java.util.Collection
6 | * Amazon Cognito Sync provides an AWS service and client library that
7 | * enable cross-device syncing of application-related user data.
8 | * High-level client libraries are available for both iOS and Android.
9 | * You can use these libraries to persist data locally so that it's
10 | * available even if the device is offline. Developer credentials don't
11 | * need to be stored on the mobile device to access the service. You can
12 | * use Amazon Cognito to obtain a normalized user ID and credentials.
13 | * User data is persisted in a dataset that can store up to 1 MB of
14 | * key-value pairs, and you can have up to 20 datasets per user identity.
15 | *
17 | * With Amazon Cognito Sync, the data stored for each identity is
18 | * accessible only to credentials assigned to that identity. In order to
19 | * use the Cognito Sync service, you need to make API calls using
20 | * credentials retrieved with
21 | * Amazon Cognito Identity service
22 | * .
23 | *
25 | * If you want to use Cognito Sync in an Android or iOS application, you
26 | * will probably want to make API calls via the AWS Mobile SDK. To learn
27 | * more, see the
28 | * Developer Guide for Android and the Developer Guide for iOS
29 | * .
30 | *
30 | * Length: 1 - 256
31 | */
32 | private String deviceId;
33 |
34 | /**
35 | * The unique ID generated for this device by Cognito.
36 | *
38 | * Length: 1 - 256
39 | *
40 | * @return The unique ID generated for this device by Cognito.
41 | */
42 | public String getDeviceId() {
43 | return deviceId;
44 | }
45 |
46 | /**
47 | * The unique ID generated for this device by Cognito.
48 | *
50 | * Length: 1 - 256
51 | *
52 | * @param deviceId The unique ID generated for this device by Cognito.
53 | */
54 | public void setDeviceId(String deviceId) {
55 | this.deviceId = deviceId;
56 | }
57 |
58 | /**
59 | * The unique ID generated for this device by Cognito.
60 | *
64 | * Length: 1 - 256
65 | *
66 | * @param deviceId The unique ID generated for this device by Cognito.
67 | *
68 | * @return A reference to this updated object so that method calls can be chained
69 | * together.
70 | */
71 | public RegisterDeviceResult withDeviceId(String deviceId) {
72 | this.deviceId = deviceId;
73 | return this;
74 | }
75 |
76 | /**
77 | * Returns a string representation of this object; useful for testing and
78 | * debugging.
79 | *
80 | * @return A string representation of this object.
81 | *
82 | * @see java.lang.Object#toString()
83 | */
84 | @Override
85 | public String toString() {
86 | StringBuilder sb = new StringBuilder();
87 | sb.append("{");
88 | if (getDeviceId() != null) sb.append("DeviceId: " + getDeviceId() );
89 | sb.append("}");
90 | return sb.toString();
91 | }
92 |
93 | @Override
94 | public int hashCode() {
95 | final int prime = 31;
96 | int hashCode = 1;
97 |
98 | hashCode = prime * hashCode + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
99 | return hashCode;
100 | }
101 |
102 | @Override
103 | public boolean equals(Object obj) {
104 | if (this == obj) return true;
105 | if (obj == null) return false;
106 |
107 | if (obj instanceof RegisterDeviceResult == false) return false;
108 | RegisterDeviceResult other = (RegisterDeviceResult)obj;
109 |
110 | if (other.getDeviceId() == null ^ this.getDeviceId() == null) return false;
111 | if (other.getDeviceId() != null && other.getDeviceId().equals(this.getDeviceId()) == false) return false;
112 | return true;
113 | }
114 |
115 | }
116 |
--------------------------------------------------------------------------------
/src/main/java/com/amazonaws/services/cognitosync/model/ResourceConflictException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://aws.amazon.com/apache2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 | package com.amazonaws.services.cognitosync.model;
16 |
17 | import com.amazonaws.AmazonServiceException;
18 |
19 | /**
20 | *