private Amazon.Glue.Model.PutDataCatalogEncryptionSettingsResponse CallAWSServiceOperation(IAmazonGlue client, Amazon.Glue.Model.PutDataCatalogEncryptionSettingsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Glue", "PutDataCatalogEncryptionSettings"); try { #if DESKTOP return(client.PutDataCatalogEncryptionSettings(request)); #elif CORECLR return(client.PutDataCatalogEncryptionSettingsAsync(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.Glue.Model.PutDataCatalogEncryptionSettingsRequest(); if (cmdletContext.CatalogId != null) { request.CatalogId = cmdletContext.CatalogId; } // populate DataCatalogEncryptionSettings var requestDataCatalogEncryptionSettingsIsNull = true; request.DataCatalogEncryptionSettings = new Amazon.Glue.Model.DataCatalogEncryptionSettings(); Amazon.Glue.Model.ConnectionPasswordEncryption requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption = null; // populate ConnectionPasswordEncryption var requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryptionIsNull = true; requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption = new Amazon.Glue.Model.ConnectionPasswordEncryption(); System.String requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_AwsKmsKeyId = null; if (cmdletContext.ConnectionPasswordEncryption_AwsKmsKeyId != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_AwsKmsKeyId = cmdletContext.ConnectionPasswordEncryption_AwsKmsKeyId; } if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_AwsKmsKeyId != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption.AwsKmsKeyId = requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_AwsKmsKeyId; requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryptionIsNull = false; } System.Boolean?requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_ReturnConnectionPasswordEncrypted = null; if (cmdletContext.ConnectionPasswordEncryption_ReturnConnectionPasswordEncrypted != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_ReturnConnectionPasswordEncrypted = cmdletContext.ConnectionPasswordEncryption_ReturnConnectionPasswordEncrypted.Value; } if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_ReturnConnectionPasswordEncrypted != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption.ReturnConnectionPasswordEncrypted = requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption_connectionPasswordEncryption_ReturnConnectionPasswordEncrypted.Value; requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryptionIsNull = false; } // determine if requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption should be set to null if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryptionIsNull) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption = null; } if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption != null) { request.DataCatalogEncryptionSettings.ConnectionPasswordEncryption = requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_ConnectionPasswordEncryption; requestDataCatalogEncryptionSettingsIsNull = false; } Amazon.Glue.Model.EncryptionAtRest requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest = null; // populate EncryptionAtRest var requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRestIsNull = true; requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest = new Amazon.Glue.Model.EncryptionAtRest(); Amazon.Glue.CatalogEncryptionMode requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_CatalogEncryptionMode = null; if (cmdletContext.EncryptionAtRest_CatalogEncryptionMode != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_CatalogEncryptionMode = cmdletContext.EncryptionAtRest_CatalogEncryptionMode; } if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_CatalogEncryptionMode != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest.CatalogEncryptionMode = requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_CatalogEncryptionMode; requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRestIsNull = false; } System.String requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_SseAwsKmsKeyId = null; if (cmdletContext.EncryptionAtRest_SseAwsKmsKeyId != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_SseAwsKmsKeyId = cmdletContext.EncryptionAtRest_SseAwsKmsKeyId; } if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_SseAwsKmsKeyId != null) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest.SseAwsKmsKeyId = requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest_encryptionAtRest_SseAwsKmsKeyId; requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRestIsNull = false; } // determine if requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest should be set to null if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRestIsNull) { requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest = null; } if (requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest != null) { request.DataCatalogEncryptionSettings.EncryptionAtRest = requestDataCatalogEncryptionSettings_dataCatalogEncryptionSettings_EncryptionAtRest; requestDataCatalogEncryptionSettingsIsNull = false; } // determine if request.DataCatalogEncryptionSettings should be set to null if (requestDataCatalogEncryptionSettingsIsNull) { request.DataCatalogEncryptionSettings = 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); }