/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the organizations-2016-11-28.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Organizations.Model
{
///
/// Performing this operation violates a minimum or maximum value limit. For example,
/// attempting to remove the last service control policy (SCP) from an OU or root, inviting
/// or creating too many accounts to the organization, or attaching too many policies
/// to an account, OU, or root. This exception includes a reason that contains additional
/// information about the violated limit:
///
///
///
/// Some of the reasons in the following list might not be applicable to this specific
/// API or operation.
///
/// -
///
/// ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management account
/// from the organization. You can't remove the management account. Instead, after you
/// remove all member accounts, delete the organization itself.
///
///
-
///
/// ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove an account
/// from the organization that doesn't yet have enough information to exist as a standalone
/// account. This account requires you to first complete phone verification. Follow the
/// steps at Removing
/// a member account from your organization in the Organizations User Guide.
///
///
///
-
///
/// ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of accounts
/// that you can create in one day.
///
///
-
///
/// ACCOUNT_CREATION_NOT_COMPLETE: Your account setup isn't complete or your account isn't
/// fully active. You must complete the account setup before you create an organization.
///
///
-
///
/// ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on the number of
/// accounts in an organization. If you need more accounts, contact Amazon
/// Web Services Support to request an increase in your limit.
///
///
///
/// Or the number of invitations that you tried to send would cause you to exceed the
/// limit of accounts in your organization. Send fewer invitations or contact Amazon Web
/// Services Support to request an increase in the number of accounts.
///
///
///
/// Deleted and closed accounts still count toward your limit.
///
///
///
/// If you get this exception when running a command immediately after creating the organization,
/// wait one hour and try again. After an hour, if the command continues to fail with
/// this error, contact Amazon Web
/// Services Support.
///
///
-
///
/// CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to register the management
/// account of the organization as a delegated administrator for an Amazon Web Services
/// service integrated with Organizations. You can designate only a member account as
/// a delegated administrator.
///
///
-
///
/// CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management account. To
/// close the management account for the organization, you must first either remove or
/// close all member accounts in the organization. Follow standard account closure process
/// using root credentials.
///
///
-
///
/// CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove an account
/// that is registered as a delegated administrator for a service integrated with your
/// organization. To complete this operation, you must first deregister this account as
/// a delegated administrator.
///
///
-
///
/// CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota for the past 30
/// days.
///
///
-
///
/// CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number of accounts
/// that you can close at a time.
///
///
-
///
/// CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an organization
/// in the specified region, you must enable all features mode.
///
///
-
///
/// DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register an Amazon
/// Web Services account as a delegated administrator for an Amazon Web Services service
/// that already has a delegated administrator. To complete this operation, you must first
/// deregister any existing delegated administrators for this service.
///
///
-
///
/// EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only valid for a limited
/// period of time. You must resubmit the request and generate a new verfication code.
///
///
-
///
/// HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of handshakes that
/// you can send in one day.
///
///
-
///
/// INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no supported payment
/// method is associated with the account. Amazon Web Services does not support cards
/// issued by financial institutions in Russia or Belarus. For more information, see Managing
/// your Amazon Web Services payments.
///
///
-
///
/// MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account in this organization,
/// you first must migrate the organization's management account to the marketplace that
/// corresponds to the management account's address. For example, accounts with India
/// addresses must be associated with the AISPL marketplace. All accounts in an organization
/// must be associated with the same marketplace.
///
///
-
///
/// MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon Web Services />
/// Regions in China. To create an organization, the master must have a valid business
/// license. For more information, contact customer support.
///
///
-
///
/// MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you must first provide
/// a valid contact address and phone number for the management account. Then try the
/// operation again.
///
///
-
///
/// MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the management account
/// must have an associated account in the Amazon Web Services GovCloud (US-West) Region.
/// For more information, see Organizations
/// in the Amazon Web Services GovCloud User Guide.
///
///
-
///
/// MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization with this management
/// account, you first must associate a valid payment instrument, such as a credit card,
/// with the account. Follow the steps at To
/// leave an organization when all required account information has not yet been provided
/// in the Organizations User Guide.
///
///
-
///
/// MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted to register
/// more delegated administrators than allowed for the service principal.
///
///
-
///
/// MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the number of policies
/// of a certain type that can be attached to an entity at one time.
///
///
-
///
/// MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed on this resource.
///
///
///
-
///
/// MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation with this member
/// account, you first must associate a valid payment instrument, such as a credit card,
/// with the account. Follow the steps at To
/// leave an organization when all required account information has not yet been provided
/// in the Organizations User Guide.
///
///
-
///
/// MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a policy from an
/// entity that would cause the entity to have fewer than the minimum number of policies
/// of a certain type required.
///
///
-
///
/// ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation that
/// requires the organization to be configured to support all features. An organization
/// that supports only consolidated billing features can't perform this operation.
///
///
-
///
/// OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is too many levels
/// deep.
///
///
-
///
/// OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs that you can have
/// in an organization.
///
///
-
///
/// POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that is larger than
/// the maximum size.
///
///
-
///
/// POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of policies that
/// you can have in an organization.
///
///
-
///
/// SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator before
/// you enabled service access. Call the
EnableAWSServiceAccess
API first.
///
/// -
///
/// TAG_POLICY_VIOLATION: You attempted to create or update a resource with tags that
/// are not compliant with the tag policy requirements for this account.
///
///
-
///
/// WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, there is a waiting
/// period before you can remove it from the organization. If you get an error that indicates
/// that a wait period is required, try again in a few days.
///
///
///
#if !NETSTANDARD
[Serializable]
#endif
public partial class ConstraintViolationException : AmazonOrganizationsException
{
private ConstraintViolationExceptionReason _reason;
///
/// Constructs a new ConstraintViolationException with the specified error
/// message.
///
///
/// Describes the error encountered.
///
public ConstraintViolationException(string message)
: base(message) {}
///
/// Construct instance of ConstraintViolationException
///
///
///
public ConstraintViolationException(string message, Exception innerException)
: base(message, innerException) {}
///
/// Construct instance of ConstraintViolationException
///
///
public ConstraintViolationException(Exception innerException)
: base(innerException) {}
///
/// Construct instance of ConstraintViolationException
///
///
///
///
///
///
///
public ConstraintViolationException(string message, Exception innerException, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
///
/// Construct instance of ConstraintViolationException
///
///
///
///
///
///
public ConstraintViolationException(string message, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode) {}
#if !NETSTANDARD
///
/// Constructs a new instance of the ConstraintViolationException class with serialized data.
///
/// The that holds the serialized object data about the exception being thrown.
/// The that contains contextual information about the source or destination.
/// The parameter is null.
/// The class name is null or is zero (0).
protected ConstraintViolationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
this.Reason = (ConstraintViolationExceptionReason)info.GetValue("Reason", typeof(ConstraintViolationExceptionReason));
}
///
/// Sets the with information about the exception.
///
/// The that holds the serialized object data about the exception being thrown.
/// The that contains contextual information about the source or destination.
/// The parameter is a null reference (Nothing in Visual Basic).
#if BCL35
[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.LinkDemand,
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
#endif
[System.Security.SecurityCritical]
// These FxCop rules are giving false-positives for this method
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")]
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("Reason", this.Reason);
}
#endif
///
/// Gets and sets the property Reason.
///
public ConstraintViolationExceptionReason Reason
{
get { return this._reason; }
set { this._reason = value; }
}
// Check to see if Reason property is set
internal bool IsSetReason()
{
return this._reason != null;
}
}
}