Class: OCI::ObjectStorage::Models::CreatePrivateEndpointDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/object_storage/models/create_private_endpoint_details.rb

Overview

Details to create a private endpoint

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreatePrivateEndpointDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 128

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.name = attributes[:'name'] if attributes[:'name']

  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.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']

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

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

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

  self.additional_prefixes = attributes[:'additionalPrefixes'] if attributes[:'additionalPrefixes']

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

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

  self.private_endpoint_ip = attributes[:'privateEndpointIp'] if attributes[:'privateEndpointIp']

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

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

  self.nsg_ids = attributes[:'nsgIds'] if attributes[:'nsgIds']

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

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

  self.access_targets = attributes[:'accessTargets'] if attributes[:'accessTargets']

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

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

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

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

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

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

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

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

Instance Attribute Details

#access_targetsArray<OCI::ObjectStorage::Models::AccessTargetDetails>

[Required] A list of targets that can be accessed by the private endpoint.



60
61
62
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 60

def access_targets
  @access_targets
end

#additional_prefixesArray<String>

A list of additional prefix that you can provide along with any other prefix. These resulting endpointFqdn's are added to the customer VCN's DNS record.

Returns:

  • (Array<String>)


39
40
41
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 39

def additional_prefixes
  @additional_prefixes
end

#compartment_idString

[Required] The ID of the compartment in which to create the Private Endpoint.

Returns:

  • (String)


21
22
23
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 21

def compartment_id
  @compartment_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


74
75
76
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 74

def defined_tags
  @defined_tags
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


67
68
69
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 67

def freeform_tags
  @freeform_tags
end

#nameString

[Required] This name associated with the endpoint. Valid characters are uppercase or lowercase letters, numbers, hyphens, underscores, and periods. Example: my-new-private-endpoint1

Returns:

  • (String)


17
18
19
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 17

def name
  @name
end

#nsg_idsArray<String>

A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to. For more information about NSGs, see NetworkSecurityGroup.

Returns:

  • (Array<String>)


55
56
57
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 55

def nsg_ids
  @nsg_ids
end

#prefixString

[Required] A prefix to use for the private endpoint. The customer VCN's DNS records are updated with this prefix. The prefix input from the customer will be the first sub-domain in the endpointFqdn. Example: If the prefix chosen is "abc", then the endpointFqdn will be 'abc.private.objectstorage.<region>.oraclecloud.com'

Returns:

  • (String)


33
34
35
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 33

def prefix
  @prefix
end

#private_endpoint_ipString

The private IP address to assign to this private endpoint. If you provide a value, it must be an available IP address in the customer's subnet. If it's not available, an error is returned.

If you do not provide a value, an available IP address in the subnet is automatically chosen.

Returns:

  • (String)


48
49
50
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 48

def private_endpoint_ip
  @private_endpoint_ip
end

#subnet_idString

[Required] The OCID of the customer's subnet where the private endpoint VNIC will reside.

Returns:

  • (String)


26
27
28
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 26

def subnet_id
  @subnet_id
end

Class Method Details

.attribute_mapObject

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



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 77

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'compartment_id': :'compartmentId',
    'subnet_id': :'subnetId',
    'prefix': :'prefix',
    'additional_prefixes': :'additionalPrefixes',
    'private_endpoint_ip': :'privateEndpointIp',
    'nsg_ids': :'nsgIds',
    'access_targets': :'accessTargets',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 95

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'compartment_id': :'String',
    'subnet_id': :'String',
    'prefix': :'String',
    'additional_prefixes': :'Array<String>',
    'private_endpoint_ip': :'String',
    'nsg_ids': :'Array<String>',
    'access_targets': :'Array<OCI::ObjectStorage::Models::AccessTargetDetails>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # 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



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 194

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    name == other.name &&
    compartment_id == other.compartment_id &&
    subnet_id == other.subnet_id &&
    prefix == other.prefix &&
    additional_prefixes == other.additional_prefixes &&
    private_endpoint_ip == other.private_endpoint_ip &&
    nsg_ids == other.nsg_ids &&
    access_targets == other.access_targets &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
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



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 233

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


213
214
215
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 213

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



222
223
224
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 222

def hash
  [name, compartment_id, subnet_id, prefix, additional_prefixes, private_endpoint_ip, nsg_ids, access_targets, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



266
267
268
269
270
271
272
273
274
275
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 266

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



260
261
262
# File 'lib/oci/object_storage/models/create_private_endpoint_details.rb', line 260

def to_s
  to_hash.to_s
end