Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.cognitosync.model;
 
 
Container for the parameters to the UpdateRecords operation.

Posts updates to records and adds and deletes records for a dataset and user.

UpdateRecords can only be called with temporary user credentials provided by Cognito Identity. You cannot make this API call with developer credentials.

 
 public class UpdateRecordsRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

 
     private String identityPoolId;

    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

 
     private String identityId;

    
A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.:-]+

 
     private String datasetName;

    
The unique ID generated for this device by Cognito.

Constraints:
Length: 1 - 256

 
     private String deviceId;

    
A list of patch operations.
 
The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.
 
     private String syncSessionToken;

    
Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
 
     private String clientContext;

    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

Returns:
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    public String getIdentityPoolId() {
        return ;
    }
    
    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

Parameters:
identityPoolId A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    public void setIdentityPoolId(String identityPoolId) {
        this. = identityPoolId;
    }
    
    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

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

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

Parameters:
identityPoolId A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateRecordsRequest withIdentityPoolId(String identityPoolId) {
        this. = identityPoolId;
        return this;
    }

    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

Returns:
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    public String getIdentityId() {
        return ;
    }
    
    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

Parameters:
identityId A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
    public void setIdentityId(String identityId) {
        this. = identityId;
    }
    
    
A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

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

Constraints:
Length: 1 - 50
Pattern: [\w-]+:[0-9a-f-]+

Parameters:
identityId A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateRecordsRequest withIdentityId(String identityId) {
        this. = identityId;
        return this;
    }

    
A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.:-]+

Returns:
A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
    public String getDatasetName() {
        return ;
    }
    
    
A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.:-]+

Parameters:
datasetName A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
    public void setDatasetName(String datasetName) {
        this. = datasetName;
    }
    
    
A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).

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

Constraints:
Length: 1 - 128
Pattern: [a-zA-Z0-9_.:-]+

Parameters:
datasetName A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateRecordsRequest withDatasetName(String datasetName) {
        this. = datasetName;
        return this;
    }

    
The unique ID generated for this device by Cognito.

Constraints:
Length: 1 - 256

Returns:
The unique ID generated for this device by Cognito.
    public String getDeviceId() {
        return ;
    }
    
    
The unique ID generated for this device by Cognito.

Constraints:
Length: 1 - 256

Parameters:
deviceId The unique ID generated for this device by Cognito.
    public void setDeviceId(String deviceId) {
        this. = deviceId;
    }
    
    
The unique ID generated for this device by Cognito.

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

Constraints:
Length: 1 - 256

Parameters:
deviceId The unique ID generated for this device by Cognito.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateRecordsRequest withDeviceId(String deviceId) {
        this. = deviceId;
        return this;
    }

    
A list of patch operations.

Returns:
A list of patch operations.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of patch operations.

Parameters:
recordPatches A list of patch operations.
    public void setRecordPatches(java.util.Collection<RecordPatchrecordPatches) {
        if (recordPatches == null) {
            this. = null;
            return;
        }
        recordPatchesCopy.addAll(recordPatches);
        this. = recordPatchesCopy;
    }
    
    
A list of patch operations.

NOTE: This method appends the values to the existing list (if any). Use setRecordPatches(java.util.Collection) or withRecordPatches(java.util.Collection) if you want to override the existing values.

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

Parameters:
recordPatches A list of patch operations.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateRecordsRequest withRecordPatches(RecordPatch... recordPatches) {
        if (getRecordPatches() == nullsetRecordPatches(new java.util.ArrayList<RecordPatch>(recordPatches.length));
        for (RecordPatch value : recordPatches) {
            getRecordPatches().add(value);
        }
        return this;
    }
    
    
A list of patch operations.

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

Parameters:
recordPatches A list of patch operations.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (recordPatches == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<RecordPatchrecordPatchesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<RecordPatch>(recordPatches.size());
            recordPatchesCopy.addAll(recordPatches);
            this. = recordPatchesCopy;
        }
        return this;
    }

    
