private Amazon.Neptune.Model.CreateDBInstanceResponse CallAWSServiceOperation(IAmazonNeptune client, Amazon.Neptune.Model.CreateDBInstanceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Neptune", "CreateDBInstance"); try { #if DESKTOP return(client.CreateDBInstance(request)); #elif CORECLR return(client.CreateDBInstanceAsync(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.Neptune.Model.CreateDBInstanceRequest(); if (cmdletContext.AllocatedStorage != null) { request.AllocatedStorage = cmdletContext.AllocatedStorage.Value; } if (cmdletContext.AutoMinorVersionUpgrade != null) { request.AutoMinorVersionUpgrade = cmdletContext.AutoMinorVersionUpgrade.Value; } if (cmdletContext.AvailabilityZone != null) { request.AvailabilityZone = cmdletContext.AvailabilityZone; } if (cmdletContext.BackupRetentionPeriod != null) { request.BackupRetentionPeriod = cmdletContext.BackupRetentionPeriod.Value; } if (cmdletContext.CharacterSetName != null) { request.CharacterSetName = cmdletContext.CharacterSetName; } if (cmdletContext.CopyTagsToSnapshot != null) { request.CopyTagsToSnapshot = cmdletContext.CopyTagsToSnapshot.Value; } if (cmdletContext.DBClusterIdentifier != null) { request.DBClusterIdentifier = cmdletContext.DBClusterIdentifier; } if (cmdletContext.DBInstanceClass != null) { request.DBInstanceClass = cmdletContext.DBInstanceClass; } if (cmdletContext.DBInstanceIdentifier != null) { request.DBInstanceIdentifier = cmdletContext.DBInstanceIdentifier; } if (cmdletContext.DBName != null) { request.DBName = cmdletContext.DBName; } if (cmdletContext.DBParameterGroupName != null) { request.DBParameterGroupName = cmdletContext.DBParameterGroupName; } if (cmdletContext.DBSecurityGroup != null) { request.DBSecurityGroups = cmdletContext.DBSecurityGroup; } if (cmdletContext.DBSubnetGroupName != null) { request.DBSubnetGroupName = cmdletContext.DBSubnetGroupName; } if (cmdletContext.DeletionProtection != null) { request.DeletionProtection = cmdletContext.DeletionProtection.Value; } if (cmdletContext.Domain != null) { request.Domain = cmdletContext.Domain; } if (cmdletContext.DomainIAMRoleName != null) { request.DomainIAMRoleName = cmdletContext.DomainIAMRoleName; } if (cmdletContext.EnableCloudwatchLogsExport != null) { request.EnableCloudwatchLogsExports = cmdletContext.EnableCloudwatchLogsExport; } if (cmdletContext.EnableIAMDatabaseAuthentication != null) { request.EnableIAMDatabaseAuthentication = cmdletContext.EnableIAMDatabaseAuthentication.Value; } if (cmdletContext.EnablePerformanceInsight != null) { request.EnablePerformanceInsights = cmdletContext.EnablePerformanceInsight.Value; } if (cmdletContext.Engine != null) { request.Engine = cmdletContext.Engine; } if (cmdletContext.EngineVersion != null) { request.EngineVersion = cmdletContext.EngineVersion; } if (cmdletContext.Iops != null) { request.Iops = cmdletContext.Iops.Value; } if (cmdletContext.KmsKeyId != null) { request.KmsKeyId = cmdletContext.KmsKeyId; } if (cmdletContext.LicenseModel != null) { request.LicenseModel = cmdletContext.LicenseModel; } if (cmdletContext.MasterUsername != null) { request.MasterUsername = cmdletContext.MasterUsername; } if (cmdletContext.MasterUserPassword != null) { request.MasterUserPassword = cmdletContext.MasterUserPassword; } if (cmdletContext.MonitoringInterval != null) { request.MonitoringInterval = cmdletContext.MonitoringInterval.Value; } if (cmdletContext.MonitoringRoleArn != null) { request.MonitoringRoleArn = cmdletContext.MonitoringRoleArn; } if (cmdletContext.MultiAZ != null) { request.MultiAZ = cmdletContext.MultiAZ.Value; } if (cmdletContext.OptionGroupName != null) { request.OptionGroupName = cmdletContext.OptionGroupName; } if (cmdletContext.PerformanceInsightsKMSKeyId != null) { request.PerformanceInsightsKMSKeyId = cmdletContext.PerformanceInsightsKMSKeyId; } if (cmdletContext.Port != null) { request.Port = cmdletContext.Port.Value; } if (cmdletContext.PreferredBackupWindow != null) { request.PreferredBackupWindow = cmdletContext.PreferredBackupWindow; } if (cmdletContext.PreferredMaintenanceWindow != null) { request.PreferredMaintenanceWindow = cmdletContext.PreferredMaintenanceWindow; } if (cmdletContext.PromotionTier != null) { request.PromotionTier = cmdletContext.PromotionTier.Value; } #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute if (cmdletContext.PubliclyAccessible != null) { request.PubliclyAccessible = cmdletContext.PubliclyAccessible.Value; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute if (cmdletContext.StorageEncrypted != null) { request.StorageEncrypted = cmdletContext.StorageEncrypted.Value; } if (cmdletContext.StorageType != null) { request.StorageType = cmdletContext.StorageType; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.TdeCredentialArn != null) { request.TdeCredentialArn = cmdletContext.TdeCredentialArn; } if (cmdletContext.TdeCredentialPassword != null) { request.TdeCredentialPassword = cmdletContext.TdeCredentialPassword; } if (cmdletContext.Timezone != null) { request.Timezone = cmdletContext.Timezone; } if (cmdletContext.VpcSecurityGroupId != null) { request.VpcSecurityGroupIds = cmdletContext.VpcSecurityGroupId; } 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); }