示例#1
0
 private Amazon.HealthLake.Model.CreateFHIRDatastoreResponse CallAWSServiceOperation(IAmazonHealthLake client, Amazon.HealthLake.Model.CreateFHIRDatastoreRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon HealthLake", "CreateFHIRDatastore");
     try
     {
         #if DESKTOP
         return(client.CreateFHIRDatastore(request));
         #elif CORECLR
         return(client.CreateFHIRDatastoreAsync(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;
     }
 }
示例#2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.HealthLake.Model.CreateFHIRDatastoreRequest();

            if (cmdletContext.ClientToken != null)
            {
                request.ClientToken = cmdletContext.ClientToken;
            }
            if (cmdletContext.DatastoreName != null)
            {
                request.DatastoreName = cmdletContext.DatastoreName;
            }
            if (cmdletContext.DatastoreTypeVersion != null)
            {
                request.DatastoreTypeVersion = cmdletContext.DatastoreTypeVersion;
            }

            // populate PreloadDataConfig
            var requestPreloadDataConfigIsNull = true;

            request.PreloadDataConfig = new Amazon.HealthLake.Model.PreloadDataConfig();
            Amazon.HealthLake.PreloadDataType requestPreloadDataConfig_preloadDataConfig_PreloadDataType = null;
            if (cmdletContext.PreloadDataConfig_PreloadDataType != null)
            {
                requestPreloadDataConfig_preloadDataConfig_PreloadDataType = cmdletContext.PreloadDataConfig_PreloadDataType;
            }
            if (requestPreloadDataConfig_preloadDataConfig_PreloadDataType != null)
            {
                request.PreloadDataConfig.PreloadDataType = requestPreloadDataConfig_preloadDataConfig_PreloadDataType;
                requestPreloadDataConfigIsNull            = false;
            }
            // determine if request.PreloadDataConfig should be set to null
            if (requestPreloadDataConfigIsNull)
            {
                request.PreloadDataConfig = null;
            }

            // populate SseConfiguration
            var requestSseConfigurationIsNull = true;

            request.SseConfiguration = new Amazon.HealthLake.Model.SseConfiguration();
            Amazon.HealthLake.Model.KmsEncryptionConfig requestSseConfiguration_sseConfiguration_KmsEncryptionConfig = null;

            // populate KmsEncryptionConfig
            var requestSseConfiguration_sseConfiguration_KmsEncryptionConfigIsNull = true;

            requestSseConfiguration_sseConfiguration_KmsEncryptionConfig = new Amazon.HealthLake.Model.KmsEncryptionConfig();
            Amazon.HealthLake.CmkType requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_CmkType = null;
            if (cmdletContext.KmsEncryptionConfig_CmkType != null)
            {
                requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_CmkType = cmdletContext.KmsEncryptionConfig_CmkType;
            }
            if (requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_CmkType != null)
            {
                requestSseConfiguration_sseConfiguration_KmsEncryptionConfig.CmkType = requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_CmkType;
                requestSseConfiguration_sseConfiguration_KmsEncryptionConfigIsNull   = false;
            }
            System.String requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_KmsKeyId = null;
            if (cmdletContext.KmsEncryptionConfig_KmsKeyId != null)
            {
                requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_KmsKeyId = cmdletContext.KmsEncryptionConfig_KmsKeyId;
            }
            if (requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_KmsKeyId != null)
            {
                requestSseConfiguration_sseConfiguration_KmsEncryptionConfig.KmsKeyId = requestSseConfiguration_sseConfiguration_KmsEncryptionConfig_kmsEncryptionConfig_KmsKeyId;
                requestSseConfiguration_sseConfiguration_KmsEncryptionConfigIsNull    = false;
            }
            // determine if requestSseConfiguration_sseConfiguration_KmsEncryptionConfig should be set to null
            if (requestSseConfiguration_sseConfiguration_KmsEncryptionConfigIsNull)
            {
                requestSseConfiguration_sseConfiguration_KmsEncryptionConfig = null;
            }
            if (requestSseConfiguration_sseConfiguration_KmsEncryptionConfig != null)
            {
                request.SseConfiguration.KmsEncryptionConfig = requestSseConfiguration_sseConfiguration_KmsEncryptionConfig;
                requestSseConfigurationIsNull = false;
            }
            // determine if request.SseConfiguration should be set to null
            if (requestSseConfigurationIsNull)
            {
                request.SseConfiguration = null;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            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);
        }