Class: OCI::Apigateway::Models::ExternalRespCache

Inherits:
ResponseCacheDetails show all
Defined in:
lib/oci/apigateway/models/external_resp_cache.rb

Overview

Connection details for an external RESP based cache store for Response Caching.

Constant Summary

Constants inherited from ResponseCacheDetails

ResponseCacheDetails::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from ResponseCacheDetails

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ResponseCacheDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ExternalRespCache

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 101

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['type'] = 'EXTERNAL_RESP_CACHE'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

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

  self.authentication_secret_id = attributes[:'authenticationSecretId'] if attributes[:'authenticationSecretId']

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

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

  self.authentication_secret_version_number = attributes[:'authenticationSecretVersionNumber'] if attributes[:'authenticationSecretVersionNumber']

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

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

  self.is_ssl_enabled = attributes[:'isSslEnabled'] unless attributes[:'isSslEnabled'].nil?
  self.is_ssl_enabled = false if is_ssl_enabled.nil? && !attributes.key?(:'isSslEnabled') # rubocop:disable Style/StringLiterals

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

  self.is_ssl_enabled = attributes[:'is_ssl_enabled'] unless attributes[:'is_ssl_enabled'].nil?
  self.is_ssl_enabled = false if is_ssl_enabled.nil? && !attributes.key?(:'isSslEnabled') && !attributes.key?(:'is_ssl_enabled') # rubocop:disable Style/StringLiterals

  self.is_ssl_verify_disabled = attributes[:'isSslVerifyDisabled'] unless attributes[:'isSslVerifyDisabled'].nil?
  self.is_ssl_verify_disabled = false if is_ssl_verify_disabled.nil? && !attributes.key?(:'isSslVerifyDisabled') # rubocop:disable Style/StringLiterals

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

  self.is_ssl_verify_disabled = attributes[:'is_ssl_verify_disabled'] unless attributes[:'is_ssl_verify_disabled'].nil?
  self.is_ssl_verify_disabled = false if is_ssl_verify_disabled.nil? && !attributes.key?(:'isSslVerifyDisabled') && !attributes.key?(:'is_ssl_verify_disabled') # rubocop:disable Style/StringLiterals

  self.connect_timeout_in_ms = attributes[:'connectTimeoutInMs'] if attributes[:'connectTimeoutInMs']

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

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

  self.read_timeout_in_ms = attributes[:'readTimeoutInMs'] if attributes[:'readTimeoutInMs']

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

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

  self.send_timeout_in_ms = attributes[:'sendTimeoutInMs'] if attributes[:'sendTimeoutInMs']

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

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

Instance Attribute Details

#authentication_secret_idString

[Required] The OCID of the Oracle Vault Service secret resource.

Returns:

  • (String)


21
22
23
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 21

def authentication_secret_id
  @authentication_secret_id
end

#authentication_secret_version_numberInteger

[Required] The version number of the authentication secret to use.

Returns:

  • (Integer)


26
27
28
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 26

def authentication_secret_version_number
  @authentication_secret_version_number
end

#connect_timeout_in_msInteger

Defines the timeout for establishing a connection with the Response Cache.

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 41

def connect_timeout_in_ms
  @connect_timeout_in_ms
end

#is_ssl_enabledBOOLEAN

Defines if the connection should be over SSL.

Returns:

  • (BOOLEAN)


31
32
33
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 31

def is_ssl_enabled
  @is_ssl_enabled
end

#is_ssl_verify_disabledBOOLEAN

Defines whether or not to uphold SSL verification.

Returns:

  • (BOOLEAN)


36
37
38
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 36

def is_ssl_verify_disabled
  @is_ssl_verify_disabled
end

#read_timeout_in_msInteger

Defines the timeout for reading data from the Response Cache.

Returns:

  • (Integer)


46
47
48
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 46

def read_timeout_in_ms
  @read_timeout_in_ms
end

#send_timeout_in_msInteger

Defines the timeout for transmitting data to the Response Cache.

Returns:

  • (Integer)


51
52
53
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 51

def send_timeout_in_ms
  @send_timeout_in_ms
end

#serversArray<OCI::Apigateway::Models::ResponseCacheRespServer>

[Required] The set of cache store members to connect to. At present only a single server is supported.



16
17
18
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 16

def servers
  @servers
end

Class Method Details

.attribute_mapObject

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



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 54

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'servers': :'servers',
    'authentication_secret_id': :'authenticationSecretId',
    'authentication_secret_version_number': :'authenticationSecretVersionNumber',
    'is_ssl_enabled': :'isSslEnabled',
    'is_ssl_verify_disabled': :'isSslVerifyDisabled',
    'connect_timeout_in_ms': :'connectTimeoutInMs',
    'read_timeout_in_ms': :'readTimeoutInMs',
    'send_timeout_in_ms': :'sendTimeoutInMs'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 71

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'servers': :'Array<OCI::Apigateway::Models::ResponseCacheRespServer>',
    'authentication_secret_id': :'String',
    'authentication_secret_version_number': :'Integer',
    'is_ssl_enabled': :'BOOLEAN',
    'is_ssl_verify_disabled': :'BOOLEAN',
    'connect_timeout_in_ms': :'Integer',
    'read_timeout_in_ms': :'Integer',
    'send_timeout_in_ms': :'Integer'
    # 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



167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 167

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

  self.class == other.class &&
    type == other.type &&
    servers == other.servers &&
    authentication_secret_id == other.authentication_secret_id &&
    authentication_secret_version_number == other.authentication_secret_version_number &&
    is_ssl_enabled == other.is_ssl_enabled &&
    is_ssl_verify_disabled == other.is_ssl_verify_disabled &&
    connect_timeout_in_ms == other.connect_timeout_in_ms &&
    read_timeout_in_ms == other.read_timeout_in_ms &&
    send_timeout_in_ms == other.send_timeout_in_ms
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



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 205

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


185
186
187
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 185

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



194
195
196
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 194

def hash
  [type, servers, authentication_secret_id, authentication_secret_version_number, is_ssl_enabled, is_ssl_verify_disabled, connect_timeout_in_ms, read_timeout_in_ms, send_timeout_in_ms].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



238
239
240
241
242
243
244
245
246
247
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 238

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



232
233
234
# File 'lib/oci/apigateway/models/external_resp_cache.rb', line 232

def to_s
  to_hash.to_s
end