public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AlexaForBusiness.Model.CreateProfileRequest(); if (cmdletContext.Address != null) { request.Address = cmdletContext.Address; } if (cmdletContext.ClientRequestToken != null) { request.ClientRequestToken = cmdletContext.ClientRequestToken; } if (cmdletContext.DistanceUnit != null) { request.DistanceUnit = cmdletContext.DistanceUnit; } if (cmdletContext.Locale != null) { request.Locale = cmdletContext.Locale; } if (cmdletContext.MaxVolumeLimit != null) { request.MaxVolumeLimit = cmdletContext.MaxVolumeLimit.Value; } // populate MeetingRoomConfiguration var requestMeetingRoomConfigurationIsNull = true; request.MeetingRoomConfiguration = new Amazon.AlexaForBusiness.Model.CreateMeetingRoomConfiguration(); System.Boolean?requestMeetingRoomConfiguration_meetingRoomConfiguration_RoomUtilizationMetricsEnabled = null; if (cmdletContext.MeetingRoomConfiguration_RoomUtilizationMetricsEnabled != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_RoomUtilizationMetricsEnabled = cmdletContext.MeetingRoomConfiguration_RoomUtilizationMetricsEnabled.Value; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_RoomUtilizationMetricsEnabled != null) { request.MeetingRoomConfiguration.RoomUtilizationMetricsEnabled = requestMeetingRoomConfiguration_meetingRoomConfiguration_RoomUtilizationMetricsEnabled.Value; requestMeetingRoomConfigurationIsNull = false; } Amazon.AlexaForBusiness.Model.CreateInstantBooking requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking = null; // populate InstantBooking var requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBookingIsNull = true; requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking = new Amazon.AlexaForBusiness.Model.CreateInstantBooking(); System.Int32?requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_DurationInMinute = null; if (cmdletContext.InstantBooking_DurationInMinute != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_DurationInMinute = cmdletContext.InstantBooking_DurationInMinute.Value; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_DurationInMinute != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking.DurationInMinutes = requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_DurationInMinute.Value; requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBookingIsNull = false; } System.Boolean?requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_Enabled = null; if (cmdletContext.InstantBooking_Enabled != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_Enabled = cmdletContext.InstantBooking_Enabled.Value; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_Enabled != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking.Enabled = requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking_instantBooking_Enabled.Value; requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBookingIsNull = false; } // determine if requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking should be set to null if (requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBookingIsNull) { requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking = null; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking != null) { request.MeetingRoomConfiguration.InstantBooking = requestMeetingRoomConfiguration_meetingRoomConfiguration_InstantBooking; requestMeetingRoomConfigurationIsNull = false; } Amazon.AlexaForBusiness.Model.CreateRequireCheckIn requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn = null; // populate RequireCheckIn var requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckInIsNull = true; requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn = new Amazon.AlexaForBusiness.Model.CreateRequireCheckIn(); System.Boolean?requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_Enabled = null; if (cmdletContext.RequireCheckIn_Enabled != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_Enabled = cmdletContext.RequireCheckIn_Enabled.Value; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_Enabled != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn.Enabled = requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_Enabled.Value; requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckInIsNull = false; } System.Int32?requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_ReleaseAfterMinute = null; if (cmdletContext.RequireCheckIn_ReleaseAfterMinute != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_ReleaseAfterMinute = cmdletContext.RequireCheckIn_ReleaseAfterMinute.Value; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_ReleaseAfterMinute != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn.ReleaseAfterMinutes = requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn_requireCheckIn_ReleaseAfterMinute.Value; requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckInIsNull = false; } // determine if requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn should be set to null if (requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckInIsNull) { requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn = null; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn != null) { request.MeetingRoomConfiguration.RequireCheckIn = requestMeetingRoomConfiguration_meetingRoomConfiguration_RequireCheckIn; requestMeetingRoomConfigurationIsNull = false; } Amazon.AlexaForBusiness.Model.CreateEndOfMeetingReminder requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder = null; // populate EndOfMeetingReminder var requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminderIsNull = true; requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder = new Amazon.AlexaForBusiness.Model.CreateEndOfMeetingReminder(); System.Boolean?requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_Enabled = null; if (cmdletContext.EndOfMeetingReminder_Enabled != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_Enabled = cmdletContext.EndOfMeetingReminder_Enabled.Value; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_Enabled != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder.Enabled = requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_Enabled.Value; requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminderIsNull = false; } List <System.Int32> requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderAtMinute = null; if (cmdletContext.EndOfMeetingReminder_ReminderAtMinute != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderAtMinute = cmdletContext.EndOfMeetingReminder_ReminderAtMinute; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderAtMinute != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder.ReminderAtMinutes = requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderAtMinute; requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminderIsNull = false; } Amazon.AlexaForBusiness.EndOfMeetingReminderType requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderType = null; if (cmdletContext.EndOfMeetingReminder_ReminderType != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderType = cmdletContext.EndOfMeetingReminder_ReminderType; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderType != null) { requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder.ReminderType = requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder_endOfMeetingReminder_ReminderType; requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminderIsNull = false; } // determine if requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder should be set to null if (requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminderIsNull) { requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder = null; } if (requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder != null) { request.MeetingRoomConfiguration.EndOfMeetingReminder = requestMeetingRoomConfiguration_meetingRoomConfiguration_EndOfMeetingReminder; requestMeetingRoomConfigurationIsNull = false; } // determine if request.MeetingRoomConfiguration should be set to null if (requestMeetingRoomConfigurationIsNull) { request.MeetingRoomConfiguration = null; } if (cmdletContext.Name != null) { request.ProfileName = cmdletContext.Name; } if (cmdletContext.PSTNEnabled != null) { request.PSTNEnabled = cmdletContext.PSTNEnabled.Value; } if (cmdletContext.SetupModeDisabled != null) { request.SetupModeDisabled = cmdletContext.SetupModeDisabled.Value; } if (cmdletContext.TemperatureUnit != null) { request.TemperatureUnit = cmdletContext.TemperatureUnit; } if (cmdletContext.Timezone != null) { request.Timezone = cmdletContext.Timezone; } if (cmdletContext.WakeWord != null) { request.WakeWord = cmdletContext.WakeWord; } 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.AlexaForBusiness.Model.CreateProfileResponse CallAWSServiceOperation(IAmazonAlexaForBusiness client, Amazon.AlexaForBusiness.Model.CreateProfileRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Alexa For Business", "CreateProfile"); try { #if DESKTOP return(client.CreateProfile(request)); #elif CORECLR return(client.CreateProfileAsync(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.AlexaForBusiness.Model.CreateProfileRequest(); if (cmdletContext.Address != null) { request.Address = cmdletContext.Address; } if (cmdletContext.ClientRequestToken != null) { request.ClientRequestToken = cmdletContext.ClientRequestToken; } if (cmdletContext.DistanceUnit != null) { request.DistanceUnit = cmdletContext.DistanceUnit; } if (cmdletContext.Locale != null) { request.Locale = cmdletContext.Locale; } if (cmdletContext.MaxVolumeLimit != null) { request.MaxVolumeLimit = cmdletContext.MaxVolumeLimit.Value; } if (cmdletContext.Name != null) { request.ProfileName = cmdletContext.Name; } if (cmdletContext.PSTNEnabled != null) { request.PSTNEnabled = cmdletContext.PSTNEnabled.Value; } if (cmdletContext.SetupModeDisabled != null) { request.SetupModeDisabled = cmdletContext.SetupModeDisabled.Value; } if (cmdletContext.TemperatureUnit != null) { request.TemperatureUnit = cmdletContext.TemperatureUnit; } if (cmdletContext.Timezone != null) { request.Timezone = cmdletContext.Timezone; } if (cmdletContext.WakeWord != null) { request.WakeWord = cmdletContext.WakeWord; } 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); }