Class: OCI::ApmSynthetics::Models::RestMonitorConfiguration

Inherits:
MonitorConfiguration show all
Defined in:
lib/oci/apm_synthetics/models/rest_monitor_configuration.rb

Overview

Request configuration details for the REST monitor type.

Constant Summary collapse

REQUEST_METHOD_ENUM =
[
  REQUEST_METHOD_GET = 'GET'.freeze,
  REQUEST_METHOD_POST = 'POST'.freeze,
  REQUEST_METHOD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
REQ_AUTHENTICATION_SCHEME_ENUM =
[
  REQ_AUTHENTICATION_SCHEME_OAUTH = 'OAUTH'.freeze,
  REQ_AUTHENTICATION_SCHEME_NONE = 'NONE'.freeze,
  REQ_AUTHENTICATION_SCHEME_BASIC = 'BASIC'.freeze,
  REQ_AUTHENTICATION_SCHEME_BEARER = 'BEARER'.freeze,
  REQ_AUTHENTICATION_SCHEME_RESOURCE_PRINCIPAL = 'RESOURCE_PRINCIPAL'.freeze,
  REQ_AUTHENTICATION_SCHEME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from MonitorConfiguration

MonitorConfiguration::CONFIG_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from MonitorConfiguration

#config_type, #dns_configuration, #is_failure_retried

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MonitorConfiguration

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ RestMonitorConfiguration

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 144

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

  attributes['configType'] = 'REST_CONFIG'

  super(attributes)

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

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

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

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

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

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

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

  self.request_method = attributes[:'requestMethod'] if attributes[:'requestMethod']
  self.request_method = "GET" if request_method.nil? && !attributes.key?(:'requestMethod') # rubocop:disable Style/StringLiterals

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

  self.request_method = attributes[:'request_method'] if attributes[:'request_method']
  self.request_method = "GET" if request_method.nil? && !attributes.key?(:'requestMethod') && !attributes.key?(:'request_method') # rubocop:disable Style/StringLiterals

  self.req_authentication_scheme = attributes[:'reqAuthenticationScheme'] if attributes[:'reqAuthenticationScheme']
  self.req_authentication_scheme = "NONE" if req_authentication_scheme.nil? && !attributes.key?(:'reqAuthenticationScheme') # rubocop:disable Style/StringLiterals

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

  self.req_authentication_scheme = attributes[:'req_authentication_scheme'] if attributes[:'req_authentication_scheme']
  self.req_authentication_scheme = "NONE" if req_authentication_scheme.nil? && !attributes.key?(:'reqAuthenticationScheme') && !attributes.key?(:'req_authentication_scheme') # rubocop:disable Style/StringLiterals

  self.req_authentication_details = attributes[:'reqAuthenticationDetails'] if attributes[:'reqAuthenticationDetails']

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

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

  self.client_certificate_details = attributes[:'clientCertificateDetails'] if attributes[:'clientCertificateDetails']

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

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

  self.request_headers = attributes[:'requestHeaders'] if attributes[:'requestHeaders']

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

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

  self.request_query_params = attributes[:'requestQueryParams'] if attributes[:'requestQueryParams']

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

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

  self.request_post_body = attributes[:'requestPostBody'] if attributes[:'requestPostBody']

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

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

  self.verify_response_content = attributes[:'verifyResponseContent'] if attributes[:'verifyResponseContent']

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

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

  self.verify_response_codes = attributes[:'verifyResponseCodes'] if attributes[:'verifyResponseCodes']

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

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

  self.network_configuration = attributes[:'networkConfiguration'] if attributes[:'networkConfiguration']

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

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

Instance Attribute Details

#client_certificate_detailsOCI::ApmSynthetics::Models::ClientCertificateDetails



48
49
50
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 48

def client_certificate_details
  @client_certificate_details
end

#is_certificate_validation_enabledBOOLEAN

If certificate validation is enabled, then call will fail for certificate errors.

Returns:

  • (BOOLEAN)


34
35
36
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 34

def is_certificate_validation_enabled
  @is_certificate_validation_enabled
end

#is_redirection_enabledBOOLEAN

If redirection is enabled, then redirects will be allowed while accessing target URL.

Returns:

  • (BOOLEAN)


30
31
32
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 30

def is_redirection_enabled
  @is_redirection_enabled
end

#network_configurationOCI::ApmSynthetics::Models::NetworkConfiguration



76
77
78
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 76

def network_configuration
  @network_configuration
end

#req_authentication_detailsOCI::ApmSynthetics::Models::RequestAuthenticationDetails



45
46
47
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 45

def req_authentication_details
  @req_authentication_details
end

#req_authentication_schemeString

Request HTTP authentication scheme.

Returns:

  • (String)


42
43
44
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 42

def req_authentication_scheme
  @req_authentication_scheme
end

#request_headersArray<OCI::ApmSynthetics::Models::Header>

List of request headers. Example: [{\"headerName\": \"content-type\", \"headerValue\":\"json\"}]



53
54
55
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 53

def request_headers
  @request_headers
end

#request_methodString

Request HTTP method.

Returns:

  • (String)


38
39
40
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 38

def request_method
  @request_method
end

#request_post_bodyString

Request post body content.

Returns:

  • (String)


62
63
64
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 62

def request_post_body
  @request_post_body
end

#request_query_paramsArray<OCI::ApmSynthetics::Models::RequestQueryParam>

List of request query params. Example: [{\"paramName\": \"sortOrder\", \"paramValue\": \"asc\"}]



58
59
60
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 58

def request_query_params
  @request_query_params
end

#verify_response_codesArray<String>

Expected HTTP response codes. For status code range, set values such as 2xx, 3xx.

Returns:

  • (Array<String>)


73
74
75
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 73

def verify_response_codes
  @verify_response_codes
end

#verify_response_contentString

Verify response content against regular expression based string. If response content does not match the verifyResponseContent value, then it will be considered a failure.

Returns:

  • (String)


68
69
70
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 68

def verify_response_content
  @verify_response_content
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
92
93
94
95
96
97
98
99
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 79

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'configType',
    'is_failure_retried': :'isFailureRetried',
    'dns_configuration': :'dnsConfiguration',
    'is_redirection_enabled': :'isRedirectionEnabled',
    'is_certificate_validation_enabled': :'isCertificateValidationEnabled',
    'request_method': :'requestMethod',
    'req_authentication_scheme': :'reqAuthenticationScheme',
    'req_authentication_details': :'reqAuthenticationDetails',
    'client_certificate_details': :'clientCertificateDetails',
    'request_headers': :'requestHeaders',
    'request_query_params': :'requestQueryParams',
    'request_post_body': :'requestPostBody',
    'verify_response_content': :'verifyResponseContent',
    'verify_response_codes': :'verifyResponseCodes',
    'network_configuration': :'networkConfiguration'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 102

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'String',
    'is_failure_retried': :'BOOLEAN',
    'dns_configuration': :'OCI::ApmSynthetics::Models::DnsConfiguration',
    'is_redirection_enabled': :'BOOLEAN',
    'is_certificate_validation_enabled': :'BOOLEAN',
    'request_method': :'String',
    'req_authentication_scheme': :'String',
    'req_authentication_details': :'OCI::ApmSynthetics::Models::RequestAuthenticationDetails',
    'client_certificate_details': :'OCI::ApmSynthetics::Models::ClientCertificateDetails',
    'request_headers': :'Array<OCI::ApmSynthetics::Models::Header>',
    'request_query_params': :'Array<OCI::ApmSynthetics::Models::RequestQueryParam>',
    'request_post_body': :'String',
    'verify_response_content': :'String',
    'verify_response_codes': :'Array<String>',
    'network_configuration': :'OCI::ApmSynthetics::Models::NetworkConfiguration'
    # 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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 268

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

  self.class == other.class &&
    config_type == other.config_type &&
    is_failure_retried == other.is_failure_retried &&
    dns_configuration == other.dns_configuration &&
    is_redirection_enabled == other.is_redirection_enabled &&
    is_certificate_validation_enabled == other.is_certificate_validation_enabled &&
    request_method == other.request_method &&
    req_authentication_scheme == other.req_authentication_scheme &&
    req_authentication_details == other.req_authentication_details &&
    client_certificate_details == other.client_certificate_details &&
    request_headers == other.request_headers &&
    request_query_params == other.request_query_params &&
    request_post_body == other.request_post_body &&
    verify_response_content == other.verify_response_content &&
    verify_response_codes == other.verify_response_codes &&
    network_configuration == other.network_configuration
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



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 312

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


292
293
294
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 292

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



301
302
303
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 301

def hash
  [config_type, is_failure_retried, dns_configuration, is_redirection_enabled, is_certificate_validation_enabled, request_method, req_authentication_scheme, req_authentication_details, client_certificate_details, request_headers, request_query_params, request_post_body, verify_response_content, verify_response_codes, network_configuration].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



345
346
347
348
349
350
351
352
353
354
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 345

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



339
340
341
# File 'lib/oci/apm_synthetics/models/rest_monitor_configuration.rb', line 339

def to_s
  to_hash.to_s
end