The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.

Returns:
The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.
    public String getSyncSessionToken() {
        return ;
    }
    
    
The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.

Parameters:
syncSessionToken The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.
    public void setSyncSessionToken(String syncSessionToken) {
        this. = syncSessionToken;
    }
    
    
The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.

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

Parameters:
syncSessionToken The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateRecordsRequest withSyncSessionToken(String syncSessionToken) {
        this. = syncSessionToken;
        return this;
    }

    
Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.

Returns:
Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
    public String getClientContext() {
        return ;
    }
    
    
Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.

Parameters:
clientContext Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
    public void setClientContext(String clientContext) {
        this. = clientContext;
    }
    
    
Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.

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

Parameters:
clientContext Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateRecordsRequest withClientContext(String clientContext) {
        this. = clientContext;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getIdentityPoolId() != nullsb.append("IdentityPoolId: " + getIdentityPoolId() + ",");
        if (getIdentityId() != nullsb.append("IdentityId: " + getIdentityId() + ",");
        if (getDatasetName() != nullsb.append("DatasetName: " + getDatasetName() + ",");
        if (getDeviceId() != nullsb.append("DeviceId: " + getDeviceId() + ",");
        if (getRecordPatches() != nullsb.append("RecordPatches: " + getRecordPatches() + ",");
        if (getSyncSessionToken() != nullsb.append("SyncSessionToken: " + getSyncSessionToken() + ",");
        if (getClientContext() != nullsb.append("ClientContext: " + getClientContext() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getIdentityPoolId() == null) ? 0 : getIdentityPoolId().hashCode()); 
        hashCode = prime * hashCode + ((getIdentityId() == null) ? 0 : getIdentityId().hashCode()); 
        hashCode = prime * hashCode + ((getDatasetName() == null) ? 0 : getDatasetName().hashCode()); 
        hashCode = prime * hashCode + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode()); 
        hashCode = prime * hashCode + ((getRecordPatches() == null) ? 0 : getRecordPatches().hashCode()); 
        hashCode = prime * hashCode + ((getSyncSessionToken() == null) ? 0 : getSyncSessionToken().hashCode()); 
        hashCode = prime * hashCode + ((getClientContext() == null) ? 0 : getClientContext().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof UpdateRecordsRequest == falsereturn false;
        UpdateRecordsRequest other = (UpdateRecordsRequest)obj;
        
        if (other.getIdentityPoolId() == null ^ this.getIdentityPoolId() == nullreturn false;
        if (other.getIdentityPoolId() != null && other.getIdentityPoolId().equals(this.getIdentityPoolId()) == falsereturn false
        if (other.getIdentityId() == null ^ this.getIdentityId() == nullreturn false;
        if (other.getIdentityId() != null && other.getIdentityId().equals(this.getIdentityId()) == falsereturn false
        if (other.getDatasetName() == null ^ this.getDatasetName() == nullreturn false;
        if (other.getDatasetName() != null && other.getDatasetName().equals(this.getDatasetName()) == falsereturn false
        if (other.getDeviceId() == null ^ this.getDeviceId() == nullreturn false;
        if (other.getDeviceId() != null && other.getDeviceId().equals(this.getDeviceId()) == falsereturn false
        if (other.getRecordPatches() == null ^ this.getRecordPatches() == nullreturn false;
        if (other.getRecordPatches() != null && other.getRecordPatches().equals(this.getRecordPatches()) == falsereturn false
        if (other.getSyncSessionToken() == null ^ this.getSyncSessionToken() == nullreturn false;
        if (other.getSyncSessionToken() != null && other.getSyncSessionToken().equals(this.getSyncSessionToken()) == falsereturn false
        if (other.getClientContext() == null ^ this.getClientContext() == nullreturn false;
        if (other.getClientContext() != null && other.getClientContext().equals(this.getClientContext()) == falsereturn false
        return true;
    }
    
    @Override
    public UpdateRecordsRequest clone() {
        
            return (UpdateRecordsRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X