relentless_identity 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +143 -0
  4. data/Rakefile +10 -0
  5. data/docs/AccountApi.md +219 -0
  6. data/docs/AliasInfo.md +20 -0
  7. data/docs/BatchSummary.md +26 -0
  8. data/docs/ClientBackgroundJobDetailResponse.md +30 -0
  9. data/docs/ClientBackgroundJobItemResponse.md +48 -0
  10. data/docs/ClientBackgroundJobPageResponse.md +26 -0
  11. data/docs/ClientBackgroundJobResponse.md +76 -0
  12. data/docs/ClientBatchIdentityResponse.md +20 -0
  13. data/docs/ClientFinderResponse.md +34 -0
  14. data/docs/ClientFinderResponseAlias.md +20 -0
  15. data/docs/ClientIdentityResponse.md +34 -0
  16. data/docs/ClientRequestHistoryItem.md +52 -0
  17. data/docs/ClientRequestHistoryPageResponse.md +26 -0
  18. data/docs/ClientTokenStatusResponse.md +28 -0
  19. data/docs/ClientUsageResponse.md +54 -0
  20. data/docs/ErrorResponse.md +24 -0
  21. data/docs/FinderApi.md +77 -0
  22. data/docs/FinderBatchJobRequest.md +22 -0
  23. data/docs/FinderBatchJobRequestInputsInner.md +20 -0
  24. data/docs/FinderRequest.md +20 -0
  25. data/docs/HTTPValidationError.md +18 -0
  26. data/docs/IdentityProvider.md +20 -0
  27. data/docs/JobsApi.md +529 -0
  28. data/docs/LocationInner.md +15 -0
  29. data/docs/ProbeApi.md +147 -0
  30. data/docs/ProbeBatchJobBackgroundRequest.md +22 -0
  31. data/docs/ProbeBatchRequest.md +18 -0
  32. data/docs/ProbeRequest.md +18 -0
  33. data/docs/ValidationError.md +26 -0
  34. data/git_push.sh +57 -0
  35. data/lib/relentless_identity/api/account_api.rb +225 -0
  36. data/lib/relentless_identity/api/finder_api.rb +90 -0
  37. data/lib/relentless_identity/api/jobs_api.rb +535 -0
  38. data/lib/relentless_identity/api/probe_api.rb +158 -0
  39. data/lib/relentless_identity/api_client.rb +397 -0
  40. data/lib/relentless_identity/api_error.rb +58 -0
  41. data/lib/relentless_identity/api_model_base.rb +88 -0
  42. data/lib/relentless_identity/configuration.rb +309 -0
  43. data/lib/relentless_identity/models/alias_info.rb +159 -0
  44. data/lib/relentless_identity/models/batch_summary.rb +318 -0
  45. data/lib/relentless_identity/models/client_background_job_detail_response.rb +307 -0
  46. data/lib/relentless_identity/models/client_background_job_item_response.rb +455 -0
  47. data/lib/relentless_identity/models/client_background_job_page_response.rb +271 -0
  48. data/lib/relentless_identity/models/client_background_job_response.rb +745 -0
  49. data/lib/relentless_identity/models/client_batch_identity_response.rb +194 -0
  50. data/lib/relentless_identity/models/client_finder_response.rb +285 -0
  51. data/lib/relentless_identity/models/client_finder_response_alias.rb +104 -0
  52. data/lib/relentless_identity/models/client_identity_response.rb +285 -0
  53. data/lib/relentless_identity/models/client_request_history_item.rb +450 -0
  54. data/lib/relentless_identity/models/client_request_history_page_response.rb +271 -0
  55. data/lib/relentless_identity/models/client_token_status_response.rb +259 -0
  56. data/lib/relentless_identity/models/client_usage_response.rb +506 -0
  57. data/lib/relentless_identity/models/error_response.rb +178 -0
  58. data/lib/relentless_identity/models/finder_batch_job_request.rb +206 -0
  59. data/lib/relentless_identity/models/finder_batch_job_request_inputs_inner.rb +192 -0
  60. data/lib/relentless_identity/models/finder_request.rb +193 -0
  61. data/lib/relentless_identity/models/http_validation_error.rb +149 -0
  62. data/lib/relentless_identity/models/identity_provider.rb +157 -0
  63. data/lib/relentless_identity/models/location_inner.rb +103 -0
  64. data/lib/relentless_identity/models/probe_batch_job_background_request.rb +206 -0
  65. data/lib/relentless_identity/models/probe_batch_request.rb +186 -0
  66. data/lib/relentless_identity/models/probe_request.rb +166 -0
  67. data/lib/relentless_identity/models/validation_error.rb +237 -0
  68. data/lib/relentless_identity/version.rb +15 -0
  69. data/lib/relentless_identity.rb +69 -0
  70. data/relentless_identity.gemspec +39 -0
  71. data/spec/api/account_api_spec.rb +72 -0
  72. data/spec/api/finder_api_spec.rb +47 -0
  73. data/spec/api/jobs_api_spec.rb +130 -0
  74. data/spec/api/probe_api_spec.rb +59 -0
  75. data/spec/models/alias_info_spec.rb +42 -0
  76. data/spec/models/batch_summary_spec.rb +60 -0
  77. data/spec/models/client_background_job_detail_response_spec.rb +72 -0
  78. data/spec/models/client_background_job_item_response_spec.rb +138 -0
  79. data/spec/models/client_background_job_page_response_spec.rb +60 -0
  80. data/spec/models/client_background_job_response_spec.rb +222 -0
  81. data/spec/models/client_batch_identity_response_spec.rb +42 -0
  82. data/spec/models/client_finder_response_alias_spec.rb +21 -0
  83. data/spec/models/client_finder_response_spec.rb +92 -0
  84. data/spec/models/client_identity_response_spec.rb +92 -0
  85. data/spec/models/client_request_history_item_spec.rb +150 -0
  86. data/spec/models/client_request_history_page_response_spec.rb +60 -0
  87. data/spec/models/client_token_status_response_spec.rb +70 -0
  88. data/spec/models/client_usage_response_spec.rb +144 -0
  89. data/spec/models/error_response_spec.rb +54 -0
  90. data/spec/models/finder_batch_job_request_inputs_inner_spec.rb +42 -0
  91. data/spec/models/finder_batch_job_request_spec.rb +48 -0
  92. data/spec/models/finder_request_spec.rb +42 -0
  93. data/spec/models/http_validation_error_spec.rb +36 -0
  94. data/spec/models/identity_provider_spec.rb +42 -0
  95. data/spec/models/location_inner_spec.rb +21 -0
  96. data/spec/models/probe_batch_job_background_request_spec.rb +48 -0
  97. data/spec/models/probe_batch_request_spec.rb +36 -0
  98. data/spec/models/probe_request_spec.rb +36 -0
  99. data/spec/models/validation_error_spec.rb +60 -0
  100. data/spec/spec_helper.rb +111 -0
  101. metadata +213 -0
