Class: DatadogAPIClient::V1::SyntheticsTestRequest

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

Overview

Object describing the Synthetic test request.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseGenericModel

included

Instance Attribute Details

#_unparsedObject

whether the object has unparsed attributes



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

def _unparsed
  @_unparsed
end

#additional_propertiesObject

Returns the value of attribute additional_properties.



116
117
118
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 116

def additional_properties
  @additional_properties
end

#allow_insecureObject

Allows loading insecure content for an HTTP request in a multistep test step.



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

def allow_insecure
  @allow_insecure
end

#basic_authObject

Object to handle basic authentication when performing the test.



28
29
30
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 28

def basic_auth
  @basic_auth
end

#bodyObject

Body to include in the test.



31
32
33
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 31

def body
  @body
end

#body_typeObject

Type of the request body.



34
35
36
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 34

def body_type
  @body_type
end

#call_typeObject

The type of gRPC call to perform.



37
38
39
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 37

def call_type
  @call_type
end

#certificateObject

Client certificate to use when performing the test request.



40
41
42
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 40

def certificate
  @certificate
end

#certificate_domainsObject

By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificateDomains.



43
44
45
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 43

def certificate_domains
  @certificate_domains
end

#compressed_json_descriptorObject

A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.



46
47
48
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 46

def compressed_json_descriptor
  @compressed_json_descriptor
end

#compressed_proto_fileObject

A protobuf file that needs to be gzipped first then base64 encoded.



49
50
51
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 49

def compressed_proto_file
  @compressed_proto_file
end

#dns_serverObject

DNS server to use for DNS tests.



36
37
38
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 36

def dns_server
  @dns_server
end

#dns_server_portObject

DNS server port to use for DNS tests.



39
40
41
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 39

def dns_server_port
  @dns_server_port
end

#filesObject

Files to be used as part of the request in the test.



58
59
60
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 58

def files
  @files
end

#follow_redirectsObject

Specifies whether or not the request follows redirects.



42
43
44
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 42

def follow_redirects
  @follow_redirects
end

#headersObject

Headers to include when performing the test.



45
46
47
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 45

def headers
  @headers
end

#hostObject

Host name to perform the test with.



48
49
50
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 48

def host
  @host
end

#http_versionObject

HTTP version to use for a Synthetic test.



70
71
72
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 70

def http_version
  @http_version
end

#messageObject

Message to send for UDP or WebSocket tests.



51
52
53
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 51

def message
  @message
end

#metadataObject

Metadata to include when performing the gRPC test.



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

def 
  @metadata
end

#methodObject

Either the HTTP method/verb to use or a gRPC method available on the service set in the service field. Required if subtype is HTTP or if subtype is grpc and callType is unary.



79
80
81
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 79

def method
  @method
end

#no_saving_response_bodyObject

Determines whether or not to save the response body.



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

def no_saving_response_body
  @no_saving_response_body
end

#number_of_packetsObject

Number of pings to use per test.



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

def number_of_packets
  @number_of_packets
end

#persist_cookiesObject

Persist cookies across redirects.



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

def persist_cookies
  @persist_cookies
end

#portObject

Port to use when performing the test.



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

def port
  @port
end

#proxyObject

The proxy to perform the test.



94
95
96
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 94

def proxy
  @proxy
end

#queryObject

Query to use for the test.



67
68
69
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 67

def query
  @query
end

#servernameObject

For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.



70
71
72
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 70

def servername
  @servername
end

#serviceObject

The gRPC service on which you want to perform the gRPC call.



105
106
107
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 105

def service
  @service
end

#should_track_hopsObject

Turns on a traceroute probe to discover all gateways along the path to the host destination.



73
74
75
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 73

def should_track_hops
  @should_track_hops
end

#timeoutObject

Timeout in seconds for the test.



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

def timeout
  @timeout
end

#urlObject

URL to perform the test with.



79
80
81
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 79

def url
  @url
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



108
109
110
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 108

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



345
346
347
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 345

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

.openapi_nullableObject

List of attributes with nullable: true



139
140
141
142
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 139

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



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 375

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



453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 453

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



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 352

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


332
333
334
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 332

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



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 244

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

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

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

  if !@number_of_packets.nil? && @number_of_packets < 0
    invalid_properties.push('invalid value for "number_of_packets", must be greater than or equal to 0.')
  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



429
430
431
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 429

def to_body
  to_hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



423
424
425
# File 'lib/datadog_api_client/v1/models/synthetics_test_request.rb', line 423

def to_s
  to_hash.to_s
end