Class: OCI::Opensearch::Models::OutboundClusterSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opensearch/models/outbound_cluster_summary.rb

Overview

Contains details of a Outbound cluster

Constant Summary collapse

MODE_ENUM =
[
  MODE_SEARCH_ONLY = 'SEARCH_ONLY'.freeze,
  MODE_REPLICATION_ONLY = 'REPLICATION_ONLY'.freeze,
  MODE_SEARCH_AND_REPLICATION = 'SEARCH_AND_REPLICATION'.freeze,
  MODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OutboundClusterSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :display_name (String)

    The value to assign to the #display_name property

  • :ping_schedule (String)

    The value to assign to the #ping_schedule property

  • :is_skip_unavailable (BOOLEAN)

    The value to assign to the #is_skip_unavailable property

  • :seed_cluster_id (String)

    The value to assign to the #seed_cluster_id property

  • :mode (String)

    The value to assign to the #mode property



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
103
104
105
106
107
108
109
110
111
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 77

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

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

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

  self.is_skip_unavailable = attributes[:'isSkipUnavailable'] unless attributes[:'isSkipUnavailable'].nil?
  self.is_skip_unavailable = true if is_skip_unavailable.nil? && !attributes.key?(:'isSkipUnavailable') # rubocop:disable Style/StringLiterals

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

  self.is_skip_unavailable = attributes[:'is_skip_unavailable'] unless attributes[:'is_skip_unavailable'].nil?
  self.is_skip_unavailable = true if is_skip_unavailable.nil? && !attributes.key?(:'isSkipUnavailable') && !attributes.key?(:'is_skip_unavailable') # rubocop:disable Style/StringLiterals

  self.seed_cluster_id = attributes[:'seedClusterId'] if attributes[:'seedClusterId']

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

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

  self.mode = attributes[:'mode'] if attributes[:'mode']
  self.mode = "SEARCH_ONLY" if mode.nil? && !attributes.key?(:'mode') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#display_nameString

[Required] Name of the Outbound cluster. Avoid entering confidential information.

Returns:

  • (String)


22
23
24
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 22

def display_name
  @display_name
end

#is_skip_unavailableBOOLEAN

Flag to indicate whether to skip the Outbound cluster during cross cluster search, if it is unavailable

Returns:

  • (BOOLEAN)


30
31
32
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 30

def is_skip_unavailable
  @is_skip_unavailable
end

#modeString

Mode for the cross cluster connection

Returns:

  • (String)


38
39
40
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 38

def mode
  @mode
end

#ping_scheduleString

Sets the time interval between regular application-level ping messages that are sent to try and keep outbound cluster connections alive. If set to -1, application-level ping messages to this outbound cluster are not sent. If unset, application-level ping messages are sent according to the global transport.ping_schedule setting, which defaults to -1 meaning that pings are not sent.

Returns:

  • (String)


26
27
28
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 26

def ping_schedule
  @ping_schedule
end

#seed_cluster_idString

[Required] OCID of the Outbound cluster

Returns:

  • (String)


34
35
36
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 34

def seed_cluster_id
  @seed_cluster_id
end

Class Method Details

.attribute_mapObject

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



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 41

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'ping_schedule': :'pingSchedule',
    'is_skip_unavailable': :'isSkipUnavailable',
    'seed_cluster_id': :'seedClusterId',
    'mode': :'mode'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 54

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'ping_schedule': :'String',
    'is_skip_unavailable': :'BOOLEAN',
    'seed_cluster_id': :'String',
    'mode': :'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



133
134
135
136
137
138
139
140
141
142
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 133

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

  self.class == other.class &&
    display_name == other.display_name &&
    ping_schedule == other.ping_schedule &&
    is_skip_unavailable == other.is_skip_unavailable &&
    seed_cluster_id == other.seed_cluster_id &&
    mode == other.mode
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



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 167

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


147
148
149
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 147

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



156
157
158
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 156

def hash
  [display_name, ping_schedule, is_skip_unavailable, seed_cluster_id, mode].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



200
201
202
203
204
205
206
207
208
209
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 200

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



194
195
196
# File 'lib/oci/opensearch/models/outbound_cluster_summary.rb', line 194

def to_s
  to_hash.to_s
end