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.

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



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 67

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']
end

Instance Attribute Details

#admin_emailString

[Required] The email address of the administrator of the child tenancy.

Returns:

  • (String)


24
25
26
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 24

def admin_email
  @admin_email
end

#compartment_idString

[Required] The tenancy ID of the parent tenancy.

Returns:

  • (String)


12
13
14
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 12

def compartment_id
  @compartment_id
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)


20
21
22
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 20

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)


28
29
30
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 28

def policy_name
  @policy_name
end

#tenancy_nameString

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

Returns:

  • (String)


16
17
18
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 16

def tenancy_name
  @tenancy_name
end

Class Method Details

.attribute_mapObject

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



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 31

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'tenancy_name': :'tenancyName',
    'home_region': :'homeRegion',
    'admin_email': :'adminEmail',
    'policy_name': :'policyName'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 44

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'tenancy_name': :'String',
    'home_region': :'String',
    'admin_email': :'String',
    'policy_name': :'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



111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 111

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



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 145

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


125
126
127
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 125

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



134
135
136
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 134

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 178

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



172
173
174
# File 'lib/oci/tenant_manager_control_plane/models/create_child_tenancy_details.rb', line 172

def to_s
  to_hash.to_s
end