Container for the parameters to the UpdateEndpoint operation. Use to update an endpoint.
상속: AmazonPinpointRequest
 private Amazon.Pinpoint.Model.UpdateEndpointResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateEndpointRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateEndpoint");
     try
     {
         #if DESKTOP
         return(client.UpdateEndpoint(request));
         #elif CORECLR
         return(client.UpdateEndpointAsync(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.Pinpoint.Model.UpdateEndpointRequest();

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

            // populate EndpointRequest
            var requestEndpointRequestIsNull = true;

            request.EndpointRequest = new Amazon.Pinpoint.Model.EndpointRequest();
            System.String requestEndpointRequest_endpointRequest_Address = null;
            if (cmdletContext.EndpointRequest_Address != null)
            {
                requestEndpointRequest_endpointRequest_Address = cmdletContext.EndpointRequest_Address;
            }
            if (requestEndpointRequest_endpointRequest_Address != null)
            {
                request.EndpointRequest.Address = requestEndpointRequest_endpointRequest_Address;
                requestEndpointRequestIsNull    = false;
            }
            Dictionary <System.String, List <System.String> > requestEndpointRequest_endpointRequest_Attribute = null;

            if (cmdletContext.EndpointRequest_Attribute != null)
            {
                requestEndpointRequest_endpointRequest_Attribute = cmdletContext.EndpointRequest_Attribute;
            }
            if (requestEndpointRequest_endpointRequest_Attribute != null)
            {
                request.EndpointRequest.Attributes = requestEndpointRequest_endpointRequest_Attribute;
                requestEndpointRequestIsNull       = false;
            }
            Amazon.Pinpoint.ChannelType requestEndpointRequest_endpointRequest_ChannelType = null;
            if (cmdletContext.EndpointRequest_ChannelType != null)
            {
                requestEndpointRequest_endpointRequest_ChannelType = cmdletContext.EndpointRequest_ChannelType;
            }
            if (requestEndpointRequest_endpointRequest_ChannelType != null)
            {
                request.EndpointRequest.ChannelType = requestEndpointRequest_endpointRequest_ChannelType;
                requestEndpointRequestIsNull        = false;
            }
            System.String requestEndpointRequest_endpointRequest_EffectiveDate = null;
            if (cmdletContext.EndpointRequest_EffectiveDate != null)
            {
                requestEndpointRequest_endpointRequest_EffectiveDate = cmdletContext.EndpointRequest_EffectiveDate;
            }
            if (requestEndpointRequest_endpointRequest_EffectiveDate != null)
            {
                request.EndpointRequest.EffectiveDate = requestEndpointRequest_endpointRequest_EffectiveDate;
                requestEndpointRequestIsNull          = false;
            }
            System.String requestEndpointRequest_endpointRequest_EndpointStatus = null;
            if (cmdletContext.EndpointRequest_EndpointStatus != null)
            {
                requestEndpointRequest_endpointRequest_EndpointStatus = cmdletContext.EndpointRequest_EndpointStatus;
            }
            if (requestEndpointRequest_endpointRequest_EndpointStatus != null)
            {
                request.EndpointRequest.EndpointStatus = requestEndpointRequest_endpointRequest_EndpointStatus;
                requestEndpointRequestIsNull           = false;
            }
            Dictionary <System.String, System.Double> requestEndpointRequest_endpointRequest_Metric = null;

            if (cmdletContext.EndpointRequest_Metric != null)
            {
                requestEndpointRequest_endpointRequest_Metric = cmdletContext.EndpointRequest_Metric;
            }
            if (requestEndpointRequest_endpointRequest_Metric != null)
            {
                request.EndpointRequest.Metrics = requestEndpointRequest_endpointRequest_Metric;
                requestEndpointRequestIsNull    = false;
            }
            System.String requestEndpointRequest_endpointRequest_OptOut = null;
            if (cmdletContext.EndpointRequest_OptOut != null)
            {
                requestEndpointRequest_endpointRequest_OptOut = cmdletContext.EndpointRequest_OptOut;
            }
            if (requestEndpointRequest_endpointRequest_OptOut != null)
            {
                request.EndpointRequest.OptOut = requestEndpointRequest_endpointRequest_OptOut;
                requestEndpointRequestIsNull   = false;
            }
            System.String requestEndpointRequest_endpointRequest_RequestId = null;
            if (cmdletContext.EndpointRequest_RequestId != null)
            {
                requestEndpointRequest_endpointRequest_RequestId = cmdletContext.EndpointRequest_RequestId;
            }
            if (requestEndpointRequest_endpointRequest_RequestId != null)
            {
                request.EndpointRequest.RequestId = requestEndpointRequest_endpointRequest_RequestId;
                requestEndpointRequestIsNull      = false;
            }
            Amazon.Pinpoint.Model.EndpointUser requestEndpointRequest_endpointRequest_User = null;

            // populate User
            var requestEndpointRequest_endpointRequest_UserIsNull = true;

            requestEndpointRequest_endpointRequest_User = new Amazon.Pinpoint.Model.EndpointUser();
            Dictionary <System.String, List <System.String> > requestEndpointRequest_endpointRequest_User_user_UserAttribute = null;

            if (cmdletContext.User_UserAttribute != null)
            {
                requestEndpointRequest_endpointRequest_User_user_UserAttribute = cmdletContext.User_UserAttribute;
            }
            if (requestEndpointRequest_endpointRequest_User_user_UserAttribute != null)
            {
                requestEndpointRequest_endpointRequest_User.UserAttributes = requestEndpointRequest_endpointRequest_User_user_UserAttribute;
                requestEndpointRequest_endpointRequest_UserIsNull          = false;
            }
            System.String requestEndpointRequest_endpointRequest_User_user_UserId = null;
            if (cmdletContext.User_UserId != null)
            {
                requestEndpointRequest_endpointRequest_User_user_UserId = cmdletContext.User_UserId;
            }
            if (requestEndpointRequest_endpointRequest_User_user_UserId != null)
            {
                requestEndpointRequest_endpointRequest_User.UserId = requestEndpointRequest_endpointRequest_User_user_UserId;
                requestEndpointRequest_endpointRequest_UserIsNull  = false;
            }
            // determine if requestEndpointRequest_endpointRequest_User should be set to null
            if (requestEndpointRequest_endpointRequest_UserIsNull)
            {
                requestEndpointRequest_endpointRequest_User = null;
            }
            if (requestEndpointRequest_endpointRequest_User != null)
            {
                request.EndpointRequest.User = requestEndpointRequest_endpointRequest_User;
                requestEndpointRequestIsNull = false;
            }
            Amazon.Pinpoint.Model.EndpointLocation requestEndpointRequest_endpointRequest_Location = null;

            // populate Location
            var requestEndpointRequest_endpointRequest_LocationIsNull = true;

            requestEndpointRequest_endpointRequest_Location = new Amazon.Pinpoint.Model.EndpointLocation();
            System.String requestEndpointRequest_endpointRequest_Location_location_City = null;
            if (cmdletContext.Location_City != null)
            {
                requestEndpointRequest_endpointRequest_Location_location_City = cmdletContext.Location_City;
            }
            if (requestEndpointRequest_endpointRequest_Location_location_City != null)
            {
                requestEndpointRequest_endpointRequest_Location.City  = requestEndpointRequest_endpointRequest_Location_location_City;
                requestEndpointRequest_endpointRequest_LocationIsNull = false;
            }
            System.String requestEndpointRequest_endpointRequest_Location_location_Country = null;
            if (cmdletContext.Location_Country != null)
            {
                requestEndpointRequest_endpointRequest_Location_location_Country = cmdletContext.Location_Country;
            }
            if (requestEndpointRequest_endpointRequest_Location_location_Country != null)
            {
                requestEndpointRequest_endpointRequest_Location.Country = requestEndpointRequest_endpointRequest_Location_location_Country;
                requestEndpointRequest_endpointRequest_LocationIsNull   = false;
            }
            System.Double?requestEndpointRequest_endpointRequest_Location_location_Latitude = null;
            if (cmdletContext.Location_Latitude != null)
            {
                requestEndpointRequest_endpointRequest_Location_location_Latitude = cmdletContext.Location_Latitude.Value;
            }
            if (requestEndpointRequest_endpointRequest_Location_location_Latitude != null)
            {
                requestEndpointRequest_endpointRequest_Location.Latitude = requestEndpointRequest_endpointRequest_Location_location_Latitude.Value;
                requestEndpointRequest_endpointRequest_LocationIsNull    = false;
            }
            System.Double?requestEndpointRequest_endpointRequest_Location_location_Longitude = null;
            if (cmdletContext.Location_Longitude != null)
            {
                requestEndpointRequest_endpointRequest_Location_location_Longitude = cmdletContext.Location_Longitude.Value;
            }
            if (requestEndpointRequest_endpointRequest_Location_location_Longitude != null)
            {
                requestEndpointRequest_endpointRequest_Location.Longitude = requestEndpointRequest_endpointRequest_Location_location_Longitude.Value;
                requestEndpointRequest_endpointRequest_LocationIsNull     = false;
            }
            System.String requestEndpointRequest_endpointRequest_Location_location_PostalCode = null;
            if (cmdletContext.Location_PostalCode != null)
            {
                requestEndpointRequest_endpointRequest_Location_location_PostalCode = cmdletContext.Location_PostalCode;
            }
            if (requestEndpointRequest_endpointRequest_Location_location_PostalCode != null)
            {
                requestEndpointRequest_endpointRequest_Location.PostalCode = requestEndpointRequest_endpointRequest_Location_location_PostalCode;
                requestEndpointRequest_endpointRequest_LocationIsNull      = false;
            }
            System.String requestEndpointRequest_endpointRequest_Location_location_Region = null;
            if (cmdletContext.Location_Region != null)
            {
                requestEndpointRequest_endpointRequest_Location_location_Region = cmdletContext.Location_Region;
            }
            if (requestEndpointRequest_endpointRequest_Location_location_Region != null)
            {
                requestEndpointRequest_endpointRequest_Location.Region = requestEndpointRequest_endpointRequest_Location_location_Region;
                requestEndpointRequest_endpointRequest_LocationIsNull  = false;
            }
            // determine if requestEndpointRequest_endpointRequest_Location should be set to null
            if (requestEndpointRequest_endpointRequest_LocationIsNull)
            {
                requestEndpointRequest_endpointRequest_Location = null;
            }
            if (requestEndpointRequest_endpointRequest_Location != null)
            {
                request.EndpointRequest.Location = requestEndpointRequest_endpointRequest_Location;
                requestEndpointRequestIsNull     = false;
            }
            Amazon.Pinpoint.Model.EndpointDemographic requestEndpointRequest_endpointRequest_Demographic = null;

            // populate Demographic
            var requestEndpointRequest_endpointRequest_DemographicIsNull = true;

            requestEndpointRequest_endpointRequest_Demographic = new Amazon.Pinpoint.Model.EndpointDemographic();
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_AppVersion = null;
            if (cmdletContext.Demographic_AppVersion != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_AppVersion = cmdletContext.Demographic_AppVersion;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_AppVersion != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.AppVersion = requestEndpointRequest_endpointRequest_Demographic_demographic_AppVersion;
                requestEndpointRequest_endpointRequest_DemographicIsNull      = false;
            }
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_Locale = null;
            if (cmdletContext.Demographic_Locale != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_Locale = cmdletContext.Demographic_Locale;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_Locale != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.Locale = requestEndpointRequest_endpointRequest_Demographic_demographic_Locale;
                requestEndpointRequest_endpointRequest_DemographicIsNull  = false;
            }
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_Make = null;
            if (cmdletContext.Demographic_Make != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_Make = cmdletContext.Demographic_Make;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_Make != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.Make  = requestEndpointRequest_endpointRequest_Demographic_demographic_Make;
                requestEndpointRequest_endpointRequest_DemographicIsNull = false;
            }
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_Model = null;
            if (cmdletContext.Demographic_Model != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_Model = cmdletContext.Demographic_Model;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_Model != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.Model = requestEndpointRequest_endpointRequest_Demographic_demographic_Model;
                requestEndpointRequest_endpointRequest_DemographicIsNull = false;
            }
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_ModelVersion = null;
            if (cmdletContext.Demographic_ModelVersion != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_ModelVersion = cmdletContext.Demographic_ModelVersion;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_ModelVersion != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.ModelVersion = requestEndpointRequest_endpointRequest_Demographic_demographic_ModelVersion;
                requestEndpointRequest_endpointRequest_DemographicIsNull        = false;
            }
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_Platform = null;
            if (cmdletContext.Demographic_Platform != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_Platform = cmdletContext.Demographic_Platform;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_Platform != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.Platform = requestEndpointRequest_endpointRequest_Demographic_demographic_Platform;
                requestEndpointRequest_endpointRequest_DemographicIsNull    = false;
            }
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_PlatformVersion = null;
            if (cmdletContext.Demographic_PlatformVersion != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_PlatformVersion = cmdletContext.Demographic_PlatformVersion;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_PlatformVersion != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.PlatformVersion = requestEndpointRequest_endpointRequest_Demographic_demographic_PlatformVersion;
                requestEndpointRequest_endpointRequest_DemographicIsNull           = false;
            }
            System.String requestEndpointRequest_endpointRequest_Demographic_demographic_Timezone = null;
            if (cmdletContext.Demographic_Timezone != null)
            {
                requestEndpointRequest_endpointRequest_Demographic_demographic_Timezone = cmdletContext.Demographic_Timezone;
            }
            if (requestEndpointRequest_endpointRequest_Demographic_demographic_Timezone != null)
            {
                requestEndpointRequest_endpointRequest_Demographic.Timezone = requestEndpointRequest_endpointRequest_Demographic_demographic_Timezone;
                requestEndpointRequest_endpointRequest_DemographicIsNull    = false;
            }
            // determine if requestEndpointRequest_endpointRequest_Demographic should be set to null
            if (requestEndpointRequest_endpointRequest_DemographicIsNull)
            {
                requestEndpointRequest_endpointRequest_Demographic = null;
            }
            if (requestEndpointRequest_endpointRequest_Demographic != null)
            {
                request.EndpointRequest.Demographic = requestEndpointRequest_endpointRequest_Demographic;
                requestEndpointRequestIsNull        = false;
            }
            // determine if request.EndpointRequest should be set to null
            if (requestEndpointRequestIsNull)
            {
                request.EndpointRequest = null;
            }

            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);
        }
예제 #3
0
        /// <summary>
        /// Use to update an endpoint.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateEndpoint service method.</param>
        /// 
        /// <returns>The response from the UpdateEndpoint service method, as returned by Pinpoint.</returns>
        /// <exception cref="Amazon.Pinpoint.Model.BadRequestException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.ForbiddenException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.InternalServerErrorException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.MethodNotAllowedException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.NotFoundException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.TooManyRequestsException">
        /// 
        /// </exception>
        public UpdateEndpointResponse UpdateEndpoint(UpdateEndpointRequest request)
        {
            var marshaller = new UpdateEndpointRequestMarshaller();
            var unmarshaller = UpdateEndpointResponseUnmarshaller.Instance;

            return Invoke<UpdateEndpointRequest,UpdateEndpointResponse>(request, marshaller, unmarshaller);
        }
예제 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateEndpoint operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateEndpoint operation on AmazonPinpointClient.</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 EndUpdateEndpoint
        ///         operation.</returns>
        public IAsyncResult BeginUpdateEndpoint(UpdateEndpointRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateEndpointRequestMarshaller();
            var unmarshaller = UpdateEndpointResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateEndpointRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
예제 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateEndpoint operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateEndpoint 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<UpdateEndpointResponse> UpdateEndpointAsync(UpdateEndpointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateEndpointRequestMarshaller();
            var unmarshaller = UpdateEndpointResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateEndpointRequest,UpdateEndpointResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }