Class: OCI::Sch::Models::ConnectorPlugin

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/sch/models/connector_plugin.rb

Overview

A service source or service target used to create a connector. Example connector plugins include the Queue source and the Notifications target. For more information about flows defined by connectors, see Overview of Connector Hub. For configuration instructions, see Creating a Connector.

This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class

Direct Known Subclasses

SourceConnectorPlugin, TargetConnectorPlugin

Constant Summary collapse

KIND_ENUM =
[
  KIND_SOURCE = 'SOURCE'.freeze,
  KIND_TARGET = 'TARGET'.freeze,
  KIND_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ESTIMATED_THROUGHPUT_ENUM =
[
  ESTIMATED_THROUGHPUT_LOW = 'LOW'.freeze,
  ESTIMATED_THROUGHPUT_MEDIUM = 'MEDIUM'.freeze,
  ESTIMATED_THROUGHPUT_HIGH = 'HIGH'.freeze,
  ESTIMATED_THROUGHPUT_UNKNOWN = 'UNKNOWN'.freeze,
  ESTIMATED_THROUGHPUT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ConnectorPlugin

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :kind (String)

    The value to assign to the #kind property

  • :name (String)

    The value to assign to the #name property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :estimated_throughput (String)

    The value to assign to the #estimated_throughput property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :display_name (String)

    The value to assign to the #display_name property

  • :schema (String)

    The value to assign to the #schema property



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
# File 'lib/oci/sch/models/connector_plugin.rb', line 137

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.estimated_throughput = attributes[:'estimatedThroughput'] if attributes[:'estimatedThroughput']
  self.estimated_throughput = "UNKNOWN" if estimated_throughput.nil? && !attributes.key?(:'estimatedThroughput') # rubocop:disable Style/StringLiterals

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

  self.estimated_throughput = attributes[:'estimated_throughput'] if attributes[:'estimated_throughput']
  self.estimated_throughput = "UNKNOWN" if estimated_throughput.nil? && !attributes.key?(:'estimatedThroughput') && !attributes.key?(:'estimated_throughput') # rubocop:disable Style/StringLiterals

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

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

Instance Attribute Details

#display_nameString

[Required] A user-friendly name. It does not have to be unique, and it is changeable. Avoid entering confidential information.

Returns:

  • (String)


71
72
73
# File 'lib/oci/sch/models/connector_plugin.rb', line 71

def display_name
  @display_name
end

#estimated_throughputString

The estimated throughput range (LOW, MEDIUM, HIGH).

Returns:

  • (String)


60
61
62
# File 'lib/oci/sch/models/connector_plugin.rb', line 60

def estimated_throughput
  @estimated_throughput
end

#kindString

[Required] The plugin type discriminator.

Returns:

  • (String)


42
43
44
# File 'lib/oci/sch/models/connector_plugin.rb', line 42

def kind
  @kind
end

#lifecycle_stateString

[Required] The current state of the service connector.

Returns:

  • (String)


65
66
67
# File 'lib/oci/sch/models/connector_plugin.rb', line 65

def lifecycle_state
  @lifecycle_state
end

#nameString

[Required] The service to be called by the connector plugin. Example: QueueSource

Returns:

  • (String)


48
49
50
# File 'lib/oci/sch/models/connector_plugin.rb', line 48

def name
  @name
end

#schemaString

Gets the specified connector plugin configuration information in OpenAPI specification format.

Returns:

  • (String)


76
77
78
# File 'lib/oci/sch/models/connector_plugin.rb', line 76

def schema
  @schema
end

#time_createdDateTime

[Required] The date and time when this plugin became available. Format is defined by RFC3339. Example: 2023-09-09T21:10:29.600Z

Returns:

  • (DateTime)


55
56
57
# File 'lib/oci/sch/models/connector_plugin.rb', line 55

def time_created
  @time_created
end

Class Method Details

.attribute_mapObject

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



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/sch/models/connector_plugin.rb', line 79

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'kind': :'kind',
    'name': :'name',
    'time_created': :'timeCreated',
    'estimated_throughput': :'estimatedThroughput',
    'lifecycle_state': :'lifecycleState',
    'display_name': :'displayName',
    'schema': :'schema'
    # rubocop:enable Style/SymbolLiteral
  }
end

.get_subtype(object_hash) ⇒ Object

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.



113
114
115
116
117
118
119
120
121
# File 'lib/oci/sch/models/connector_plugin.rb', line 113

def self.get_subtype(object_hash)
  type = object_hash[:'kind'] # rubocop:disable Style/SymbolLiteral

  return 'OCI::Sch::Models::TargetConnectorPlugin' if type == 'TARGET'
  return 'OCI::Sch::Models::SourceConnectorPlugin' if type == 'SOURCE'

  # TODO: Log a warning when the subtype is not found.
  'OCI::Sch::Models::ConnectorPlugin'
end

.swagger_typesObject

Attribute type mapping.



94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/sch/models/connector_plugin.rb', line 94

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'kind': :'String',
    'name': :'String',
    'time_created': :'DateTime',
    'estimated_throughput': :'String',
    'lifecycle_state': :'String',
    'display_name': :'String',
    'schema': :'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



222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/oci/sch/models/connector_plugin.rb', line 222

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

  self.class == other.class &&
    kind == other.kind &&
    name == other.name &&
    time_created == other.time_created &&
    estimated_throughput == other.estimated_throughput &&
    lifecycle_state == other.lifecycle_state &&
    display_name == other.display_name &&
    schema == other.schema
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



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

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


238
239
240
# File 'lib/oci/sch/models/connector_plugin.rb', line 238

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



247
248
249
# File 'lib/oci/sch/models/connector_plugin.rb', line 247

def hash
  [kind, name, time_created, estimated_throughput, lifecycle_state, display_name, schema].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



291
292
293
294
295
296
297
298
299
300
# File 'lib/oci/sch/models/connector_plugin.rb', line 291

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



285
286
287
# File 'lib/oci/sch/models/connector_plugin.rb', line 285

def to_s
  to_hash.to_s
end