private Amazon.CustomerProfiles.Model.PutProfileObjectTypeResponse CallAWSServiceOperation(IAmazonCustomerProfiles client, Amazon.CustomerProfiles.Model.PutProfileObjectTypeRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Customer Profiles", "PutProfileObjectType"); try { #if DESKTOP return(client.PutProfileObjectType(request)); #elif CORECLR return(client.PutProfileObjectTypeAsync(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; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.CustomerProfiles.Model.PutProfileObjectTypeRequest(); if (cmdletContext.AllowProfileCreation != null) { request.AllowProfileCreation = cmdletContext.AllowProfileCreation.Value; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.DomainName != null) { request.DomainName = cmdletContext.DomainName; } if (cmdletContext.EncryptionKey != null) { request.EncryptionKey = cmdletContext.EncryptionKey; } if (cmdletContext.ExpirationDay != null) { request.ExpirationDays = cmdletContext.ExpirationDay.Value; } if (cmdletContext.Field != null) { request.Fields = cmdletContext.Field; } if (cmdletContext.Key != null) { request.Keys = cmdletContext.Key; } if (cmdletContext.ObjectTypeName != null) { request.ObjectTypeName = cmdletContext.ObjectTypeName; } if (cmdletContext.SourceLastUpdatedTimestampFormat != null) { request.SourceLastUpdatedTimestampFormat = cmdletContext.SourceLastUpdatedTimestampFormat; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.TemplateId != null) { request.TemplateId = cmdletContext.TemplateId; } 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); }