Class: OCI::TenantManagerControlPlane::Models::CreateChildTenancyDetails

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateChildTenancyDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :tenancy_name (String)

    The value to assign to the #tenancy_name property

  • :home_region (String)

    The value to assign to the #home_region property

  • :admin_email (String)

    The value to assign to the #admin_email property

  • :policy_name (String)

    The value to assign to the #policy_name property

  • :governance_status (String)

    The value to assign to the #governance_status property

  • :subscription_id (String)

    The value to assign to the #subscription_id property

  • :features (Array<String>)

    The value to assign to the #features property



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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 94

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

  self.subscription_id = attributes[:'subscriptionId'] if attributes[:'subscriptionId']

  raise 'You cannot provide both :subscriptionId and :subscription_id' if attributes.key?(:'subscriptionId') && attributes.key?(:'subscription_id')

  self.subscription_id = attributes[:'subscription_id'] if attributes[:'subscription_id']

  self.features = attributes[:'features'] if attributes[:'features']
end

Instance Attribute Details

#admin_emailString

[Required] Email address of the child tenancy administrator.

Returns:

  • (String)


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_idString

[Required] The tenancy ID of the parent tenancy.

Returns:

  • (String)


18
19
20
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 18

def compartment_id
  @compartment_id
end

#featuresArray<String>

List of features that the child and parent tenancies will have links for. Link with feature CORE will always be created.

Returns:

  • (Array<String>)


46
47
48
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 46

def features
  @features
end

#governance_statusString

The governance status of the child tenancy.

Returns:

  • (String)


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_regionString

[Required] The home region to use for the child tenancy. This must be a region where the parent tenancy is subscribed.

Returns:

  • (String)


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_nameString

The name to use for the administrator policy in the child tenancy. Must contain only letters and underscores.

Returns:

  • (String)


34
35
36
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 34

def policy_name
  @policy_name
end

#subscription_idString

OCID of the subscription that needs to be assigned to the child tenancy.

Returns:

  • (String)


42
43
44
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 42

def subscription_id
  @subscription_id
end

#tenancy_nameString

[Required] The tenancy name to use for the child tenancy.

Returns:

  • (String)


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_mapObject

Attribute mapping from ruby-style variable name to JSON key.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 49

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',
    'subscription_id': :'subscriptionId',
    'features': :'features'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 65

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',
    'subscription_id': :'String',
    'features': :'Array<String>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 162

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 &&
    subscription_id == other.subscription_id &&
    features == other.features
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 199

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


179
180
181
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 179

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



188
189
190
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 188

def hash
  [compartment_id, tenancy_name, home_region, admin_email, policy_name, governance_status, subscription_id, features].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



232
233
234
235
236
237
238
239
240
241
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 232

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



226
227
228
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 226

def to_s
  to_hash.to_s
end