Class: DatadogAPIClient::V1::SyntheticsTestOptions

Inherits:
Object
  • Object
show all
Includes:
BaseGenericModel
Defined in:
lib/datadog_api_client/v1/models/synthetics_test_options.rb

Overview

Object describing the extra options for a Synthetic test.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseGenericModel

included

Instance Attribute Details

#_retryObject

Object describing the retry strategy to apply to a Synthetic test.



88
89
90
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 88

def _retry
  @_retry
end

#_unparsedObject

whether the object has unparsed attributes



23
24
25
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 23

def _unparsed
  @_unparsed
end

#accept_self_signedObject

For SSL test, whether or not the test should allow self signed certificates.



26
27
28
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 26

def accept_self_signed
  @accept_self_signed
end

#additional_propertiesObject

Returns the value of attribute additional_properties.



109
110
111
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 109

def additional_properties
  @additional_properties
end

#allow_insecureObject

Allows loading insecure content for an HTTP request in an API test.



29
30
31
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 29

def allow_insecure
  @allow_insecure
end

#check_certificate_revocationObject

For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.



32
33
34
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 32

def check_certificate_revocation
  @check_certificate_revocation
end

#ciObject

CI/CD options for a Synthetic test.



35
36
37
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 35

def ci
  @ci
end

#device_idsObject

For browser test, array with the different device IDs used to run the test.



32
33
34
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 32

def device_ids
  @device_ids
end

#disable_corsObject

Whether or not to disable CORS mechanism.



35
36
37
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 35

def disable_cors
  @disable_cors
end

#disable_cspObject

Disable Content Security Policy for browser tests.



44
45
46
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 44

def disable_csp
  @disable_csp
end

#enable_profilingObject

Enable profiling for browser tests.



47
48
49
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 47

def enable_profiling
  @enable_profiling
end

#enable_security_testingObject

Enable security testing for browser tests. Security testing is not available anymore. This field is deprecated and won't be used.



50
51
52
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 50

def enable_security_testing
  @enable_security_testing
end

#follow_redirectsObject

For API HTTP test, whether or not the test should follow redirects.



38
39
40
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 38

def follow_redirects
  @follow_redirects
end

#http_versionObject

HTTP version to use for a Synthetic test.



56
57
58
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 56

def http_version
  @http_version
end

#ignore_server_certificate_errorObject

Ignore server certificate error for browser tests.



59
60
61
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 59

def ignore_server_certificate_error
  @ignore_server_certificate_error
end

#initial_navigation_timeoutObject

Timeout before declaring the initial step as failed (in seconds) for browser tests.



62
63
64
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 62

def initial_navigation_timeout
  @initial_navigation_timeout
end

#min_failure_durationObject

Minimum amount of time in failure required to trigger an alert.



41
42
43
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 41

def min_failure_duration
  @min_failure_duration
end

#min_location_failedObject

Minimum number of locations in failure required to trigger an alert.



44
45
46
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 44

def min_location_failed
  @min_location_failed
end

#monitor_nameObject

The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.



47
48
49
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 47

def monitor_name
  @monitor_name
end

#monitor_optionsObject

Object containing the options for a Synthetic test as a monitor (for example, renotification).



76
77
78
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 76

def monitor_options
  @monitor_options
end

#monitor_priorityObject

Integer from 1 (high) to 5 (low) indicating alert severity.



52
53
54
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 52

def monitor_priority
  @monitor_priority
end

#no_screenshotObject

Prevents saving screenshots of the steps.



55
56
57
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 55

def no_screenshot
  @no_screenshot
end

#restricted_rolesObject

A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.



85
86
87
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 85

def restricted_roles
  @restricted_roles
end

#rum_settingsObject

The RUM data collection settings for the Synthetic browser test. Note: There are 3 ways to format RUM settings:

{ isEnabled: false } RUM data is not collected.

{ isEnabled: true } RUM data is collected from the Synthetic test's default application.

{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", clientTokenId: 12345 } RUM data is collected using the specified application.



101
102
103
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 101

def rum_settings
  @rum_settings
end

#schedulingObject

Object containing timeframes and timezone used for advanced scheduling.



104
105
106
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 104

def scheduling
  @scheduling
end

#tick_everyObject

The frequency at which to run the Synthetic test (in seconds).



60
61
62
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 60

def tick_every
  @tick_every
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



82
83
84
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 82

def self.acceptable_attributes
  attribute_map.values
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



277
278
279
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 277

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



106
107
108
109
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 106

def self.openapi_nullable
  Set.new([
  ])
end

Instance Method Details

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 307

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when :Array
    # generic array, return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = DatadogAPIClient::V1.const_get(type)
    res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
    if res.instance_of? DatadogAPIClient::V1::UnparsedObject
      self._unparsed = true
    end
    res
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 385

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 284

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


264
265
266
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 264

def eql?(o)
  self == o
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 183

def list_invalid_properties
  invalid_properties = Array.new
  if !@monitor_priority.nil? && @monitor_priority > 5
    invalid_properties.push('invalid value for "monitor_priority", must be smaller than or equal to 5.')
  end

  if !@monitor_priority.nil? && @monitor_priority < 1
    invalid_properties.push('invalid value for "monitor_priority", must be greater than or equal to 1.')
  end

  if !@tick_every.nil? && @tick_every > 604800
    invalid_properties.push('invalid value for "tick_every", must be smaller than or equal to 604800.')
  end

  if !@tick_every.nil? && @tick_every < 30
    invalid_properties.push('invalid value for "tick_every", must be greater than or equal to 30.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



361
362
363
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 361

def to_body
  to_hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



355
356
357
# File 'lib/datadog_api_client/v1/models/synthetics_test_options.rb', line 355

def to_s
  to_hash.to_s
end