public void Transcode(string inputKey, string outputKey) { using (var et = AWSClientFactory.CreateAmazonElasticTranscoderClient(Settings.AccessKey, Settings.SecretAccessKey, RegionEndpoint.EUWest1)) { var request = new CreateJobRequest { PipelineId = Settings.PipelineId, Input = new JobInput { Key = inputKey }, Output = new CreateJobOutput { PresetId = Settings.PresetId, Key = outputKey } }; et.CreateJob(request); } }
/// <summary> /// Initiates the asynchronous execution of the CreateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateJob 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<CreateJobResponse> CreateJobAsync(CreateJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateJobRequestMarshaller(); var unmarshaller = CreateJobResponseUnmarshaller.Instance; return InvokeAsync<CreateJobRequest,CreateJobResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal CreateJobResponse CreateJob(CreateJobRequest request) { var marshaller = new CreateJobRequestMarshaller(); var unmarshaller = CreateJobResponseUnmarshaller.Instance; return Invoke<CreateJobRequest,CreateJobResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateJob operation on AmazonElasticTranscoderClient.</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 EndCreateJob /// operation.</returns> public IAsyncResult BeginCreateJob(CreateJobRequest request, AsyncCallback callback, object state) { var marshaller = new CreateJobRequestMarshaller(); var unmarshaller = CreateJobResponseUnmarshaller.Instance; return BeginInvoke<CreateJobRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeCreateJob(CreateJobRequest createJobRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateJobRequestMarshaller().Marshall(createJobRequest); var unmarshaller = CreateJobResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the CreateJob operation. /// <seealso cref="Amazon.ElasticTranscoder.IAmazonElasticTranscoder.CreateJob"/> /// </summary> /// /// <param name="createJobRequest">Container for the necessary parameters to execute the CreateJob operation on AmazonElasticTranscoder.</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 EndCreateJob /// operation.</returns> public IAsyncResult BeginCreateJob(CreateJobRequest createJobRequest, AsyncCallback callback, object state) { return invokeCreateJob(createJobRequest, callback, state, false); }
/// <summary> /// <para> When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the /// job that is created. </para> <para>If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and /// another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS /// Console).</para> /// </summary> /// /// <param name="createJobRequest">Container for the necessary parameters to execute the CreateJob service method on /// AmazonElasticTranscoder.</param> /// /// <returns>The response from the CreateJob service method, as returned by AmazonElasticTranscoder.</returns> /// /// <exception cref="ResourceNotFoundException"/> /// <exception cref="AccessDeniedException"/> /// <exception cref="InternalServiceException"/> /// <exception cref="LimitExceededException"/> /// <exception cref="ValidationException"/> /// <exception cref="IncompatibleVersionException"/> public CreateJobResponse CreateJob(CreateJobRequest createJobRequest) { IAsyncResult asyncResult = invokeCreateJob(createJobRequest, null, null, true); return EndCreateJob(asyncResult); }
/// <summary> /// <para> When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the /// job that is created. </para> <para>If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and /// another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS /// Console).</para> /// </summary> /// /// <param name="createJobRequest">Container for the necessary parameters to execute the CreateJob service method on /// AmazonElasticTranscoder.</param> /// /// <returns>The response from the CreateJob service method, as returned by AmazonElasticTranscoder.</returns> /// /// <exception cref="T:Amazon.ElasticTranscoder.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.AccessDeniedException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.InternalServiceException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.LimitExceededException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.ValidationException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.IncompatibleVersionException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CreateJobResponse> CreateJobAsync(CreateJobRequest createJobRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateJobRequestMarshaller(); var unmarshaller = CreateJobResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateJobRequest, CreateJobResponse>(createJobRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal CreateJobResponse CreateJob(CreateJobRequest request) { var task = CreateJobAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the /// job that is created. </para> <para>If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and /// another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS /// Console).</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateJob service method on /// AmazonElasticTranscoder.</param> /// /// <returns>The response from the CreateJob service method, as returned by AmazonElasticTranscoder.</returns> /// /// <exception cref="T:Amazon.ElasticTranscoder.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.AccessDeniedException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.InternalServiceException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.LimitExceededException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.ValidationException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.IncompatibleVersionException" /> public CreateJobResponse CreateJob(CreateJobRequest request) { var task = CreateJobAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para> When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the /// job that is created. </para> <para>If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and /// another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS /// Console).</para> /// </summary> /// /// <param name="createJobRequest">Container for the necessary parameters to execute the CreateJob service method on /// AmazonElasticTranscoder.</param> /// /// <returns>The response from the CreateJob service method, as returned by AmazonElasticTranscoder.</returns> /// /// <exception cref="T:Amazon.ElasticTranscoder.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.AccessDeniedException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.InternalServiceException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.LimitExceededException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.ValidationException" /> /// <exception cref="T:Amazon.ElasticTranscoder.Model.IncompatibleVersionException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<CreateJobResponse> CreateJobAsync(CreateJobRequest createJobRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateJobRequestMarshaller(); var unmarshaller = CreateJobResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateJobRequest, CreateJobResponse>(createJobRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
IAsyncResult invokeCreateJob(CreateJobRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new CreateJobRequestMarshaller(); var unmarshaller = CreateJobResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }