Exemple #1
0
 public SetStreamingDistributionConfigResponse SetStreamingDistributionConfig(SetStreamingDistributionConfigRequest request)
 {
     if (request == null)
     {
         throw new ArgumentNullException("request", "The SetStreamingDistributionConfigRequest specified is null!");
     }
     if (!request.IsSetId())
     {
         throw new ArgumentNullException("request", "The StreamingDistribution Id specified is null or empty!");
     }
     if (!request.IsSetStreamingDistributionConfig())
     {
         throw new ArgumentNullException("request", "No StreamingDistribution Config specified!");
     }
     if (!request.IsSetETag())
     {
         throw new ArgumentNullException("request", "The StreamingDistribution ETag specified is null or empty!");
     }
     return(this.Invoke <SetStreamingDistributionConfigResponse>(this.ConvertSetStreamingDistributionConfig(request), request.Headers));
 }
Exemple #2
0
        private IDictionary <CloudFrontQueryParameter, string> ConvertSetStreamingDistributionConfig(SetStreamingDistributionConfigRequest request)
        {
            IDictionary <CloudFrontQueryParameter, string> parameters = new Dictionary <CloudFrontQueryParameter, string>(5);

            parameters.Add(CloudFrontQueryParameter.Verb, CloudFrontConstants.PutVerb);
            parameters.Add(CloudFrontQueryParameter.Action, "SetStreamingDistributionConfig");
            parameters.Add(CloudFrontQueryParameter.Query, "/config");
            parameters.Add(CloudFrontQueryParameter.ContentBody, request.StreamingDistributionConfig.ToString());
            parameters.Add(CloudFrontQueryParameter.ContentType, "application/x-www-form-urlencoded; charset=utf-8");
            parameters.Add(CloudFrontQueryParameter.Id, request.Id);
            request.Headers["If-Match"] = request.ETag;
            this.AddCloudFrontQueryParameters(parameters, request.Headers);
            return(parameters);
        }