/// <summary> /// Sets the cross-origin resource sharing (CORS) configuration on a container so that /// the container can service cross-origin requests. For example, you might want to enable /// a request whose origin is http://www.example.com to access your AWS Elemental MediaStore /// container at my.example.container.com by using the browser's XMLHttpRequest capability. /// /// /// <para> /// To enable CORS on a container, you attach a CORS policy to the container. In the CORS /// policy, you configure rules that identify origins and the HTTP methods that can be /// executed on your container. The policy can contain up to 398,000 characters. You can /// add up to 100 rules to a CORS policy. If more than one rule applies, the service uses /// the first applicable rule listed. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutCorsPolicy service method.</param> /// /// <returns>The response from the PutCorsPolicy service method, as returned by MediaStore.</returns> /// <exception cref="Amazon.MediaStore.Model.ContainerInUseException"> /// Resource already exists or is being updated. /// </exception> /// <exception cref="Amazon.MediaStore.Model.ContainerNotFoundException"> /// Could not perform an operation on a container that does not exist. /// </exception> /// <exception cref="Amazon.MediaStore.Model.InternalServerErrorException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutCorsPolicy">REST API Reference for PutCorsPolicy Operation</seealso> public virtual PutCorsPolicyResponse PutCorsPolicy(PutCorsPolicyRequest request) { var marshaller = new PutCorsPolicyRequestMarshaller(); var unmarshaller = PutCorsPolicyResponseUnmarshaller.Instance; return(Invoke <PutCorsPolicyRequest, PutCorsPolicyResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the PutCorsPolicy operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutCorsPolicy 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutCorsPolicy">REST API Reference for PutCorsPolicy Operation</seealso> public virtual Task <PutCorsPolicyResponse> PutCorsPolicyAsync(PutCorsPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutCorsPolicyRequestMarshaller(); var unmarshaller = PutCorsPolicyResponseUnmarshaller.Instance; return(InvokeAsync <PutCorsPolicyRequest, PutCorsPolicyResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the PutCorsPolicy operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutCorsPolicy operation on AmazonMediaStoreClient.</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 EndPutCorsPolicy /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutCorsPolicy">REST API Reference for PutCorsPolicy Operation</seealso> public virtual IAsyncResult BeginPutCorsPolicy(PutCorsPolicyRequest request, AsyncCallback callback, object state) { var marshaller = PutCorsPolicyRequestMarshaller.Instance; var unmarshaller = PutCorsPolicyResponseUnmarshaller.Instance; return(BeginInvoke <PutCorsPolicyRequest>(request, marshaller, unmarshaller, callback, state)); }
/// <summary> /// Sets the cross-origin resource sharing (CORS) configuration on a container so that /// the container can service cross-origin requests. For example, you might want to enable /// a request whose origin is http://www.example.com to access your AWS Elemental MediaStore /// container at my.example.container.com by using the browser's XMLHttpRequest capability. /// /// /// <para> /// To enable CORS on a container, you attach a CORS policy to the container. In the CORS /// policy, you configure rules that identify origins and the HTTP methods that can be /// executed on your container. The policy can contain up to 398,000 characters. You can /// add up to 100 rules to a CORS policy. If more than one rule applies, the service uses /// the first applicable rule listed. /// </para> /// /// <para> /// To learn more about CORS, see <a href="https://docs.aws.amazon.com/mediastore/latest/ug/cors-policy.html">Cross-Origin /// Resource Sharing (CORS) in AWS Elemental MediaStore</a>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutCorsPolicy service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutCorsPolicy service method, as returned by MediaStore.</returns> /// <exception cref="Amazon.MediaStore.Model.ContainerInUseException"> /// The container that you specified in the request already exists or is being updated. /// </exception> /// <exception cref="Amazon.MediaStore.Model.ContainerNotFoundException"> /// The container that you specified in the request does not exist. /// </exception> /// <exception cref="Amazon.MediaStore.Model.InternalServerErrorException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutCorsPolicy">REST API Reference for PutCorsPolicy Operation</seealso> public virtual Task <PutCorsPolicyResponse> PutCorsPolicyAsync(PutCorsPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutCorsPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = PutCorsPolicyResponseUnmarshaller.Instance; return(InvokeAsync <PutCorsPolicyResponse>(request, options, cancellationToken)); }
internal virtual PutCorsPolicyResponse PutCorsPolicy(PutCorsPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutCorsPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = PutCorsPolicyResponseUnmarshaller.Instance; return(Invoke <PutCorsPolicyResponse>(request, options)); }