/// <summary> /// Initiates the asynchronous execution of the UpdateRecords operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRecords operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<UpdateRecordsResponse> UpdateRecordsAsync(UpdateRecordsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateRecordsRequestMarshaller(); var unmarshaller = UpdateRecordsResponseUnmarshaller.Instance; return InvokeAsync<UpdateRecordsRequest,UpdateRecordsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the UpdateRecords operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRecords operation on AmazonCognitoSyncClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public void UpdateRecordsAsync(UpdateRecordsRequest request, AmazonServiceCallback<UpdateRecordsRequest, UpdateRecordsResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new UpdateRecordsRequestMarshaller(); var unmarshaller = UpdateRecordsResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<UpdateRecordsRequest,UpdateRecordsResponse> responseObject = new AmazonServiceResult<UpdateRecordsRequest,UpdateRecordsResponse>((UpdateRecordsRequest)req, (UpdateRecordsResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<UpdateRecordsRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Posts updates to records and adds and deletes records for a dataset and user. /// /// /// <para> /// The sync count in the record patch is your last known sync count for that record. /// The server will reject an UpdateRecords request with a ResourceConflictException if /// you try to patch a record with a new value but a stale sync count. /// </para> /// /// <para> /// For example, if the sync count on the server is 5 for a key called highScore and you /// try and submit a new highScore with sync count of 4, the request will be rejected. /// To obtain the current sync count for a record, call ListRecords. On a successful update /// of the record, the response returns the new sync count for that record. You should /// present that sync count the next time you try to update that same record. When the /// record does not exist, specify the sync count as 0. /// </para> /// /// <para> /// This API can be called with temporary user credentials provided by Cognito Identity /// or with developer credentials. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRecords service method.</param> /// /// <returns>The response from the UpdateRecords service method, as returned by CognitoSync.</returns> /// <exception cref="Amazon.CognitoSync.Model.InternalErrorException"> /// Indicates an internal service error. /// </exception> /// <exception cref="Amazon.CognitoSync.Model.InvalidLambdaFunctionOutputException"> /// The AWS Lambda function returned invalid output or an exception. /// </exception> /// <exception cref="Amazon.CognitoSync.Model.InvalidParameterException"> /// Thrown when a request parameter does not comply with the associated constraints. /// </exception> /// <exception cref="Amazon.CognitoSync.Model.LambdaThrottledException"> /// AWS Lambda throttled your account, please contact AWS Support /// </exception> /// <exception cref="Amazon.CognitoSync.Model.LimitExceededException"> /// Thrown when the limit on the number of objects or operations has been exceeded. /// </exception> /// <exception cref="Amazon.CognitoSync.Model.NotAuthorizedException"> /// Thrown when a user is not authorized to access the requested resource. /// </exception> /// <exception cref="Amazon.CognitoSync.Model.ResourceConflictException"> /// Thrown if an update can't be applied because the resource was changed by another call /// and this would result in a conflict. /// </exception> /// <exception cref="Amazon.CognitoSync.Model.ResourceNotFoundException"> /// Thrown if the resource doesn't exist. /// </exception> /// <exception cref="Amazon.CognitoSync.Model.TooManyRequestsException"> /// Thrown if the request is throttled. /// </exception> public UpdateRecordsResponse UpdateRecords(UpdateRecordsRequest request) { var marshaller = new UpdateRecordsRequestMarshaller(); var unmarshaller = UpdateRecordsResponseUnmarshaller.Instance; return Invoke<UpdateRecordsRequest,UpdateRecordsResponse>(request, marshaller, unmarshaller); }
public void UpdateRecordsMarshallTest() { var operation = service_model.FindOperation("UpdateRecords"); var request = InstantiateClassGenerator.Execute<UpdateRecordsRequest>(); var marshaller = new UpdateRecordsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); RequestValidator.Validate("UpdateRecords", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString()); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateRecordsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateRecordsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the UpdateRecords operation. /// <seealso cref="Amazon.CognitoSync.IAmazonCognitoSync.UpdateRecords"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRecords operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<UpdateRecordsResponse> UpdateRecordsAsync(UpdateRecordsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateRecordsRequestMarshaller(); var unmarshaller = UpdateRecordsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, UpdateRecordsRequest, UpdateRecordsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the UpdateRecords operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRecords operation on AmazonCognitoSyncClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateRecords /// operation.</returns> public IAsyncResult BeginUpdateRecords(UpdateRecordsRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateRecordsRequestMarshaller(); var unmarshaller = UpdateRecordsResponseUnmarshaller.Instance; return BeginInvoke<UpdateRecordsRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeUpdateRecords(UpdateRecordsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new UpdateRecordsRequestMarshaller(); var unmarshaller = UpdateRecordsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }