private Amazon.TimestreamWrite.Model.UpdateTableResponse CallAWSServiceOperation(IAmazonTimestreamWrite client, Amazon.TimestreamWrite.Model.UpdateTableRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Timestream Write", "UpdateTable"); try { #if DESKTOP return(client.UpdateTable(request)); #elif CORECLR return(client.UpdateTableAsync(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.TimestreamWrite.Model.UpdateTableRequest(); if (cmdletContext.DatabaseName != null) { request.DatabaseName = cmdletContext.DatabaseName; } // populate MagneticStoreWriteProperties var requestMagneticStoreWritePropertiesIsNull = true; request.MagneticStoreWriteProperties = new Amazon.TimestreamWrite.Model.MagneticStoreWriteProperties(); System.Boolean?requestMagneticStoreWriteProperties_magneticStoreWriteProperties_EnableMagneticStoreWrite = null; if (cmdletContext.MagneticStoreWriteProperties_EnableMagneticStoreWrite != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_EnableMagneticStoreWrite = cmdletContext.MagneticStoreWriteProperties_EnableMagneticStoreWrite.Value; } if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_EnableMagneticStoreWrite != null) { request.MagneticStoreWriteProperties.EnableMagneticStoreWrites = requestMagneticStoreWriteProperties_magneticStoreWriteProperties_EnableMagneticStoreWrite.Value; requestMagneticStoreWritePropertiesIsNull = false; } Amazon.TimestreamWrite.Model.MagneticStoreRejectedDataLocation requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation = null; // populate MagneticStoreRejectedDataLocation var requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocationIsNull = true; requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation = new Amazon.TimestreamWrite.Model.MagneticStoreRejectedDataLocation(); Amazon.TimestreamWrite.Model.S3Configuration requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration = null; // populate S3Configuration var requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3ConfigurationIsNull = true; requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration = new Amazon.TimestreamWrite.Model.S3Configuration(); System.String requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_BucketName = null; if (cmdletContext.S3Configuration_BucketName != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_BucketName = cmdletContext.S3Configuration_BucketName; } if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_BucketName != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration.BucketName = requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_BucketName; requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3ConfigurationIsNull = false; } Amazon.TimestreamWrite.S3EncryptionOption requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_EncryptionOption = null; if (cmdletContext.S3Configuration_EncryptionOption != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_EncryptionOption = cmdletContext.S3Configuration_EncryptionOption; } if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_EncryptionOption != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration.EncryptionOption = requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_EncryptionOption; requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3ConfigurationIsNull = false; } System.String requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_KmsKeyId = null; if (cmdletContext.S3Configuration_KmsKeyId != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_KmsKeyId = cmdletContext.S3Configuration_KmsKeyId; } if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_KmsKeyId != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration.KmsKeyId = requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_KmsKeyId; requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3ConfigurationIsNull = false; } System.String requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_ObjectKeyPrefix = null; if (cmdletContext.S3Configuration_ObjectKeyPrefix != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_ObjectKeyPrefix = cmdletContext.S3Configuration_ObjectKeyPrefix; } if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_ObjectKeyPrefix != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration.ObjectKeyPrefix = requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration_s3Configuration_ObjectKeyPrefix; requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3ConfigurationIsNull = false; } // determine if requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration should be set to null if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3ConfigurationIsNull) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration = null; } if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration != null) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation.S3Configuration = requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation_S3Configuration; requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocationIsNull = false; } // determine if requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation should be set to null if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocationIsNull) { requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation = null; } if (requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation != null) { request.MagneticStoreWriteProperties.MagneticStoreRejectedDataLocation = requestMagneticStoreWriteProperties_magneticStoreWriteProperties_MagneticStoreRejectedDataLocation; requestMagneticStoreWritePropertiesIsNull = false; } // determine if request.MagneticStoreWriteProperties should be set to null if (requestMagneticStoreWritePropertiesIsNull) { request.MagneticStoreWriteProperties = null; } // populate RetentionProperties var requestRetentionPropertiesIsNull = true; request.RetentionProperties = new Amazon.TimestreamWrite.Model.RetentionProperties(); System.Int64?requestRetentionProperties_retentionProperties_MagneticStoreRetentionPeriodInDay = null; if (cmdletContext.RetentionProperties_MagneticStoreRetentionPeriodInDay != null) { requestRetentionProperties_retentionProperties_MagneticStoreRetentionPeriodInDay = cmdletContext.RetentionProperties_MagneticStoreRetentionPeriodInDay.Value; } if (requestRetentionProperties_retentionProperties_MagneticStoreRetentionPeriodInDay != null) { request.RetentionProperties.MagneticStoreRetentionPeriodInDays = requestRetentionProperties_retentionProperties_MagneticStoreRetentionPeriodInDay.Value; requestRetentionPropertiesIsNull = false; } System.Int64?requestRetentionProperties_retentionProperties_MemoryStoreRetentionPeriodInHour = null; if (cmdletContext.RetentionProperties_MemoryStoreRetentionPeriodInHour != null) { requestRetentionProperties_retentionProperties_MemoryStoreRetentionPeriodInHour = cmdletContext.RetentionProperties_MemoryStoreRetentionPeriodInHour.Value; } if (requestRetentionProperties_retentionProperties_MemoryStoreRetentionPeriodInHour != null) { request.RetentionProperties.MemoryStoreRetentionPeriodInHours = requestRetentionProperties_retentionProperties_MemoryStoreRetentionPeriodInHour.Value; requestRetentionPropertiesIsNull = false; } // determine if request.RetentionProperties should be set to null if (requestRetentionPropertiesIsNull) { request.RetentionProperties = null; } if (cmdletContext.TableName != null) { request.TableName = cmdletContext.TableName; } 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); }