Class: OCI::ManagedKafka::Models::CreateKafkaClusterDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/managed_kafka/models/create_kafka_cluster_details.rb

Overview

The data to create a KafkaCluster.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateKafkaClusterDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 129

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

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

  self.display_name = attributes[:'display_name'] if attributes[:'display_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.access_subnets = attributes[:'accessSubnets'] if attributes[:'accessSubnets']

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

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

  self.client_certificate_bundle = attributes[:'clientCertificateBundle'] if attributes[:'clientCertificateBundle']

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

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

  self.kafka_version = attributes[:'kafkaVersion'] if attributes[:'kafkaVersion']

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

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

  self.cluster_type = attributes[:'clusterType'] if attributes[:'clusterType']

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

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

  self.broker_shape = attributes[:'brokerShape'] if attributes[:'brokerShape']

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

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

  self.cluster_config_id = attributes[:'clusterConfigId'] if attributes[:'clusterConfigId']

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

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

  self.cluster_config_version = attributes[:'clusterConfigVersion'] if attributes[:'clusterConfigVersion']

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

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

  self.coordination_type = attributes[:'coordinationType'] if attributes[:'coordinationType']

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

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

  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_subnetsArray<OCI::ManagedKafka::Models::SubnetSet>

[Required] Subnets where broker/coordinator VNICs will be created.



22
23
24
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 22

def access_subnets
  @access_subnets
end

#broker_shapeOCI::ManagedKafka::Models::BrokerShape

This attribute is required.



41
42
43
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 41

def broker_shape
  @broker_shape
end

#client_certificate_bundleString

CA certificate bundle for mTLS broker authentication.

Returns:

  • (String)


26
27
28
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 26

def client_certificate_bundle
  @client_certificate_bundle
end

#cluster_config_idString

[Required] The OCID of Kafka Cluster configuration object

Returns:

  • (String)


45
46
47
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 45

def cluster_config_id
  @cluster_config_id
end

#cluster_config_versionInteger

[Required] The version of configuration object

Returns:

  • (Integer)


49
50
51
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 49

def cluster_config_version
  @cluster_config_version
end

#cluster_typeString

[Required] Type of the cluster to spin up. DEVELOPMENT - setting that allows to sacrifice HA and spin up cluster on single node PRODUCTION - Minimum allowed broker count is 3

Returns:

  • (String)


37
38
39
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 37

def cluster_type
  @cluster_type
end

#compartment_idString

[Required] The OCID of the compartment to create the KafkaCluster in.

Returns:

  • (String)


18
19
20
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 18

def compartment_id
  @compartment_id
end

#coordination_typeString

[Required] Kafka coordination type. Set of available types depends on Kafka version

Returns:

  • (String)


53
54
55
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 53

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


69
70
71
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 69

def defined_tags
  @defined_tags
end

#display_nameString

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


13
14
15
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 13

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


61
62
63
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 61

def freeform_tags
  @freeform_tags
end

#kafka_versionString

[Required] Version of Kafka to use to spin up the cluster

Returns:

  • (String)


30
31
32
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 30

def kafka_version
  @kafka_version
end

Class Method Details

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 72

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'compartment_id': :'compartmentId',
    'access_subnets': :'accessSubnets',
    'client_certificate_bundle': :'clientCertificateBundle',
    'kafka_version': :'kafkaVersion',
    'cluster_type': :'clusterType',
    'broker_shape': :'brokerShape',
    'cluster_config_id': :'clusterConfigId',
    'cluster_config_version': :'clusterConfigVersion',
    'coordination_type': :'coordinationType',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 92

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'compartment_id': :'String',
    'access_subnets': :'Array<OCI::ManagedKafka::Models::SubnetSet>',
    'client_certificate_bundle': :'String',
    'kafka_version': :'String',
    'cluster_type': :'String',
    'broker_shape': :'OCI::ManagedKafka::Models::BrokerShape',
    'cluster_config_id': :'String',
    'cluster_config_version': :'Integer',
    'coordination_type': :'String',
    '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



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 215

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

  self.class == other.class &&
    display_name == other.display_name &&
    compartment_id == other.compartment_id &&
    access_subnets == other.access_subnets &&
    client_certificate_bundle == other.client_certificate_bundle &&
    kafka_version == other.kafka_version &&
    cluster_type == other.cluster_type &&
    broker_shape == other.broker_shape &&
    cluster_config_id == other.cluster_config_id &&
    cluster_config_version == other.cluster_config_version &&
    coordination_type == other.coordination_type &&
    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



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 256

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


236
237
238
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 236

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



245
246
247
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 245

def hash
  [display_name, compartment_id, access_subnets, client_certificate_bundle, kafka_version, cluster_type, broker_shape, cluster_config_id, cluster_config_version, coordination_type, 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



289
290
291
292
293
294
295
296
297
298
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 289

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



283
284
285
# File 'lib/oci/managed_kafka/models/create_kafka_cluster_details.rb', line 283

def to_s
  to_hash.to_s
end