private Amazon.Chime.Model.PutAppInstanceRetentionSettingsResponse CallAWSServiceOperation(IAmazonChime client, Amazon.Chime.Model.PutAppInstanceRetentionSettingsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Chime", "PutAppInstanceRetentionSettings"); try { #if DESKTOP return(client.PutAppInstanceRetentionSettings(request)); #elif CORECLR return(client.PutAppInstanceRetentionSettingsAsync(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.Chime.Model.PutAppInstanceRetentionSettingsRequest(); if (cmdletContext.AppInstanceArn != null) { request.AppInstanceArn = cmdletContext.AppInstanceArn; } // populate AppInstanceRetentionSettings var requestAppInstanceRetentionSettingsIsNull = true; request.AppInstanceRetentionSettings = new Amazon.Chime.Model.AppInstanceRetentionSettings(); Amazon.Chime.Model.ChannelRetentionSettings requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings = null; // populate ChannelRetentionSettings var requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettingsIsNull = true; requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings = new Amazon.Chime.Model.ChannelRetentionSettings(); System.Int32?requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings_channelRetentionSettings_RetentionDay = null; if (cmdletContext.ChannelRetentionSettings_RetentionDay != null) { requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings_channelRetentionSettings_RetentionDay = cmdletContext.ChannelRetentionSettings_RetentionDay.Value; } if (requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings_channelRetentionSettings_RetentionDay != null) { requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings.RetentionDays = requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings_channelRetentionSettings_RetentionDay.Value; requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettingsIsNull = false; } // determine if requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings should be set to null if (requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettingsIsNull) { requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings = null; } if (requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings != null) { request.AppInstanceRetentionSettings.ChannelRetentionSettings = requestAppInstanceRetentionSettings_appInstanceRetentionSettings_ChannelRetentionSettings; requestAppInstanceRetentionSettingsIsNull = false; } // determine if request.AppInstanceRetentionSettings should be set to null if (requestAppInstanceRetentionSettingsIsNull) { request.AppInstanceRetentionSettings = 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); }