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

[View source]

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_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

#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

#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.

[View source]

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_typesObject

Attribute type mapping.

[View source]

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.

Parameters:

  • other (Object)

    the other object to be compared

[View source]

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself

[View source]

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method
[View source]

155
156
157
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 155

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code

[View source]

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_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash

[View source]

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object

[View source]

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