Class: OCI::Apigateway::Models::HTTPBackend

Inherits:
ApiSpecificationRouteBackend show all
Defined in:
lib/oci/apigateway/models/http_backend.rb

Overview

Send the request to an HTTP backend.

Constant Summary

Constants inherited from ApiSpecificationRouteBackend

ApiSpecificationRouteBackend::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from ApiSpecificationRouteBackend

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiSpecificationRouteBackend

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ HTTPBackend

Initializes the object

Options Hash (attributes):

Parameters:

  • (defaults to: {})

    Model attributes in the form of hash



75
76
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
112
113
114
115
116
117
118
# File 'lib/oci/apigateway/models/http_backend.rb', line 75

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

  attributes['type'] = 'HTTP_BACKEND'

  super(attributes)

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

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

  self.connect_timeout_in_seconds = attributes[:'connectTimeoutInSeconds'] if attributes[:'connectTimeoutInSeconds']
  self.connect_timeout_in_seconds = 60.0 if connect_timeout_in_seconds.nil? && !attributes.key?(:'connectTimeoutInSeconds') # rubocop:disable Style/StringLiterals

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

  self.connect_timeout_in_seconds = attributes[:'connect_timeout_in_seconds'] if attributes[:'connect_timeout_in_seconds']
  self.connect_timeout_in_seconds = 60.0 if connect_timeout_in_seconds.nil? && !attributes.key?(:'connectTimeoutInSeconds') && !attributes.key?(:'connect_timeout_in_seconds') # rubocop:disable Style/StringLiterals

  self.read_timeout_in_seconds = attributes[:'readTimeoutInSeconds'] if attributes[:'readTimeoutInSeconds']
  self.read_timeout_in_seconds = 10.0 if read_timeout_in_seconds.nil? && !attributes.key?(:'readTimeoutInSeconds') # rubocop:disable Style/StringLiterals

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

  self.read_timeout_in_seconds = attributes[:'read_timeout_in_seconds'] if attributes[:'read_timeout_in_seconds']
  self.read_timeout_in_seconds = 10.0 if read_timeout_in_seconds.nil? && !attributes.key?(:'readTimeoutInSeconds') && !attributes.key?(:'read_timeout_in_seconds') # rubocop:disable Style/StringLiterals

  self.send_timeout_in_seconds = attributes[:'sendTimeoutInSeconds'] if attributes[:'sendTimeoutInSeconds']
  self.send_timeout_in_seconds = 10.0 if send_timeout_in_seconds.nil? && !attributes.key?(:'sendTimeoutInSeconds') # rubocop:disable Style/StringLiterals

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

  self.send_timeout_in_seconds = attributes[:'send_timeout_in_seconds'] if attributes[:'send_timeout_in_seconds']
  self.send_timeout_in_seconds = 10.0 if send_timeout_in_seconds.nil? && !attributes.key?(:'sendTimeoutInSeconds') && !attributes.key?(:'send_timeout_in_seconds') # 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
end

Instance Attribute Details

#connect_timeout_in_secondsFloat

Defines a timeout for establishing a connection with a proxied server.

Returns:



19
20
21
# File 'lib/oci/apigateway/models/http_backend.rb', line 19

def connect_timeout_in_seconds
  @connect_timeout_in_seconds
end

#is_ssl_verify_disabledBOOLEAN

Defines whether or not to uphold SSL verification.

Returns:



34
35
36
# File 'lib/oci/apigateway/models/http_backend.rb', line 34

def is_ssl_verify_disabled
  @is_ssl_verify_disabled
end

#read_timeout_in_secondsFloat

Defines a timeout for reading a response from the proxied server.

Returns:



24
25
26
# File 'lib/oci/apigateway/models/http_backend.rb', line 24

def read_timeout_in_seconds
  @read_timeout_in_seconds
end

#send_timeout_in_secondsFloat

Defines a timeout for transmitting a request to the proxied server.

Returns:



29
30
31
# File 'lib/oci/apigateway/models/http_backend.rb', line 29

def send_timeout_in_seconds
  @send_timeout_in_seconds
end

#urlString

This attribute is required.

Returns:



14
15
16
# File 'lib/oci/apigateway/models/http_backend.rb', line 14

def url
  @url
end

Class Method Details

.attribute_mapObject

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



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/oci/apigateway/models/http_backend.rb', line 37

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'url': :'url',
    'connect_timeout_in_seconds': :'connectTimeoutInSeconds',
    'read_timeout_in_seconds': :'readTimeoutInSeconds',
    'send_timeout_in_seconds': :'sendTimeoutInSeconds',
    'is_ssl_verify_disabled': :'isSslVerifyDisabled'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/apigateway/models/http_backend.rb', line 51

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'url': :'String',
    'connect_timeout_in_seconds': :'Float',
    'read_timeout_in_seconds': :'Float',
    'send_timeout_in_seconds': :'Float',
    'is_ssl_verify_disabled': :'BOOLEAN'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • the other object to be compared



127
128
129
130
131
132
133
134
135
136
137
# File 'lib/oci/apigateway/models/http_backend.rb', line 127

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

  self.class == other.class &&
    type == other.type &&
    url == other.url &&
    connect_timeout_in_seconds == other.connect_timeout_in_seconds &&
    read_timeout_in_seconds == other.read_timeout_in_seconds &&
    send_timeout_in_seconds == other.send_timeout_in_seconds &&
    is_ssl_verify_disabled == other.is_ssl_verify_disabled
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/oci/apigateway/models/http_backend.rb', line 162

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

See Also:

  • `==` method

Parameters:

  • the other object to be compared

Returns:



142
143
144
# File 'lib/oci/apigateway/models/http_backend.rb', line 142

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • Hash code



151
152
153
# File 'lib/oci/apigateway/models/http_backend.rb', line 151

def hash
  [type, url, connect_timeout_in_seconds, read_timeout_in_seconds, send_timeout_in_seconds, is_ssl_verify_disabled].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • Returns the object in the form of hash



195
196
197
198
199
200
201
202
203
204
# File 'lib/oci/apigateway/models/http_backend.rb', line 195

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 presentation of the object



189
190
191
# File 'lib/oci/apigateway/models/http_backend.rb', line 189

def to_s
  to_hash.to_s
end