/// <summary> /// Initiates the asynchronous execution of the UpdateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob 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<UpdateJobResponse> UpdateJobAsync(UpdateJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateJobRequestMarshaller(); var unmarshaller = UpdateJobResponseUnmarshaller.Instance; return InvokeAsync<UpdateJobRequest,UpdateJobResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal UpdateJobResponse UpdateJob(UpdateJobRequest request) { var marshaller = new UpdateJobRequestMarshaller(); var unmarshaller = UpdateJobResponseUnmarshaller.Instance; return Invoke<UpdateJobRequest,UpdateJobResponse>(request, marshaller, unmarshaller); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Snowball.Model.UpdateJobRequest(); if (cmdletContext.AddressId != null) { request.AddressId = cmdletContext.AddressId; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.ForwardingAddressId != null) { request.ForwardingAddressId = cmdletContext.ForwardingAddressId; } if (cmdletContext.JobId != null) { request.JobId = cmdletContext.JobId; } // populate Notification var requestNotificationIsNull = true; request.Notification = new Amazon.Snowball.Model.Notification(); List <System.String> requestNotification_notification_JobStatesToNotify = null; if (cmdletContext.Notification_JobStatesToNotify != null) { requestNotification_notification_JobStatesToNotify = cmdletContext.Notification_JobStatesToNotify; } if (requestNotification_notification_JobStatesToNotify != null) { request.Notification.JobStatesToNotify = requestNotification_notification_JobStatesToNotify; requestNotificationIsNull = false; } System.Boolean?requestNotification_notification_NotifyAll = null; if (cmdletContext.Notification_NotifyAll != null) { requestNotification_notification_NotifyAll = cmdletContext.Notification_NotifyAll.Value; } if (requestNotification_notification_NotifyAll != null) { request.Notification.NotifyAll = requestNotification_notification_NotifyAll.Value; requestNotificationIsNull = false; } System.String requestNotification_notification_SnsTopicARN = null; if (cmdletContext.Notification_SnsTopicARN != null) { requestNotification_notification_SnsTopicARN = cmdletContext.Notification_SnsTopicARN; } if (requestNotification_notification_SnsTopicARN != null) { request.Notification.SnsTopicARN = requestNotification_notification_SnsTopicARN; requestNotificationIsNull = false; } // determine if request.Notification should be set to null if (requestNotificationIsNull) { request.Notification = null; } // populate OnDeviceServiceConfiguration var requestOnDeviceServiceConfigurationIsNull = true; request.OnDeviceServiceConfiguration = new Amazon.Snowball.Model.OnDeviceServiceConfiguration(); Amazon.Snowball.Model.NFSOnDeviceServiceConfiguration requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService = null; // populate NFSOnDeviceService var requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceServiceIsNull = true; requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService = new Amazon.Snowball.Model.NFSOnDeviceServiceConfiguration(); System.Int32?requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageLimit = null; if (cmdletContext.NFSOnDeviceService_StorageLimit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageLimit = cmdletContext.NFSOnDeviceService_StorageLimit.Value; } if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageLimit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService.StorageLimit = requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageLimit.Value; requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceServiceIsNull = false; } Amazon.Snowball.StorageUnit requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageUnit = null; if (cmdletContext.NFSOnDeviceService_StorageUnit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageUnit = cmdletContext.NFSOnDeviceService_StorageUnit; } if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageUnit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService.StorageUnit = requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService_nFSOnDeviceService_StorageUnit; requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceServiceIsNull = false; } // determine if requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService should be set to null if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceServiceIsNull) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService = null; } if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService != null) { request.OnDeviceServiceConfiguration.NFSOnDeviceService = requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_NFSOnDeviceService; requestOnDeviceServiceConfigurationIsNull = false; } Amazon.Snowball.Model.TGWOnDeviceServiceConfiguration requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService = null; // populate TGWOnDeviceService var requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceServiceIsNull = true; requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService = new Amazon.Snowball.Model.TGWOnDeviceServiceConfiguration(); System.Int32?requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageLimit = null; if (cmdletContext.TGWOnDeviceService_StorageLimit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageLimit = cmdletContext.TGWOnDeviceService_StorageLimit.Value; } if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageLimit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService.StorageLimit = requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageLimit.Value; requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceServiceIsNull = false; } Amazon.Snowball.StorageUnit requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageUnit = null; if (cmdletContext.TGWOnDeviceService_StorageUnit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageUnit = cmdletContext.TGWOnDeviceService_StorageUnit; } if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageUnit != null) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService.StorageUnit = requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService_tGWOnDeviceService_StorageUnit; requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceServiceIsNull = false; } // determine if requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService should be set to null if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceServiceIsNull) { requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService = null; } if (requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService != null) { request.OnDeviceServiceConfiguration.TGWOnDeviceService = requestOnDeviceServiceConfiguration_onDeviceServiceConfiguration_TGWOnDeviceService; requestOnDeviceServiceConfigurationIsNull = false; } // determine if request.OnDeviceServiceConfiguration should be set to null if (requestOnDeviceServiceConfigurationIsNull) { request.OnDeviceServiceConfiguration = null; } // populate Resources var requestResourcesIsNull = true; request.Resources = new Amazon.Snowball.Model.JobResource(); List <Amazon.Snowball.Model.Ec2AmiResource> requestResources_resources_Ec2AmiResource = null; if (cmdletContext.Resources_Ec2AmiResource != null) { requestResources_resources_Ec2AmiResource = cmdletContext.Resources_Ec2AmiResource; } if (requestResources_resources_Ec2AmiResource != null) { request.Resources.Ec2AmiResources = requestResources_resources_Ec2AmiResource; requestResourcesIsNull = false; } List <Amazon.Snowball.Model.LambdaResource> requestResources_resources_LambdaResource = null; if (cmdletContext.Resources_LambdaResource != null) { requestResources_resources_LambdaResource = cmdletContext.Resources_LambdaResource; } if (requestResources_resources_LambdaResource != null) { request.Resources.LambdaResources = requestResources_resources_LambdaResource; requestResourcesIsNull = false; } List <Amazon.Snowball.Model.S3Resource> requestResources_resources_S3Resource = null; if (cmdletContext.Resources_S3Resource != null) { requestResources_resources_S3Resource = cmdletContext.Resources_S3Resource; } if (requestResources_resources_S3Resource != null) { request.Resources.S3Resources = requestResources_resources_S3Resource; requestResourcesIsNull = false; } // determine if request.Resources should be set to null if (requestResourcesIsNull) { request.Resources = null; } if (cmdletContext.RoleARN != null) { request.RoleARN = cmdletContext.RoleARN; } if (cmdletContext.ShippingOption != null) { request.ShippingOption = cmdletContext.ShippingOption; } if (cmdletContext.SnowballCapacityPreference != null) { request.SnowballCapacityPreference = cmdletContext.SnowballCapacityPreference; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
private Amazon.Snowball.Model.UpdateJobResponse CallAWSServiceOperation(IAmazonSnowball client, Amazon.Snowball.Model.UpdateJobRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Import/Export Snowball", "UpdateJob"); try { #if DESKTOP return(client.UpdateJob(request)); #elif CORECLR return(client.UpdateJobAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// Initiates the asynchronous execution of the UpdateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateJob operation on AmazonSnowballClient.</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 EndUpdateJob /// operation.</returns> public IAsyncResult BeginUpdateJob(UpdateJobRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateJobRequestMarshaller(); var unmarshaller = UpdateJobResponseUnmarshaller.Instance; return BeginInvoke<UpdateJobRequest>(request, marshaller, unmarshaller, callback, state); }