Exemple #1
0
 private Amazon.CustomerProfiles.Model.MergeProfilesResponse CallAWSServiceOperation(IAmazonCustomerProfiles client, Amazon.CustomerProfiles.Model.MergeProfilesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Customer Profiles", "MergeProfiles");
     try
     {
         #if DESKTOP
         return(client.MergeProfiles(request));
         #elif CORECLR
         return(client.MergeProfilesAsync(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;
     }
 }
Exemple #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CustomerProfiles.Model.MergeProfilesRequest();

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

            // populate FieldSourceProfileIds
            var requestFieldSourceProfileIdsIsNull = true;

            request.FieldSourceProfileIds = new Amazon.CustomerProfiles.Model.FieldSourceProfileIds();
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_AccountNumber = null;
            if (cmdletContext.FieldSourceProfileIds_AccountNumber != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_AccountNumber = cmdletContext.FieldSourceProfileIds_AccountNumber;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_AccountNumber != null)
            {
                request.FieldSourceProfileIds.AccountNumber = requestFieldSourceProfileIds_fieldSourceProfileIds_AccountNumber;
                requestFieldSourceProfileIdsIsNull          = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_AdditionalInformation = null;
            if (cmdletContext.FieldSourceProfileIds_AdditionalInformation != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_AdditionalInformation = cmdletContext.FieldSourceProfileIds_AdditionalInformation;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_AdditionalInformation != null)
            {
                request.FieldSourceProfileIds.AdditionalInformation = requestFieldSourceProfileIds_fieldSourceProfileIds_AdditionalInformation;
                requestFieldSourceProfileIdsIsNull = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_Address = null;
            if (cmdletContext.FieldSourceProfileIds_Address != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_Address = cmdletContext.FieldSourceProfileIds_Address;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_Address != null)
            {
                request.FieldSourceProfileIds.Address = requestFieldSourceProfileIds_fieldSourceProfileIds_Address;
                requestFieldSourceProfileIdsIsNull    = false;
            }
            Dictionary <System.String, System.String> requestFieldSourceProfileIds_fieldSourceProfileIds_Attribute = null;

            if (cmdletContext.FieldSourceProfileIds_Attribute != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_Attribute = cmdletContext.FieldSourceProfileIds_Attribute;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_Attribute != null)
            {
                request.FieldSourceProfileIds.Attributes = requestFieldSourceProfileIds_fieldSourceProfileIds_Attribute;
                requestFieldSourceProfileIdsIsNull       = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_BillingAddress = null;
            if (cmdletContext.FieldSourceProfileIds_BillingAddress != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_BillingAddress = cmdletContext.FieldSourceProfileIds_BillingAddress;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_BillingAddress != null)
            {
                request.FieldSourceProfileIds.BillingAddress = requestFieldSourceProfileIds_fieldSourceProfileIds_BillingAddress;
                requestFieldSourceProfileIdsIsNull           = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_BirthDate = null;
            if (cmdletContext.FieldSourceProfileIds_BirthDate != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_BirthDate = cmdletContext.FieldSourceProfileIds_BirthDate;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_BirthDate != null)
            {
                request.FieldSourceProfileIds.BirthDate = requestFieldSourceProfileIds_fieldSourceProfileIds_BirthDate;
                requestFieldSourceProfileIdsIsNull      = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessEmailAddress = null;
            if (cmdletContext.FieldSourceProfileIds_BusinessEmailAddress != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessEmailAddress = cmdletContext.FieldSourceProfileIds_BusinessEmailAddress;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessEmailAddress != null)
            {
                request.FieldSourceProfileIds.BusinessEmailAddress = requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessEmailAddress;
                requestFieldSourceProfileIdsIsNull = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessName = null;
            if (cmdletContext.FieldSourceProfileIds_BusinessName != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessName = cmdletContext.FieldSourceProfileIds_BusinessName;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessName != null)
            {
                request.FieldSourceProfileIds.BusinessName = requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessName;
                requestFieldSourceProfileIdsIsNull         = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessPhoneNumber = null;
            if (cmdletContext.FieldSourceProfileIds_BusinessPhoneNumber != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessPhoneNumber = cmdletContext.FieldSourceProfileIds_BusinessPhoneNumber;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessPhoneNumber != null)
            {
                request.FieldSourceProfileIds.BusinessPhoneNumber = requestFieldSourceProfileIds_fieldSourceProfileIds_BusinessPhoneNumber;
                requestFieldSourceProfileIdsIsNull = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_EmailAddress = null;
            if (cmdletContext.FieldSourceProfileIds_EmailAddress != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_EmailAddress = cmdletContext.FieldSourceProfileIds_EmailAddress;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_EmailAddress != null)
            {
                request.FieldSourceProfileIds.EmailAddress = requestFieldSourceProfileIds_fieldSourceProfileIds_EmailAddress;
                requestFieldSourceProfileIdsIsNull         = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_FirstName = null;
            if (cmdletContext.FieldSourceProfileIds_FirstName != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_FirstName = cmdletContext.FieldSourceProfileIds_FirstName;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_FirstName != null)
            {
                request.FieldSourceProfileIds.FirstName = requestFieldSourceProfileIds_fieldSourceProfileIds_FirstName;
                requestFieldSourceProfileIdsIsNull      = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_Gender = null;
            if (cmdletContext.FieldSourceProfileIds_Gender != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_Gender = cmdletContext.FieldSourceProfileIds_Gender;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_Gender != null)
            {
                request.FieldSourceProfileIds.Gender = requestFieldSourceProfileIds_fieldSourceProfileIds_Gender;
                requestFieldSourceProfileIdsIsNull   = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_HomePhoneNumber = null;
            if (cmdletContext.FieldSourceProfileIds_HomePhoneNumber != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_HomePhoneNumber = cmdletContext.FieldSourceProfileIds_HomePhoneNumber;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_HomePhoneNumber != null)
            {
                request.FieldSourceProfileIds.HomePhoneNumber = requestFieldSourceProfileIds_fieldSourceProfileIds_HomePhoneNumber;
                requestFieldSourceProfileIdsIsNull            = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_LastName = null;
            if (cmdletContext.FieldSourceProfileIds_LastName != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_LastName = cmdletContext.FieldSourceProfileIds_LastName;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_LastName != null)
            {
                request.FieldSourceProfileIds.LastName = requestFieldSourceProfileIds_fieldSourceProfileIds_LastName;
                requestFieldSourceProfileIdsIsNull     = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_MailingAddress = null;
            if (cmdletContext.FieldSourceProfileIds_MailingAddress != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_MailingAddress = cmdletContext.FieldSourceProfileIds_MailingAddress;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_MailingAddress != null)
            {
                request.FieldSourceProfileIds.MailingAddress = requestFieldSourceProfileIds_fieldSourceProfileIds_MailingAddress;
                requestFieldSourceProfileIdsIsNull           = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_MiddleName = null;
            if (cmdletContext.FieldSourceProfileIds_MiddleName != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_MiddleName = cmdletContext.FieldSourceProfileIds_MiddleName;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_MiddleName != null)
            {
                request.FieldSourceProfileIds.MiddleName = requestFieldSourceProfileIds_fieldSourceProfileIds_MiddleName;
                requestFieldSourceProfileIdsIsNull       = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_MobilePhoneNumber = null;
            if (cmdletContext.FieldSourceProfileIds_MobilePhoneNumber != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_MobilePhoneNumber = cmdletContext.FieldSourceProfileIds_MobilePhoneNumber;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_MobilePhoneNumber != null)
            {
                request.FieldSourceProfileIds.MobilePhoneNumber = requestFieldSourceProfileIds_fieldSourceProfileIds_MobilePhoneNumber;
                requestFieldSourceProfileIdsIsNull = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_PartyType = null;
            if (cmdletContext.FieldSourceProfileIds_PartyType != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_PartyType = cmdletContext.FieldSourceProfileIds_PartyType;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_PartyType != null)
            {
                request.FieldSourceProfileIds.PartyType = requestFieldSourceProfileIds_fieldSourceProfileIds_PartyType;
                requestFieldSourceProfileIdsIsNull      = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_PersonalEmailAddress = null;
            if (cmdletContext.FieldSourceProfileIds_PersonalEmailAddress != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_PersonalEmailAddress = cmdletContext.FieldSourceProfileIds_PersonalEmailAddress;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_PersonalEmailAddress != null)
            {
                request.FieldSourceProfileIds.PersonalEmailAddress = requestFieldSourceProfileIds_fieldSourceProfileIds_PersonalEmailAddress;
                requestFieldSourceProfileIdsIsNull = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_PhoneNumber = null;
            if (cmdletContext.FieldSourceProfileIds_PhoneNumber != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_PhoneNumber = cmdletContext.FieldSourceProfileIds_PhoneNumber;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_PhoneNumber != null)
            {
                request.FieldSourceProfileIds.PhoneNumber = requestFieldSourceProfileIds_fieldSourceProfileIds_PhoneNumber;
                requestFieldSourceProfileIdsIsNull        = false;
            }
            System.String requestFieldSourceProfileIds_fieldSourceProfileIds_ShippingAddress = null;
            if (cmdletContext.FieldSourceProfileIds_ShippingAddress != null)
            {
                requestFieldSourceProfileIds_fieldSourceProfileIds_ShippingAddress = cmdletContext.FieldSourceProfileIds_ShippingAddress;
            }
            if (requestFieldSourceProfileIds_fieldSourceProfileIds_ShippingAddress != null)
            {
                request.FieldSourceProfileIds.ShippingAddress = requestFieldSourceProfileIds_fieldSourceProfileIds_ShippingAddress;
                requestFieldSourceProfileIdsIsNull            = false;
            }
            // determine if request.FieldSourceProfileIds should be set to null
            if (requestFieldSourceProfileIdsIsNull)
            {
                request.FieldSourceProfileIds = null;
            }
            if (cmdletContext.MainProfileId != null)
            {
                request.MainProfileId = cmdletContext.MainProfileId;
            }
            if (cmdletContext.ProfileIdsToBeMerged != null)
            {
                request.ProfileIdsToBeMerged = cmdletContext.ProfileIdsToBeMerged;
            }

            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);
        }