casemanager_client 0.0.5

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 (49) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +8 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +111 -0
  5. data/Rakefile +10 -0
  6. data/bin/console +14 -0
  7. data/bin/setup +8 -0
  8. data/casemanager_client.gemspec +45 -0
  9. data/docs/CaseItem.md +10 -0
  10. data/docs/CaseWithPatient.md +12 -0
  11. data/docs/DefaultApi.md +238 -0
  12. data/docs/Error.md +9 -0
  13. data/docs/ModelCase.md +11 -0
  14. data/docs/Patient.md +14 -0
  15. data/docs/PatientWithCases.md +15 -0
  16. data/docs/Patients.md +8 -0
  17. data/docs/Workflow.md +9 -0
  18. data/docs/WorkflowTask.md +14 -0
  19. data/gen.sh +3 -0
  20. data/git_push.sh +55 -0
  21. data/lib/casemanager_client.rb +48 -0
  22. data/lib/casemanager_client/api/default_api.rb +301 -0
  23. data/lib/casemanager_client/api_client.rb +390 -0
  24. data/lib/casemanager_client/api_error.rb +38 -0
  25. data/lib/casemanager_client/configuration.rb +259 -0
  26. data/lib/casemanager_client/models/case_item.rb +250 -0
  27. data/lib/casemanager_client/models/case_with_patient.rb +236 -0
  28. data/lib/casemanager_client/models/error.rb +202 -0
  29. data/lib/casemanager_client/models/model_case.rb +222 -0
  30. data/lib/casemanager_client/models/patient.rb +242 -0
  31. data/lib/casemanager_client/models/patient_with_cases.rb +258 -0
  32. data/lib/casemanager_client/models/patients.rb +190 -0
  33. data/lib/casemanager_client/models/workflow.rb +204 -0
  34. data/lib/casemanager_client/models/workflow_task.rb +272 -0
  35. data/lib/casemanager_client/version.rb +15 -0
  36. data/pkg/casemanager_client-0.0.5.gem +0 -0
  37. data/spec/api/default_api_spec.rb +60 -0
  38. data/spec/api_client_spec.rb +226 -0
  39. data/spec/configuration_spec.rb +42 -0
  40. data/spec/models/case_item_spec.rb +53 -0
  41. data/spec/models/case_with_patient_spec.rb +59 -0
  42. data/spec/models/error_spec.rb +47 -0
  43. data/spec/models/model_case_spec.rb +53 -0
  44. data/spec/models/patient_spec.rb +53 -0
  45. data/spec/models/patient_with_cases_spec.rb +59 -0
  46. data/spec/models/workflow_spec.rb +47 -0
  47. data/spec/models/workflow_task_spec.rb +77 -0
  48. data/spec/spec_helper.rb +111 -0
  49. metadata +283 -0
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #SPX: CaseManager
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ OpenAPI spec version: 1.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.4
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CasemanagerClient
16
+ class CaseItem
17
+ attr_accessor :id
18
+
19
+ attr_accessor :source_type
20
+
21
+ attr_accessor :source_identifier
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'id' => :'id',
49
+ :'source_type' => :'source_type',
50
+ :'source_identifier' => :'source_identifier'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'id' => :'Integer',
58
+ :'source_type' => :'String',
59
+ :'source_identifier' => :'String'
60
+ }
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ return unless attributes.is_a?(Hash)
67
+
68
+ # convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
70
+
71
+ if attributes.has_key?(:'id')
72
+ self.id = attributes[:'id']
73
+ end
74
+
75
+ if attributes.has_key?(:'source_type')
76
+ self.source_type = attributes[:'source_type']
77
+ end
78
+
79
+ if attributes.has_key?(:'source_identifier')
80
+ self.source_identifier = attributes[:'source_identifier']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ if @id.nil?
89
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
90
+ end
91
+
92
+ if @source_type.nil?
93
+ invalid_properties.push('invalid value for "source_type", source_type cannot be nil.')
94
+ end
95
+
96
+ if @source_identifier.nil?
97
+ invalid_properties.push('invalid value for "source_identifier", source_identifier cannot be nil.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ return false if @id.nil?
107
+ return false if @source_type.nil?
108
+ source_type_validator = EnumAttributeValidator.new('String', ['Benefits Investigation', 'Benefits Verification', 'Hub Enrollment', 'PA', 'Prescription', 'Specialty Pharmacy Enrollment'])
109
+ return false unless source_type_validator.valid?(@source_type)
110
+ return false if @source_identifier.nil?
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method checking allowed values (enum).
115
+ # @param [Object] source_type Object to be assigned
116
+ def source_type=(source_type)
117
+ validator = EnumAttributeValidator.new('String', ['Benefits Investigation', 'Benefits Verification', 'Hub Enrollment', 'PA', 'Prescription', 'Specialty Pharmacy Enrollment'])
118
+ unless validator.valid?(source_type)
119
+ fail ArgumentError, 'invalid value for "source_type", must be one of #{validator.allowable_values}.'
120
+ end
121
+ @source_type = source_type
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ id == o.id &&
130
+ source_type == o.source_type &&
131
+ source_identifier == o.source_identifier
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Fixnum] Hash code
142
+ def hash
143
+ [id, source_type, source_identifier].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :DateTime
173
+ DateTime.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :BOOLEAN
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ temp_model = CasemanagerClient.const_get(type).new
204
+ temp_model.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ next if value.nil?
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+ end
250
+ end
@@ -0,0 +1,236 @@
1
+ =begin
2
+ #SPX: CaseManager
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ OpenAPI spec version: 1.1.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.4
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CasemanagerClient
16
+ class CaseWithPatient
17
+ attr_accessor :key
18
+
19
+ attr_accessor :patient
20
+
21
+ attr_accessor :items
22
+
23
+ attr_accessor :created_at
24
+
25
+ attr_accessor :workflow
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'key' => :'key',
31
+ :'patient' => :'patient',
32
+ :'items' => :'items',
33
+ :'created_at' => :'created_at',
34
+ :'workflow' => :'workflow'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'key' => :'String',
42
+ :'patient' => :'Patient',
43
+ :'items' => :'Array<CaseItem>',
44
+ :'created_at' => :'String',
45
+ :'workflow' => :'Workflow'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'key')
58
+ self.key = attributes[:'key']
59
+ end
60
+
61
+ if attributes.has_key?(:'patient')
62
+ self.patient = attributes[:'patient']
63
+ end
64
+
65
+ if attributes.has_key?(:'items')
66
+ if (value = attributes[:'items']).is_a?(Array)
67
+ self.items = value
68
+ end
69
+ end
70
+
71
+ if attributes.has_key?(:'created_at')
72
+ self.created_at = attributes[:'created_at']
73
+ end
74
+
75
+ if attributes.has_key?(:'workflow')
76
+ self.workflow = attributes[:'workflow']
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
+ invalid_properties = Array.new
84
+ if @key.nil?
85
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
86
+ end
87
+
88
+ if @patient.nil?
89
+ invalid_properties.push('invalid value for "patient", patient cannot be nil.')
90
+ end
91
+
92
+ if @items.nil?
93
+ invalid_properties.push('invalid value for "items", items cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ return false if @key.nil?
103
+ return false if @patient.nil?
104
+ return false if @items.nil?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ key == o.key &&
114
+ patient == o.patient &&
115
+ items == o.items &&
116
+ created_at == o.created_at &&
117
+ workflow == o.workflow
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [key, patient, items, created_at, workflow].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :BOOLEAN
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ temp_model = CasemanagerClient.const_get(type).new
190
+ temp_model.build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ next if value.nil?
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+ end
236
+ end