/// <summary> /// Initiates the asynchronous execution of the CreateDomainEntry operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateDomainEntry 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<CreateDomainEntryResponse> CreateDomainEntryAsync(CreateDomainEntryRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateDomainEntryRequestMarshaller(); var unmarshaller = CreateDomainEntryResponseUnmarshaller.Instance; return InvokeAsync<CreateDomainEntryRequest,CreateDomainEntryResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal CreateDomainEntryResponse CreateDomainEntry(CreateDomainEntryRequest request) { var marshaller = new CreateDomainEntryRequestMarshaller(); var unmarshaller = CreateDomainEntryResponseUnmarshaller.Instance; return Invoke<CreateDomainEntryRequest,CreateDomainEntryResponse>(request, marshaller, unmarshaller); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Lightsail.Model.CreateDomainEntryRequest(); // populate DomainEntry var requestDomainEntryIsNull = true; request.DomainEntry = new Amazon.Lightsail.Model.DomainEntry(); System.String requestDomainEntry_domainEntry_Id = null; if (cmdletContext.DomainEntry_Id != null) { requestDomainEntry_domainEntry_Id = cmdletContext.DomainEntry_Id; } if (requestDomainEntry_domainEntry_Id != null) { request.DomainEntry.Id = requestDomainEntry_domainEntry_Id; requestDomainEntryIsNull = false; } System.Boolean?requestDomainEntry_domainEntry_IsAlias = null; if (cmdletContext.DomainEntry_IsAlias != null) { requestDomainEntry_domainEntry_IsAlias = cmdletContext.DomainEntry_IsAlias.Value; } if (requestDomainEntry_domainEntry_IsAlias != null) { request.DomainEntry.IsAlias = requestDomainEntry_domainEntry_IsAlias.Value; requestDomainEntryIsNull = false; } System.String requestDomainEntry_domainEntry_Name = null; if (cmdletContext.DomainEntry_Name != null) { requestDomainEntry_domainEntry_Name = cmdletContext.DomainEntry_Name; } if (requestDomainEntry_domainEntry_Name != null) { request.DomainEntry.Name = requestDomainEntry_domainEntry_Name; requestDomainEntryIsNull = false; } #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute Dictionary <System.String, System.String> requestDomainEntry_domainEntry_Option = null; if (cmdletContext.DomainEntry_Option != null) { requestDomainEntry_domainEntry_Option = cmdletContext.DomainEntry_Option; } if (requestDomainEntry_domainEntry_Option != null) { request.DomainEntry.Options = requestDomainEntry_domainEntry_Option; requestDomainEntryIsNull = false; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute System.String requestDomainEntry_domainEntry_Target = null; if (cmdletContext.DomainEntry_Target != null) { requestDomainEntry_domainEntry_Target = cmdletContext.DomainEntry_Target; } if (requestDomainEntry_domainEntry_Target != null) { request.DomainEntry.Target = requestDomainEntry_domainEntry_Target; requestDomainEntryIsNull = false; } System.String requestDomainEntry_domainEntry_Type = null; if (cmdletContext.DomainEntry_Type != null) { requestDomainEntry_domainEntry_Type = cmdletContext.DomainEntry_Type; } if (requestDomainEntry_domainEntry_Type != null) { request.DomainEntry.Type = requestDomainEntry_domainEntry_Type; requestDomainEntryIsNull = false; } // determine if request.DomainEntry should be set to null if (requestDomainEntryIsNull) { request.DomainEntry = null; } if (cmdletContext.DomainName != null) { request.DomainName = cmdletContext.DomainName; } 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); }
private Amazon.Lightsail.Model.CreateDomainEntryResponse CallAWSServiceOperation(IAmazonLightsail client, Amazon.Lightsail.Model.CreateDomainEntryRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Lightsail", "CreateDomainEntry"); try { #if DESKTOP return(client.CreateDomainEntry(request)); #elif CORECLR return(client.CreateDomainEntryAsync(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; } }
/// <summary> /// Initiates the asynchronous execution of the CreateDomainEntry operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateDomainEntry operation on AmazonLightsailClient.</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 EndCreateDomainEntry /// operation.</returns> public IAsyncResult BeginCreateDomainEntry(CreateDomainEntryRequest request, AsyncCallback callback, object state) { var marshaller = new CreateDomainEntryRequestMarshaller(); var unmarshaller = CreateDomainEntryResponseUnmarshaller.Instance; return BeginInvoke<CreateDomainEntryRequest>(request, marshaller, unmarshaller, callback, state); }