本文整理汇总了C#中AmazonServiceResult类的典型用法代码示例。如果您正苦于以下问题:C# AmazonServiceResult类的具体用法?C# AmazonServiceResult怎么用?C# AmazonServiceResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AmazonServiceResult类属于命名空间,在下文中一共展示了AmazonServiceResult类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostObjectAsync
/// <summary>
/// Upload data to Amazon S3 using HTTP POST.
/// </summary>
/// <remarks>
/// For more information, <see href="http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingHTTPPOST.html"/>
/// </remarks>
/// <param name="request">Request object which describes the data to POST</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 PostObjectAsync(PostObjectRequest request, AmazonServiceCallback<PostObjectRequest, PostObjectResponse> callback, AsyncOptions options = null)
{
options = options == null ? new AsyncOptions() : options;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper
= (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) =>
{
AmazonServiceResult<PostObjectRequest, PostObjectResponse> responseObject
= new AmazonServiceResult<PostObjectRequest, PostObjectResponse>((PostObjectRequest)req, (PostObjectResponse)res, ex, ao.State);
if (callback != null)
callback(responseObject);
};
ThreadPool.QueueUserWorkItem(new WaitCallback(delegate
{
// Provide a default policy if user doesn't set it.
try
{
InferContentType(request);
if (request.SignedPolicy == null)
{
CreateSignedPolicy(request);
}
PostObject(request, options, callbackHelper);
}
catch (Exception e)
{
callback(new AmazonServiceResult<PostObjectRequest, PostObjectResponse>(request, null, e, options.State));
}
}));
}
示例2: UpdateRecordsAsync
/// <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);
}
示例3: SetIdentityPoolConfigurationAsync
/// <summary>
/// Initiates the asynchronous execution of the SetIdentityPoolConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetIdentityPoolConfiguration 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 SetIdentityPoolConfigurationAsync(SetIdentityPoolConfigurationRequest request, AmazonServiceCallback<SetIdentityPoolConfigurationRequest, SetIdentityPoolConfigurationResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new SetIdentityPoolConfigurationRequestMarshaller();
var unmarshaller = SetIdentityPoolConfigurationResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<SetIdentityPoolConfigurationRequest,SetIdentityPoolConfigurationResponse> responseObject
= new AmazonServiceResult<SetIdentityPoolConfigurationRequest,SetIdentityPoolConfigurationResponse>((SetIdentityPoolConfigurationRequest)req, (SetIdentityPoolConfigurationResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<SetIdentityPoolConfigurationRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例4: DescribeIdentityUsageAsync
/// <summary>
/// Initiates the asynchronous execution of the DescribeIdentityUsage operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeIdentityUsage 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 DescribeIdentityUsageAsync(DescribeIdentityUsageRequest request, AmazonServiceCallback<DescribeIdentityUsageRequest, DescribeIdentityUsageResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new DescribeIdentityUsageRequestMarshaller();
var unmarshaller = DescribeIdentityUsageResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<DescribeIdentityUsageRequest,DescribeIdentityUsageResponse> responseObject
= new AmazonServiceResult<DescribeIdentityUsageRequest,DescribeIdentityUsageResponse>((DescribeIdentityUsageRequest)req, (DescribeIdentityUsageResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<DescribeIdentityUsageRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例5: GetOpenIdTokenForDeveloperIdentityAsync
/// <summary>
/// Initiates the asynchronous execution of the GetOpenIdTokenForDeveloperIdentity operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetOpenIdTokenForDeveloperIdentity operation on AmazonCognitoIdentityClient.</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 GetOpenIdTokenForDeveloperIdentityAsync(GetOpenIdTokenForDeveloperIdentityRequest request, AmazonServiceCallback<GetOpenIdTokenForDeveloperIdentityRequest, GetOpenIdTokenForDeveloperIdentityResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new GetOpenIdTokenForDeveloperIdentityRequestMarshaller();
var unmarshaller = GetOpenIdTokenForDeveloperIdentityResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<GetOpenIdTokenForDeveloperIdentityRequest,GetOpenIdTokenForDeveloperIdentityResponse> responseObject
= new AmazonServiceResult<GetOpenIdTokenForDeveloperIdentityRequest,GetOpenIdTokenForDeveloperIdentityResponse>((GetOpenIdTokenForDeveloperIdentityRequest)req, (GetOpenIdTokenForDeveloperIdentityResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<GetOpenIdTokenForDeveloperIdentityRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例6: DeleteObjectAsync
/// <summary>
/// Initiates the asynchronous execution of the DeleteObject operation.
/// This API is supported only when AWSConfigs.HttpClient is set to AWSConfigs.HttpClientOption.UnityWebRequest, the default value for this configuration option is AWSConfigs.HttpClientOption.UnityWWW
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteObject operation on AmazonS3Client.</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 DeleteObjectAsync(DeleteObjectRequest request, AmazonServiceCallback<DeleteObjectRequest, DeleteObjectResponse> callback, AsyncOptions options = null)
{
if (AWSConfigs.HttpClient == AWSConfigs.HttpClientOption.UnityWWW)
{
throw new InvalidOperationException("DeleteObject is only allowed with AWSConfigs.HttpClientOption.UnityWebRequest API option");
}
options = options == null?new AsyncOptions():options;
var marshaller = new DeleteObjectRequestMarshaller();
var unmarshaller = DeleteObjectResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<DeleteObjectRequest,DeleteObjectResponse> responseObject
= new AmazonServiceResult<DeleteObjectRequest,DeleteObjectResponse>((DeleteObjectRequest)req, (DeleteObjectResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<DeleteObjectRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例7: ListBucketMetricsConfigurationsAsync
/// <summary>
/// Initiates the asynchronous execution of the ListBucketMetricsConfigurations operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListBucketMetricsConfigurations operation on AmazonS3Client.</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 ListBucketMetricsConfigurationsAsync(ListBucketMetricsConfigurationsRequest request, AmazonServiceCallback<ListBucketMetricsConfigurationsRequest, ListBucketMetricsConfigurationsResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new ListBucketMetricsConfigurationsRequestMarshaller();
var unmarshaller = ListBucketMetricsConfigurationsResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<ListBucketMetricsConfigurationsRequest,ListBucketMetricsConfigurationsResponse> responseObject
= new AmazonServiceResult<ListBucketMetricsConfigurationsRequest,ListBucketMetricsConfigurationsResponse>((ListBucketMetricsConfigurationsRequest)req, (ListBucketMetricsConfigurationsResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<ListBucketMetricsConfigurationsRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例8: HandleResponse
/// <summary>
/// Call to handle the response for each delivery Attempt.
/// Notifies all the policies once delivery attempt has been completed.
/// If the delivery is successful then it deletes the events from the <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.Internal.IEventStore"/>
/// If the delivery was not successful then depending on the response the event may be deleted (e.g. 400 Http response , non throttle scenario) or the delivery count may be incremented.
/// </summary>
/// <param name="result">result <see cref="Amazon.Runtime.AmazonServiceResult"/></param>
private void HandleResponse(AmazonServiceResult<PutEventsRequest, PutEventsResponse> result)
{
List<string> rowsToUpdate = (List<string>)(result.state);
bool success = false;
bool retriable = false;
if (result.Exception == null)
{
success = true;
}
else if (result.Exception is Amazon.MobileAnalytics.Model.BadRequestException)
{
retriable = true;
}
else if (result.Exception is AmazonMobileAnalyticsException)
{
if ( string.Equals(((AmazonMobileAnalyticsException)(result.Exception)).ErrorCode,"ThrottlingException", StringComparison.CurrentCultureIgnoreCase) ||
((AmazonMobileAnalyticsException)(result.Exception)).StatusCode >= HttpStatusCode.InternalServerError)
{
retriable = true;
}
}
if (success)
{
_logger.InfoFormat("Deliver events succefully and delete events");
_eventStore.DeleteEvent(rowsToUpdate);
}
else
{
if (retriable)
{
_logger.InfoFormat("Unable to deliver events. events will be retried in next attempt.");
_eventStore.IncrementDeliveryAttempt(rowsToUpdate);
}
else
{
_logger.InfoFormat("Events delivery fail and it's not retriable. Delete events");
_eventStore.DeleteEvent(rowsToUpdate);
}
}
foreach (IDeliveryPolicy policy in _deliveryPolicies)
{
policy.HandleDeliveryAttempt(success);
}
lock (_deliveryLock)
{
_deliveryInProgress = false;
}
}
示例9: IncreaseStreamRetentionPeriodAsync
/// <summary>
/// Initiates the asynchronous execution of the IncreaseStreamRetentionPeriod operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the IncreaseStreamRetentionPeriod operation on AmazonKinesisClient.</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 IncreaseStreamRetentionPeriodAsync(IncreaseStreamRetentionPeriodRequest request, AmazonServiceCallback<IncreaseStreamRetentionPeriodRequest, IncreaseStreamRetentionPeriodResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new IncreaseStreamRetentionPeriodRequestMarshaller();
var unmarshaller = IncreaseStreamRetentionPeriodResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<IncreaseStreamRetentionPeriodRequest,IncreaseStreamRetentionPeriodResponse> responseObject
= new AmazonServiceResult<IncreaseStreamRetentionPeriodRequest,IncreaseStreamRetentionPeriodResponse>((IncreaseStreamRetentionPeriodRequest)req, (IncreaseStreamRetentionPeriodResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<IncreaseStreamRetentionPeriodRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例10: EnableEnhancedMonitoringAsync
/// <summary>
/// Initiates the asynchronous execution of the EnableEnhancedMonitoring operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the EnableEnhancedMonitoring operation on AmazonKinesisClient.</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 EnableEnhancedMonitoringAsync(EnableEnhancedMonitoringRequest request, AmazonServiceCallback<EnableEnhancedMonitoringRequest, EnableEnhancedMonitoringResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new EnableEnhancedMonitoringRequestMarshaller();
var unmarshaller = EnableEnhancedMonitoringResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<EnableEnhancedMonitoringRequest,EnableEnhancedMonitoringResponse> responseObject
= new AmazonServiceResult<EnableEnhancedMonitoringRequest,EnableEnhancedMonitoringResponse>((EnableEnhancedMonitoringRequest)req, (EnableEnhancedMonitoringResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<EnableEnhancedMonitoringRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例11: CreateServiceSpecificCredentialAsync
/// <summary>
/// Initiates the asynchronous execution of the CreateServiceSpecificCredential operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateServiceSpecificCredential operation on AmazonIdentityManagementServiceClient.</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 CreateServiceSpecificCredentialAsync(CreateServiceSpecificCredentialRequest request, AmazonServiceCallback<CreateServiceSpecificCredentialRequest, CreateServiceSpecificCredentialResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new CreateServiceSpecificCredentialRequestMarshaller();
var unmarshaller = CreateServiceSpecificCredentialResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<CreateServiceSpecificCredentialRequest,CreateServiceSpecificCredentialResponse> responseObject
= new AmazonServiceResult<CreateServiceSpecificCredentialRequest,CreateServiceSpecificCredentialResponse>((CreateServiceSpecificCredentialRequest)req, (CreateServiceSpecificCredentialResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<CreateServiceSpecificCredentialRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例12: RemoveRoleFromInstanceProfileAsync
/// <summary>
/// Initiates the asynchronous execution of the RemoveRoleFromInstanceProfile operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RemoveRoleFromInstanceProfile operation on AmazonIdentityManagementServiceClient.</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 RemoveRoleFromInstanceProfileAsync(RemoveRoleFromInstanceProfileRequest request, AmazonServiceCallback<RemoveRoleFromInstanceProfileRequest, RemoveRoleFromInstanceProfileResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new RemoveRoleFromInstanceProfileRequestMarshaller();
var unmarshaller = RemoveRoleFromInstanceProfileResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<RemoveRoleFromInstanceProfileRequest,RemoveRoleFromInstanceProfileResponse> responseObject
= new AmazonServiceResult<RemoveRoleFromInstanceProfileRequest,RemoveRoleFromInstanceProfileResponse>((RemoveRoleFromInstanceProfileRequest)req, (RemoveRoleFromInstanceProfileResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<RemoveRoleFromInstanceProfileRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}
示例13: AddClientIDToOpenIDConnectProviderAsync
/// <summary>
/// Initiates the asynchronous execution of the AddClientIDToOpenIDConnectProvider operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AddClientIDToOpenIDConnectProvider operation on AmazonIdentityManagementServiceClient.</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 AddClientIDToOpenIDConnectProviderAsync(AddClientIDToOpenIDConnectProviderRequest request, AmazonServiceCallback<AddClientIDToOpenIDConnectProviderRequest, AddClientIDToOpenIDConnectProviderResponse> callback, AsyncOptions options = null)
{
options = options == null?new AsyncOptions():options;
var marshaller = new AddClientIDToOpenIDConnectProviderRequestMarshaller();
var unmarshaller = AddClientIDToOpenIDConnectProviderResponseUnmarshaller.Instance;
Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
if(callback !=null )
callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
AmazonServiceResult<AddClientIDToOpenIDConnectProviderRequest,AddClientIDToOpenIDConnectProviderResponse> responseObject
= new AmazonServiceResult<AddClientIDToOpenIDConnectProviderRequest,AddClientIDToOpenIDConnectProviderResponse>((AddClientIDToOpenIDConnectProviderRequest)req, (AddClientIDToOpenIDConnectProviderResponse)res, ex , ao.State);
callback(responseObject);
};
BeginInvoke<AddClientIDToOpenIDConnectProviderRequest>(request, marshaller, unmarshaller, options, callbackHelper);
}