Class: OCI::TenantManagerControlPlane::Models::CreateChildTenancyDetails
- Inherits:
-
Object
- Object
- OCI::TenantManagerControlPlane::Models::CreateChildTenancyDetails
- Defined in:
- lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb
Overview
The parameters for creating a child tenancy.
Constant Summary collapse
- GOVERNANCE_STATUS_ENUM =
[ GOVERNANCE_STATUS_OPTED_IN = 'OPTED_IN'.freeze, GOVERNANCE_STATUS_OPTED_OUT = 'OPTED_OUT'.freeze ].freeze
Instance Attribute Summary collapse
-
#admin_email ⇒ String
[Required] Email address of the child tenancy administrator.
-
#compartment_id ⇒ String
[Required] The tenancy ID of the parent tenancy.
-
#governance_status ⇒ String
The governance status of the child tenancy.
-
#home_region ⇒ String
[Required] The home region to use for the child tenancy.
-
#policy_name ⇒ String
The name to use for the administrator policy in the child tenancy.
-
#tenancy_name ⇒ String
[Required] The tenancy name to use for the child tenancy.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CreateChildTenancyDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ CreateChildTenancyDetails
Initializes the object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 80 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.tenancy_name = attributes[:'tenancyName'] if attributes[:'tenancyName'] raise 'You cannot provide both :tenancyName and :tenancy_name' if attributes.key?(:'tenancyName') && attributes.key?(:'tenancy_name') self.tenancy_name = attributes[:'tenancy_name'] if attributes[:'tenancy_name'] self.home_region = attributes[:'homeRegion'] if attributes[:'homeRegion'] raise 'You cannot provide both :homeRegion and :home_region' if attributes.key?(:'homeRegion') && attributes.key?(:'home_region') self.home_region = attributes[:'home_region'] if attributes[:'home_region'] self.admin_email = attributes[:'adminEmail'] if attributes[:'adminEmail'] raise 'You cannot provide both :adminEmail and :admin_email' if attributes.key?(:'adminEmail') && attributes.key?(:'admin_email') self.admin_email = attributes[:'admin_email'] if attributes[:'admin_email'] self.policy_name = attributes[:'policyName'] if attributes[:'policyName'] raise 'You cannot provide both :policyName and :policy_name' if attributes.key?(:'policyName') && attributes.key?(:'policy_name') self.policy_name = attributes[:'policy_name'] if attributes[:'policy_name'] self.governance_status = attributes[:'governanceStatus'] if attributes[:'governanceStatus'] self.governance_status = "OPTED_OUT" if governance_status.nil? && !attributes.key?(:'governanceStatus') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :governanceStatus and :governance_status' if attributes.key?(:'governanceStatus') && attributes.key?(:'governance_status') self.governance_status = attributes[:'governance_status'] if attributes[:'governance_status'] self.governance_status = "OPTED_OUT" if governance_status.nil? && !attributes.key?(:'governanceStatus') && !attributes.key?(:'governance_status') # rubocop:disable Style/StringLiterals end |
Instance Attribute Details
#admin_email ⇒ String
[Required] Email address of the child tenancy administrator.
30 31 32 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 30 def admin_email @admin_email end |
#compartment_id ⇒ String
[Required] The tenancy ID of the parent tenancy.
18 19 20 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 18 def compartment_id @compartment_id end |
#governance_status ⇒ String
The governance status of the child tenancy.
38 39 40 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 38 def governance_status @governance_status end |
#home_region ⇒ String
[Required] The home region to use for the child tenancy. This must be a region where the parent tenancy is subscribed.
26 27 28 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 26 def home_region @home_region end |
#policy_name ⇒ String
The name to use for the administrator policy in the child tenancy. Must contain only letters and underscores.
34 35 36 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 34 def policy_name @policy_name end |
#tenancy_name ⇒ String
[Required] The tenancy name to use for the child tenancy.
22 23 24 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 22 def tenancy_name @tenancy_name end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 41 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'compartment_id': :'compartmentId', 'tenancy_name': :'tenancyName', 'home_region': :'homeRegion', 'admin_email': :'adminEmail', 'policy_name': :'policyName', 'governance_status': :'governanceStatus' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 55 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'compartment_id': :'String', 'tenancy_name': :'String', 'home_region': :'String', 'admin_email': :'String', 'policy_name': :'String', 'governance_status': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 140 def ==(other) return true if equal?(other) self.class == other.class && compartment_id == other.compartment_id && tenancy_name == other.tenancy_name && home_region == other.home_region && admin_email == other.admin_email && policy_name == other.policy_name && governance_status == other.governance_status end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 175 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
155 156 157 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 155 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
164 165 166 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 164 def hash [compartment_id, tenancy_name, home_region, admin_email, policy_name, governance_status].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
208 209 210 211 212 213 214 215 216 217 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 208 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
202 203 204 |
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 202 def to_s to_hash.to_s end |