internal CreateStreamingDistributionResponse CreateStreamingDistribution(CreateStreamingDistributionRequest request) { var marshaller = new CreateStreamingDistributionRequestMarshaller(); var unmarshaller = CreateStreamingDistributionResponseUnmarshaller.Instance; return(Invoke <CreateStreamingDistributionRequest, CreateStreamingDistributionResponse>(request, marshaller, unmarshaller)); }
internal CreateStreamingDistributionResponse CreateStreamingDistribution(CreateStreamingDistributionRequest request) { var task = CreateStreamingDistributionAsync(request); try { return(task.Result); } catch (AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return(null); } }
public CreateStreamingDistributionResponse CreateStreamingDistribution(CreateStreamingDistributionRequest request) { if (request == null) { throw new ArgumentNullException("request", "The CreateStreamingDistributionRequest specified is null!"); } CloudFrontStreamingDistributionConfig streamingDistributionConfig = request.StreamingDistributionConfig; if (streamingDistributionConfig == null) { throw new ArgumentNullException("request", "The request's StreamingDistributionConfig is null!"); } if (!streamingDistributionConfig.IsSetOrigin()) { throw new ArgumentNullException("request", "The Origin Server Bucket to create the distribution with is null or empty!"); } if (!streamingDistributionConfig.IsSetCallerReference()) { throw new ArgumentNullException("request", "The CallerReference to create the distribution with is null or empty!"); } return(this.Invoke <CreateStreamingDistributionResponse>(this.ConvertCreateStreamingDistribution(request), request.Headers)); }
/// <summary> /// Initiates the asynchronous execution of the CreateStreamingDistribution operation. /// <seealso cref="Amazon.CloudFront.IAmazonCloudFront"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateStreamingDistribution 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 <CreateStreamingDistributionResponse> CreateStreamingDistributionAsync(CreateStreamingDistributionRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateStreamingDistributionRequestMarshaller(); var unmarshaller = CreateStreamingDistributionResponseUnmarshaller.Instance; return(Invoke <IRequest, CreateStreamingDistributionRequest, CreateStreamingDistributionResponse>(request, marshaller, unmarshaller, signer, cancellationToken)); }
private IDictionary <CloudFrontQueryParameter, string> ConvertCreateStreamingDistribution(CreateStreamingDistributionRequest request) { IDictionary <CloudFrontQueryParameter, string> parameters = new Dictionary <CloudFrontQueryParameter, string>(5); parameters.Add(CloudFrontQueryParameter.Verb, CloudFrontConstants.PostVerb); parameters.Add(CloudFrontQueryParameter.Action, "CreateStreamingDistribution"); parameters.Add(CloudFrontQueryParameter.ContentBody, request.StreamingDistributionConfig.ToString()); parameters.Add(CloudFrontQueryParameter.ContentType, "application/x-www-form-urlencoded; charset=utf-8"); this.AddCloudFrontQueryParameters(parameters, request.Headers); return(parameters); }