/*******************************************************************************
* Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* *****************************************************************************
*
* AWS Tools for Windows (TM) PowerShell (TM)
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Amazon.PowerShell.Common;
using Amazon.Runtime;
using Amazon.Neptune;
using Amazon.Neptune.Model;
namespace Amazon.PowerShell.Cmdlets.NPT
{
///
/// Modifies settings for a DB instance. You can change one or more database configuration
/// parameters by specifying these parameters and the new values in the request. To learn
/// what modifications you can make to your DB instance, call DescribeValidDBInstanceModifications
/// before you call ModifyDBInstance.
///
[Cmdlet("Edit", "NPTDBInstance", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]
[OutputType("Amazon.Neptune.Model.DBInstance")]
[AWSCmdlet("Calls the Amazon Neptune ModifyDBInstance API operation.", Operation = new[] {"ModifyDBInstance"}, SelectReturnType = typeof(Amazon.Neptune.Model.ModifyDBInstanceResponse))]
[AWSCmdletOutput("Amazon.Neptune.Model.DBInstance or Amazon.Neptune.Model.ModifyDBInstanceResponse",
"This cmdlet returns an Amazon.Neptune.Model.DBInstance object.",
"The service call response (type Amazon.Neptune.Model.ModifyDBInstanceResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class EditNPTDBInstanceCmdlet : AmazonNeptuneClientCmdlet, IExecutor
{
#region Parameter AllocatedStorage
///
///
/// Not supported by Neptune.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? AllocatedStorage { get; set; }
#endregion
#region Parameter AllowMajorVersionUpgrade
///
///
/// Indicates that major version upgrades are allowed. Changing this parameter doesn't
/// result in an outage and the change is asynchronously applied as soon as possible.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? AllowMajorVersionUpgrade { get; set; }
#endregion
#region Parameter ApplyImmediately
///
///
/// Specifies whether the modifications in this request and any pending modifications
/// are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow
/// setting for the DB instance. If this parameter is set to false
, changes to the DB instance are applied
/// during the next maintenance window. Some parameter changes can cause an outage and
/// are applied on the next call to RebootDBInstance, or the next failure reboot.Default: false
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? ApplyImmediately { get; set; }
#endregion
#region Parameter AutoMinorVersionUpgrade
///
///
/// Indicates that minor version upgrades are applied automatically to the DB instance
/// during the maintenance window. Changing this parameter doesn't result in an outage
/// except in the following case and the change is asynchronously applied as soon as possible.
/// An outage will result if this parameter is set to true
during the maintenance
/// window, and a newer minor version is available, and Neptune has enabled auto patching
/// for that engine version.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? AutoMinorVersionUpgrade { get; set; }
#endregion
#region Parameter BackupRetentionPeriod
///
///
/// Not applicable. The retention period for automated backups is managed by the DB cluster.
/// For more information, see ModifyDBCluster.Default: Uses existing setting
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? BackupRetentionPeriod { get; set; }
#endregion
#region Parameter CACertificateIdentifier
///
///
/// Indicates the certificate that needs to be associated with the instance.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String CACertificateIdentifier { get; set; }
#endregion
#region Parameter CopyTagsToSnapshot
///
///
/// True to copy all tags from the DB instance to snapshots of the DB instance, and otherwise
/// false. The default is false.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? CopyTagsToSnapshot { get; set; }
#endregion
#region Parameter DBInstanceClass
///
///
/// The new compute and memory capacity of the DB instance, for example, db.m4.large
.
/// Not all DB instance classes are available in all Amazon Regions.If you modify the DB instance class, an outage occurs during the change. The change
/// is applied during the next maintenance window, unless ApplyImmediately
/// is specified as true
for this request.Default: Uses existing setting
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String DBInstanceClass { get; set; }
#endregion
#region Parameter DBInstanceIdentifier
///
///
/// The DB instance identifier. This value is stored as a lowercase string.Constraints:- Must match the identifier of an existing DBInstance.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]
#else
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String DBInstanceIdentifier { get; set; }
#endregion
#region Parameter DBParameterGroupName
///
///
/// The name of the DB parameter group to apply to the DB instance. Changing this setting
/// doesn't result in an outage. The parameter group name itself is changed immediately,
/// but the actual parameter changes are not applied until you reboot the instance without
/// failover. The db instance will NOT be rebooted automatically and the parameter changes
/// will NOT be applied during the next maintenance window.Default: Uses existing settingConstraints: The DB parameter group must be in the same DB parameter group family
/// as this DB instance.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String DBParameterGroupName { get; set; }
#endregion
#region Parameter DBPortNumber
///
///
/// The port number on which the database accepts connections.The value of the DBPortNumber
parameter must not match any of the port
/// values specified for options in the option group for the DB instance.Your database will restart when you change the DBPortNumber
value regardless
/// of the value of the ApplyImmediately
parameter. Default: 8182
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? DBPortNumber { get; set; }
#endregion
#region Parameter DBSecurityGroup
///
///
/// A list of DB security groups to authorize on this DB instance. Changing this setting
/// doesn't result in an outage and the change is asynchronously applied as soon as possible.Constraints:- If supplied, must match existing DBSecurityGroups.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("DBSecurityGroups")]
public System.String[] DBSecurityGroup { get; set; }
#endregion
#region Parameter DBSubnetGroupName
///
///
/// The new DB subnet group for the DB instance. You can use this parameter to move your
/// DB instance to a different VPC.Changing the subnet group causes an outage during the change. The change is applied
/// during the next maintenance window, unless you specify true
for the ApplyImmediately
/// parameter.Constraints: If supplied, must match the name of an existing DBSubnetGroup.Example: mySubnetGroup
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String DBSubnetGroupName { get; set; }
#endregion
#region Parameter DeletionProtection
///
///
/// A value that indicates whether the DB instance has deletion protection enabled. The
/// database can't be deleted when deletion protection is enabled. By default, deletion
/// protection is disabled. See Deleting
/// a DB Instance.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? DeletionProtection { get; set; }
#endregion
#region Parameter CloudwatchLogsExportConfiguration_DisableLogType
///
///
/// The list of log types to disable.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("CloudwatchLogsExportConfiguration_DisableLogTypes")]
public System.String[] CloudwatchLogsExportConfiguration_DisableLogType { get; set; }
#endregion
#region Parameter Domain
///
///
/// Not supported.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Domain { get; set; }
#endregion
#region Parameter DomainIAMRoleName
///
///
/// Not supported
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String DomainIAMRoleName { get; set; }
#endregion
#region Parameter EnableIAMDatabaseAuthentication
///
///
/// True to enable mapping of Amazon Identity and Access Management (IAM) accounts to
/// database accounts, and otherwise false.You can enable IAM database authentication for the following database enginesNot applicable. Mapping Amazon IAM accounts to database accounts is managed by the
/// DB cluster. For more information, see ModifyDBCluster.Default: false
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? EnableIAMDatabaseAuthentication { get; set; }
#endregion
#region Parameter CloudwatchLogsExportConfiguration_EnableLogType
///
///
/// The list of log types to enable.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("CloudwatchLogsExportConfiguration_EnableLogTypes")]
public System.String[] CloudwatchLogsExportConfiguration_EnableLogType { get; set; }
#endregion
#region Parameter EnablePerformanceInsight
///
///
/// (Not supported by Neptune)
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("EnablePerformanceInsights")]
public System.Boolean? EnablePerformanceInsight { get; set; }
#endregion
#region Parameter EngineVersion
///
///
/// The version number of the database engine to upgrade to. Currently, setting this parameter
/// has no effect. To upgrade your database engine to the most recent release, use the
/// ApplyPendingMaintenanceAction API.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String EngineVersion { get; set; }
#endregion
#region Parameter Iops
///
///
/// The new Provisioned IOPS (I/O operations per second) value for the instance.Changing this setting doesn't result in an outage and the change is applied during
/// the next maintenance window unless the ApplyImmediately
parameter is
/// set to true
for this request.Default: Uses existing setting
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? Iops { get; set; }
#endregion
#region Parameter LicenseModel
///
///
/// Not supported by Neptune.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String LicenseModel { get; set; }
#endregion
#region Parameter MasterUserPassword
///
///
/// Not supported by Neptune.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String MasterUserPassword { get; set; }
#endregion
#region Parameter MonitoringInterval
///
///
/// The interval, in seconds, between points when Enhanced Monitoring metrics are collected
/// for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0.
/// The default is 0.If MonitoringRoleArn
is specified, then you must also set MonitoringInterval
/// to a value other than 0.Valid Values: 0, 1, 5, 10, 15, 30, 60
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? MonitoringInterval { get; set; }
#endregion
#region Parameter MonitoringRoleArn
///
///
/// The ARN for the IAM role that permits Neptune to send enhanced monitoring metrics
/// to Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess
.If MonitoringInterval
is set to a value other than 0, then you must supply
/// a MonitoringRoleArn
value.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String MonitoringRoleArn { get; set; }
#endregion
#region Parameter MultiAZ
///
///
/// Specifies if the DB instance is a Multi-AZ deployment. Changing this parameter doesn't
/// result in an outage and the change is applied during the next maintenance window unless
/// the ApplyImmediately
parameter is set to true
for this request.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? MultiAZ { get; set; }
#endregion
#region Parameter NewDBInstanceIdentifier
///
///
/// The new DB instance identifier for the DB instance when renaming a DB instance. When
/// you change the DB instance identifier, an instance reboot will occur immediately if
/// you set Apply Immediately
to true, or will occur during the next maintenance
/// window if Apply Immediately
to false. This value is stored as a lowercase
/// string.Constraints:- Must contain from 1 to 63 letters, numbers, or hyphens.
- The first character must be a letter.
- Cannot end with a hyphen or contain two consecutive hyphens.
Example: mydbinstance
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String NewDBInstanceIdentifier { get; set; }
#endregion
#region Parameter OptionGroupName
///
///
/// (Not supported by Neptune)
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String OptionGroupName { get; set; }
#endregion
#region Parameter PerformanceInsightsKMSKeyId
///
///
/// (Not supported by Neptune)
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String PerformanceInsightsKMSKeyId { get; set; }
#endregion
#region Parameter PreferredBackupWindow
///
///
/// The daily time range during which automated backups are created if automated backups
/// are enabled.Not applicable. The daily time range for creating automated backups is managed by
/// the DB cluster. For more information, see ModifyDBCluster.Constraints:- Must be in the format hh24:mi-hh24:mi
- Must be in Universal Time Coordinated (UTC)
- Must not conflict with the preferred maintenance window
- Must be at least 30 minutes
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String PreferredBackupWindow { get; set; }
#endregion
#region Parameter PreferredMaintenanceWindow
///
///
/// The weekly time range (in UTC) during which system maintenance can occur, which might
/// result in an outage. Changing this parameter doesn't result in an outage, except in
/// the following situation, and the change is asynchronously applied as soon as possible.
/// If there are pending actions that cause a reboot, and the maintenance window is changed
/// to include the current time, then changing this parameter will cause a reboot of the
/// DB instance. If moving this window to the current time, there must be at least 30
/// minutes between the current time and end of the window to ensure pending changes are
/// applied.Default: Uses existing settingFormat: ddd:hh24:mi-ddd:hh24:miValid Days: Mon | Tue | Wed | Thu | Fri | Sat | SunConstraints: Must be at least 30 minutes
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String PreferredMaintenanceWindow { get; set; }
#endregion
#region Parameter PromotionTier
///
///
/// A value that specifies the order in which a Read Replica is promoted to the primary
/// instance after a failure of the existing primary instance.Default: 1Valid Values: 0 - 15
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? PromotionTier { get; set; }
#endregion
#region Parameter StorageType
///
///
/// Not supported.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String StorageType { get; set; }
#endregion
#region Parameter TdeCredentialArn
///
///
/// The ARN from the key store with which to associate the instance for TDE encryption.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String TdeCredentialArn { get; set; }
#endregion
#region Parameter TdeCredentialPassword
///
///
/// The password for the given ARN from the key store in order to access the device.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String TdeCredentialPassword { get; set; }
#endregion
#region Parameter VpcSecurityGroupId
///
///
/// A list of EC2 VPC security groups to authorize on this DB instance. This change is
/// asynchronously applied as soon as possible.Not applicable. The associated list of EC2 VPC security groups is managed by the DB
/// cluster. For more information, see ModifyDBCluster.Constraints:- If supplied, must match existing VpcSecurityGroupIds.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("VpcSecurityGroupIds")]
public System.String[] VpcSecurityGroupId { get; set; }
#endregion
#region Parameter PubliclyAccessible
///
///
/// This flag should no longer be used.
///
/// This parameter is deprecated.
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[System.ObsoleteAttribute("This parameter is not supported")]
public System.Boolean? PubliclyAccessible { get; set; }
#endregion
#region Parameter Select
///
/// Use the -Select parameter to control the cmdlet output. The default value is 'DBInstance'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Neptune.Model.ModifyDBInstanceResponse).
/// Specifying the name of a property of type Amazon.Neptune.Model.ModifyDBInstanceResponse will result in that property being returned.
/// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public string Select { get; set; } = "DBInstance";
#endregion
#region Parameter PassThru
///
/// Changes the cmdlet behavior to return the value passed to the DBInstanceIdentifier parameter.
/// The -PassThru parameter is deprecated, use -Select '^DBInstanceIdentifier' instead. This parameter will be removed in a future version.
///
[System.Obsolete("The -PassThru parameter is deprecated, use -Select '^DBInstanceIdentifier' instead. This parameter will be removed in a future version.")]
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter PassThru { get; set; }
#endregion
#region Parameter Force
///
/// This parameter overrides confirmation prompts to force
/// the cmdlet to continue its operation. This parameter should always
/// be used with caution.
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter Force { get; set; }
#endregion
protected override void ProcessRecord()
{
this._AWSSignerType = "v4";
base.ProcessRecord();
var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.DBInstanceIdentifier), MyInvocation.BoundParameters);
if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "Edit-NPTDBInstance (ModifyDBInstance)"))
{
return;
}
var context = new CmdletContext();
// allow for manipulation of parameters prior to loading into context
PreExecutionContextLoad(context);
#pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
if (ParameterWasBound(nameof(this.Select)))
{
context.Select = CreateSelectDelegate(Select) ??
throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select));
if (this.PassThru.IsPresent)
{
throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select));
}
}
else if (this.PassThru.IsPresent)
{
context.Select = (response, cmdlet) => this.DBInstanceIdentifier;
}
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.AllocatedStorage = this.AllocatedStorage;
context.AllowMajorVersionUpgrade = this.AllowMajorVersionUpgrade;
context.ApplyImmediately = this.ApplyImmediately;
context.AutoMinorVersionUpgrade = this.AutoMinorVersionUpgrade;
context.BackupRetentionPeriod = this.BackupRetentionPeriod;
context.CACertificateIdentifier = this.CACertificateIdentifier;
if (this.CloudwatchLogsExportConfiguration_DisableLogType != null)
{
context.CloudwatchLogsExportConfiguration_DisableLogType = new List(this.CloudwatchLogsExportConfiguration_DisableLogType);
}
if (this.CloudwatchLogsExportConfiguration_EnableLogType != null)
{
context.CloudwatchLogsExportConfiguration_EnableLogType = new List(this.CloudwatchLogsExportConfiguration_EnableLogType);
}
context.CopyTagsToSnapshot = this.CopyTagsToSnapshot;
context.DBInstanceClass = this.DBInstanceClass;
context.DBInstanceIdentifier = this.DBInstanceIdentifier;
#if MODULAR
if (this.DBInstanceIdentifier == null && ParameterWasBound(nameof(this.DBInstanceIdentifier)))
{
WriteWarning("You are passing $null as a value for parameter DBInstanceIdentifier which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.DBParameterGroupName = this.DBParameterGroupName;
context.DBPortNumber = this.DBPortNumber;
if (this.DBSecurityGroup != null)
{
context.DBSecurityGroup = new List(this.DBSecurityGroup);
}
context.DBSubnetGroupName = this.DBSubnetGroupName;
context.DeletionProtection = this.DeletionProtection;
context.Domain = this.Domain;
context.DomainIAMRoleName = this.DomainIAMRoleName;
context.EnableIAMDatabaseAuthentication = this.EnableIAMDatabaseAuthentication;
context.EnablePerformanceInsight = this.EnablePerformanceInsight;
context.EngineVersion = this.EngineVersion;
context.Iops = this.Iops;
context.LicenseModel = this.LicenseModel;
context.MasterUserPassword = this.MasterUserPassword;
context.MonitoringInterval = this.MonitoringInterval;
context.MonitoringRoleArn = this.MonitoringRoleArn;
context.MultiAZ = this.MultiAZ;
context.NewDBInstanceIdentifier = this.NewDBInstanceIdentifier;
context.OptionGroupName = this.OptionGroupName;
context.PerformanceInsightsKMSKeyId = this.PerformanceInsightsKMSKeyId;
context.PreferredBackupWindow = this.PreferredBackupWindow;
context.PreferredMaintenanceWindow = this.PreferredMaintenanceWindow;
context.PromotionTier = this.PromotionTier;
#pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.PubliclyAccessible = this.PubliclyAccessible;
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.StorageType = this.StorageType;
context.TdeCredentialArn = this.TdeCredentialArn;
context.TdeCredentialPassword = this.TdeCredentialPassword;
if (this.VpcSecurityGroupId != null)
{
context.VpcSecurityGroupId = new List(this.VpcSecurityGroupId);
}
// allow further manipulation of loaded context prior to processing
PostExecutionContextLoad(context);
var output = Execute(context) as CmdletOutput;
ProcessOutput(output);
}
#region IExecutor Members
public object Execute(ExecutorContext context)
{
var cmdletContext = context as CmdletContext;
// create request
var request = new Amazon.Neptune.Model.ModifyDBInstanceRequest();
if (cmdletContext.AllocatedStorage != null)
{
request.AllocatedStorage = cmdletContext.AllocatedStorage.Value;
}
if (cmdletContext.AllowMajorVersionUpgrade != null)
{
request.AllowMajorVersionUpgrade = cmdletContext.AllowMajorVersionUpgrade.Value;
}
if (cmdletContext.ApplyImmediately != null)
{
request.ApplyImmediately = cmdletContext.ApplyImmediately.Value;
}
if (cmdletContext.AutoMinorVersionUpgrade != null)
{
request.AutoMinorVersionUpgrade = cmdletContext.AutoMinorVersionUpgrade.Value;
}
if (cmdletContext.BackupRetentionPeriod != null)
{
request.BackupRetentionPeriod = cmdletContext.BackupRetentionPeriod.Value;
}
if (cmdletContext.CACertificateIdentifier != null)
{
request.CACertificateIdentifier = cmdletContext.CACertificateIdentifier;
}
// populate CloudwatchLogsExportConfiguration
var requestCloudwatchLogsExportConfigurationIsNull = true;
request.CloudwatchLogsExportConfiguration = new Amazon.Neptune.Model.CloudwatchLogsExportConfiguration();
List requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_DisableLogType = null;
if (cmdletContext.CloudwatchLogsExportConfiguration_DisableLogType != null)
{
requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_DisableLogType = cmdletContext.CloudwatchLogsExportConfiguration_DisableLogType;
}
if (requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_DisableLogType != null)
{
request.CloudwatchLogsExportConfiguration.DisableLogTypes = requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_DisableLogType;
requestCloudwatchLogsExportConfigurationIsNull = false;
}
List requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_EnableLogType = null;
if (cmdletContext.CloudwatchLogsExportConfiguration_EnableLogType != null)
{
requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_EnableLogType = cmdletContext.CloudwatchLogsExportConfiguration_EnableLogType;
}
if (requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_EnableLogType != null)
{
request.CloudwatchLogsExportConfiguration.EnableLogTypes = requestCloudwatchLogsExportConfiguration_cloudwatchLogsExportConfiguration_EnableLogType;
requestCloudwatchLogsExportConfigurationIsNull = false;
}
// determine if request.CloudwatchLogsExportConfiguration should be set to null
if (requestCloudwatchLogsExportConfigurationIsNull)
{
request.CloudwatchLogsExportConfiguration = null;
}
if (cmdletContext.CopyTagsToSnapshot != null)
{
request.CopyTagsToSnapshot = cmdletContext.CopyTagsToSnapshot.Value;
}
if (cmdletContext.DBInstanceClass != null)
{
request.DBInstanceClass = cmdletContext.DBInstanceClass;
}
if (cmdletContext.DBInstanceIdentifier != null)
{
request.DBInstanceIdentifier = cmdletContext.DBInstanceIdentifier;
}
if (cmdletContext.DBParameterGroupName != null)
{
request.DBParameterGroupName = cmdletContext.DBParameterGroupName;
}
if (cmdletContext.DBPortNumber != null)
{
request.DBPortNumber = cmdletContext.DBPortNumber.Value;
}
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.EnableIAMDatabaseAuthentication != null)
{
request.EnableIAMDatabaseAuthentication = cmdletContext.EnableIAMDatabaseAuthentication.Value;
}
if (cmdletContext.EnablePerformanceInsight != null)
{
request.EnablePerformanceInsights = cmdletContext.EnablePerformanceInsight.Value;
}
if (cmdletContext.EngineVersion != null)
{
request.EngineVersion = cmdletContext.EngineVersion;
}
if (cmdletContext.Iops != null)
{
request.Iops = cmdletContext.Iops.Value;
}
if (cmdletContext.LicenseModel != null)
{
request.LicenseModel = cmdletContext.LicenseModel;
}
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.NewDBInstanceIdentifier != null)
{
request.NewDBInstanceIdentifier = cmdletContext.NewDBInstanceIdentifier;
}
if (cmdletContext.OptionGroupName != null)
{
request.OptionGroupName = cmdletContext.OptionGroupName;
}
if (cmdletContext.PerformanceInsightsKMSKeyId != null)
{
request.PerformanceInsightsKMSKeyId = cmdletContext.PerformanceInsightsKMSKeyId;
}
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.StorageType != null)
{
request.StorageType = cmdletContext.StorageType;
}
if (cmdletContext.TdeCredentialArn != null)
{
request.TdeCredentialArn = cmdletContext.TdeCredentialArn;
}
if (cmdletContext.TdeCredentialPassword != null)
{
request.TdeCredentialPassword = cmdletContext.TdeCredentialPassword;
}
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;
}
public ExecutorContext CreateContext()
{
return new CmdletContext();
}
#endregion
#region AWS Service Operation Call
private Amazon.Neptune.Model.ModifyDBInstanceResponse CallAWSServiceOperation(IAmazonNeptune client, Amazon.Neptune.Model.ModifyDBInstanceRequest request)
{
Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Neptune", "ModifyDBInstance");
try
{
#if DESKTOP
return client.ModifyDBInstance(request);
#elif CORECLR
return client.ModifyDBInstanceAsync(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;
}
}
#endregion
internal partial class CmdletContext : ExecutorContext
{
public System.Int32? AllocatedStorage { get; set; }
public System.Boolean? AllowMajorVersionUpgrade { get; set; }
public System.Boolean? ApplyImmediately { get; set; }
public System.Boolean? AutoMinorVersionUpgrade { get; set; }
public System.Int32? BackupRetentionPeriod { get; set; }
public System.String CACertificateIdentifier { get; set; }
public List CloudwatchLogsExportConfiguration_DisableLogType { get; set; }
public List CloudwatchLogsExportConfiguration_EnableLogType { get; set; }
public System.Boolean? CopyTagsToSnapshot { get; set; }
public System.String DBInstanceClass { get; set; }
public System.String DBInstanceIdentifier { get; set; }
public System.String DBParameterGroupName { get; set; }
public System.Int32? DBPortNumber { get; set; }
public List DBSecurityGroup { get; set; }
public System.String DBSubnetGroupName { get; set; }
public System.Boolean? DeletionProtection { get; set; }
public System.String Domain { get; set; }
public System.String DomainIAMRoleName { get; set; }
public System.Boolean? EnableIAMDatabaseAuthentication { get; set; }
public System.Boolean? EnablePerformanceInsight { get; set; }
public System.String EngineVersion { get; set; }
public System.Int32? Iops { get; set; }
public System.String LicenseModel { get; set; }
public System.String MasterUserPassword { get; set; }
public System.Int32? MonitoringInterval { get; set; }
public System.String MonitoringRoleArn { get; set; }
public System.Boolean? MultiAZ { get; set; }
public System.String NewDBInstanceIdentifier { get; set; }
public System.String OptionGroupName { get; set; }
public System.String PerformanceInsightsKMSKeyId { get; set; }
public System.String PreferredBackupWindow { get; set; }
public System.String PreferredMaintenanceWindow { get; set; }
public System.Int32? PromotionTier { get; set; }
[System.ObsoleteAttribute]
public System.Boolean? PubliclyAccessible { get; set; }
public System.String StorageType { get; set; }
public System.String TdeCredentialArn { get; set; }
public System.String TdeCredentialPassword { get; set; }
public List VpcSecurityGroupId { get; set; }
public System.Func Select { get; set; } =
(response, cmdlet) => response.DBInstance;
}
}
}