Container for the parameters to the CreateProvisioningArtifact operation. Create a new provisioning artifact for the specified product. This operation will not work with a product that has been shared with you.
Inheritance: AmazonServiceCatalogRequest
コード例 #1
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateProvisioningArtifact operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningArtifact 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<CreateProvisioningArtifactResponse> CreateProvisioningArtifactAsync(CreateProvisioningArtifactRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateProvisioningArtifactRequestMarshaller();
            var unmarshaller = CreateProvisioningArtifactResponseUnmarshaller.Instance;

            return InvokeAsync<CreateProvisioningArtifactRequest,CreateProvisioningArtifactResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #2
0
        internal CreateProvisioningArtifactResponse CreateProvisioningArtifact(CreateProvisioningArtifactRequest request)
        {
            var marshaller = new CreateProvisioningArtifactRequestMarshaller();
            var unmarshaller = CreateProvisioningArtifactResponseUnmarshaller.Instance;

            return Invoke<CreateProvisioningArtifactRequest,CreateProvisioningArtifactResponse>(request, marshaller, unmarshaller);
        }
コード例 #3
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ServiceCatalog.Model.CreateProvisioningArtifactRequest();

            if (cmdletContext.AcceptLanguage != null)
            {
                request.AcceptLanguage = cmdletContext.AcceptLanguage;
            }
            if (cmdletContext.IdempotencyToken != null)
            {
                request.IdempotencyToken = cmdletContext.IdempotencyToken;
            }

            // populate Parameters
            var requestParametersIsNull = true;

            request.Parameters = new Amazon.ServiceCatalog.Model.ProvisioningArtifactProperties();
            System.String requestParameters_parameters_Description = null;
            if (cmdletContext.Parameters_Description != null)
            {
                requestParameters_parameters_Description = cmdletContext.Parameters_Description;
            }
            if (requestParameters_parameters_Description != null)
            {
                request.Parameters.Description = requestParameters_parameters_Description;
                requestParametersIsNull        = false;
            }
            System.Boolean?requestParameters_parameters_DisableTemplateValidation = null;
            if (cmdletContext.Parameters_DisableTemplateValidation != null)
            {
                requestParameters_parameters_DisableTemplateValidation = cmdletContext.Parameters_DisableTemplateValidation.Value;
            }
            if (requestParameters_parameters_DisableTemplateValidation != null)
            {
                request.Parameters.DisableTemplateValidation = requestParameters_parameters_DisableTemplateValidation.Value;
                requestParametersIsNull = false;
            }
            Dictionary <System.String, System.String> requestParameters_parameters_Info = null;

            if (cmdletContext.Parameters_Info != null)
            {
                requestParameters_parameters_Info = cmdletContext.Parameters_Info;
            }
            if (requestParameters_parameters_Info != null)
            {
                request.Parameters.Info = requestParameters_parameters_Info;
                requestParametersIsNull = false;
            }
            System.String requestParameters_parameters_Name = null;
            if (cmdletContext.Parameters_Name != null)
            {
                requestParameters_parameters_Name = cmdletContext.Parameters_Name;
            }
            if (requestParameters_parameters_Name != null)
            {
                request.Parameters.Name = requestParameters_parameters_Name;
                requestParametersIsNull = false;
            }
            Amazon.ServiceCatalog.ProvisioningArtifactType requestParameters_parameters_Type = null;
            if (cmdletContext.Parameters_Type != null)
            {
                requestParameters_parameters_Type = cmdletContext.Parameters_Type;
            }
            if (requestParameters_parameters_Type != null)
            {
                request.Parameters.Type = requestParameters_parameters_Type;
                requestParametersIsNull = false;
            }
            // determine if request.Parameters should be set to null
            if (requestParametersIsNull)
            {
                request.Parameters = null;
            }
            if (cmdletContext.ProductId != null)
            {
                request.ProductId = cmdletContext.ProductId;
            }

            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);
        }
コード例 #4
0
 private Amazon.ServiceCatalog.Model.CreateProvisioningArtifactResponse CallAWSServiceOperation(IAmazonServiceCatalog client, Amazon.ServiceCatalog.Model.CreateProvisioningArtifactRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Service Catalog", "CreateProvisioningArtifact");
     try
     {
         #if DESKTOP
         return(client.CreateProvisioningArtifact(request));
         #elif CORECLR
         return(client.CreateProvisioningArtifactAsync(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;
     }
 }
コード例 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateProvisioningArtifact operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningArtifact operation on AmazonServiceCatalogClient.</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 EndCreateProvisioningArtifact
        ///         operation.</returns>
        public IAsyncResult BeginCreateProvisioningArtifact(CreateProvisioningArtifactRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateProvisioningArtifactRequestMarshaller();
            var unmarshaller = CreateProvisioningArtifactResponseUnmarshaller.Instance;

            return BeginInvoke<CreateProvisioningArtifactRequest>(request, marshaller, unmarshaller,
                callback, state);
        }