@@ -0,0 +1,149 @@
1
+ =begin
2
+ #Relentless Identity API
3
+
4
+ #Public client API for Finder and Probe workflows. This spec is generated from the FastAPI app, then narrowed to the supported bearer-authenticated routes used by SDKs and the API reference.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RelentlessIdentity
17
+ class HTTPValidationError < ApiModelBase
18
+ attr_accessor :detail
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'detail' => :'detail'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'detail' => :'Array<ValidationError>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RelentlessIdentity::HTTPValidationError` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RelentlessIdentity::HTTPValidationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'detail')
67
+ if (value = attributes[:'detail']).is_a?(Array)
68
+ self.detail = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ detail == o.detail
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [detail].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end
@@ -0,0 +1,157 @@
1
+ =begin
2
+ #Relentless Identity API
3
+
4
+ #Public client API for Finder and Probe workflows. This spec is generated from the FastAPI app, then narrowed to the supported bearer-authenticated routes used by SDKs and the API reference.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RelentlessIdentity
17
+ class IdentityProvider < ApiModelBase
18
+ attr_accessor :provider
19
+
20
+ attr_accessor :hostname
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'provider' => :'provider',
26
+ :'hostname' => :'hostname'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'provider' => :'String',
44
+ :'hostname' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ :'hostname'
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RelentlessIdentity::IdentityProvider` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RelentlessIdentity::IdentityProvider`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'provider')
72
+ self.provider = attributes[:'provider']
73
+ end
74
+
75
+ if attributes.key?(:'hostname')
76
+ self.hostname = attributes[:'hostname']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ provider == o.provider &&
101
+ hostname == o.hostname
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [provider, hostname].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end
@@ -0,0 +1,103 @@
1
+ =begin
2
+ #Relentless Identity API
3
+
4
+ #Public client API for Finder and Probe workflows. This spec is generated from the FastAPI app, then narrowed to the supported bearer-authenticated routes used by SDKs and the API reference.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RelentlessIdentity
17
+ module LocationInner
18
+ class << self
19
+ # List of class defined in anyOf (OpenAPI v3)
20
+ def openapi_any_of
21
+ [
22
+ :'Integer',
23
+ :'String'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of anyOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
34
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
35
+ # - TODO: scalar values are de facto behaving as if they were nullable.
36
+ # - TODO: logging when debugging is set.
37
+ openapi_any_of.each do |klass|
38
+ begin
39
+ next if klass == :AnyType # "nullable: true"
40
+ return find_and_cast_into_type(klass, data)
41
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
42
+ end
43
+ end
44
+
45
+ openapi_any_of.include?(:AnyType) ? data : nil
46
+ end
47
+
48
+ private
49
+
50
+ SchemaMismatchError = Class.new(StandardError)
51
+
52
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
53
+ def find_and_cast_into_type(klass, data)
54
+ return if data.nil?
55
+
56
+ case klass.to_s
57
+ when 'Boolean'
58
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
59
+ when 'Float'
60
+ return data if data.instance_of?(Float)
61
+ when 'Integer'
62
+ return data if data.instance_of?(Integer)
63
+ when 'Time'
64
+ return Time.parse(data)
65
+ when 'Date'
66
+ return Date.iso8601(data)
67
+ when 'String'
68
+ return data if data.instance_of?(String)
69
+ when 'Object' # "type: object"
70
+ return data if data.instance_of?(Hash)
71
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
72
+ if data.instance_of?(Array)
73
+ sub_type = Regexp.last_match[:sub_type]
74
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
75
+ end
76
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
77
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
78
+ sub_type = Regexp.last_match[:sub_type]
79
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
80
+ end
81
+ else # model
82
+ const = RelentlessIdentity.const_get(klass)
83
+ if const
84
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
85
+ model = const.build(data)
86
+ return model if model
87
+ else
88
+ # raise if data contains keys that are not known to the model
89
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
+ model = const.build_from_hash(data)
91
+ return model if model
92
+ end
93
+ end
94
+ end
95
+
96
+ raise # if no match by now, raise
97
+ rescue
98
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
99
+ end
100
+ end
101
+ end
102
+
103
+ end
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Relentless Identity API
3
+
4
+ #Public client API for Finder and Probe workflows. This spec is generated from the FastAPI app, then narrowed to the supported bearer-authenticated routes used by SDKs and the API reference.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RelentlessIdentity
17
+ # Queue a background Probe Batch workload that can wait for capacity and complete asynchronously.
18
+ class ProbeBatchJobBackgroundRequest < ApiModelBase
19
+ # Optional hard deadline for the job. Omit it to start as soon as capacity allows. If provided, the API returns 422 when the deadline is too tight even with immediate execution.
20
+ attr_accessor :deadline
21
+
22
+ attr_accessor :callback_url
23
+
24
+ # One or more exact mailbox addresses to verify asynchronously.
25
+ attr_accessor :emails
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'deadline' => :'deadline',
31
+ :'callback_url' => :'callback_url',
32
+ :'emails' => :'emails'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'deadline' => :'Time',
50
+ :'callback_url' => :'String',
51
+ :'emails' => :'Array<String>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'callback_url',
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RelentlessIdentity::ProbeBatchJobBackgroundRequest` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RelentlessIdentity::ProbeBatchJobBackgroundRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'deadline')
79
+ self.deadline = attributes[:'deadline']
80
+ end
81
+
82
+ if attributes.key?(:'callback_url')
83
+ self.callback_url = attributes[:'callback_url']
84
+ end
85
+
86
+ if attributes.key?(:'emails')
87
+ if (value = attributes[:'emails']).is_a?(Array)
88
+ self.emails = value
89
+ end
90
+ else
91
+ self.emails = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @emails.nil?
101
+ invalid_properties.push('invalid value for "emails", emails cannot be nil.')
102
+ end
103
+
104
+ if @emails.length > 100
105
+ invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 100.')
106
+ end
107
+
108
+ if @emails.length < 1
109
+ invalid_properties.push('invalid value for "emails", number of items must be greater than or equal to 1.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if @emails.nil?
120
+ return false if @emails.length > 100
121
+ return false if @emails.length < 1
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] emails Value to be assigned
127
+ def emails=(emails)
128
+ if emails.nil?
129
+ fail ArgumentError, 'emails cannot be nil'
130
+ end
131
+
132
+ if emails.length > 100
133
+ fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 100.'
134
+ end
135
+
136
+ if emails.length < 1
137
+ fail ArgumentError, 'invalid value for "emails", number of items must be greater than or equal to 1.'
138
+ end
139
+
140
+ @emails = emails
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ deadline == o.deadline &&
149
+ callback_url == o.callback_url &&
150
+ emails == o.emails
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [deadline, callback_url, emails].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ end
205
+
206
+ end