Class: CandidApiClient::PreEncounter::Patients::V1::Types::PatientPage
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Patients::V1::Types::PatientPage
- Defined in:
- lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #items ⇒ Array<CandidApiClient::PreEncounter::Patients::V1::Types::Patient> readonly
- #next_page_token ⇒ String readonly
- #prev_page_token ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::PatientPage
Deserialize a JSON object to an instance of PatientPage.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(items:, next_page_token: OMIT, prev_page_token: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::PatientPage constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of PatientPage to a JSON object.
Constructor Details
#initialize(items:, next_page_token: OMIT, prev_page_token: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::PatientPage
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 32 def initialize(items:, next_page_token: OMIT, prev_page_token: OMIT, additional_properties: nil) @items = items @next_page_token = next_page_token if next_page_token != OMIT @prev_page_token = prev_page_token if prev_page_token != OMIT @additional_properties = additional_properties @_field_set = { "items": items, "next_page_token": next_page_token, "prev_page_token": prev_page_token }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 20 def additional_properties @additional_properties end |
#items ⇒ Array<CandidApiClient::PreEncounter::Patients::V1::Types::Patient> (readonly)
14 15 16 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 14 def items @items end |
#next_page_token ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 16 def next_page_token @next_page_token end |
#prev_page_token ⇒ String (readonly)
18 19 20 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 18 def prev_page_token @prev_page_token end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::PatientPage
Deserialize a JSON object to an instance of PatientPage
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) items = parsed_json["items"]&.map do |item| item = item.to_json CandidApiClient::PreEncounter::Patients::V1::Types::Patient.from_json(json_object: item) end next_page_token = struct["next_page_token"] prev_page_token = struct["prev_page_token"] new( items: items, next_page_token: next_page_token, prev_page_token: prev_page_token, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
80 81 82 83 84 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 80 def self.validate_raw(obj:) obj.items.is_a?(Array) != false || raise("Passed value for field obj.items is not the expected type, validation failed.") obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.") obj.prev_page_token&.is_a?(String) != false || raise("Passed value for field obj.prev_page_token is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of PatientPage to a JSON object
70 71 72 |
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb', line 70 def to_json(*_args) @_field_set&.to_json end |