Class: CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePage
- Inherits:
-
Object
- Object
- CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePage
- Defined in:
- lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #item_count ⇒ Integer readonly
- #items ⇒ Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCapture> readonly
- #next_page_token ⇒ String readonly
- #prev_page_token ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePage
Deserialize a JSON object to an instance of ChargeCapturePage.
-
.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:, item_count:, prev_page_token: OMIT, next_page_token: OMIT, additional_properties: nil) ⇒ CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePage constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ChargeCapturePage to a JSON object.
Constructor Details
#initialize(items:, item_count:, prev_page_token: OMIT, next_page_token: OMIT, additional_properties: nil) ⇒ CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePage
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 34 def initialize(items:, item_count:, prev_page_token: OMIT, next_page_token: OMIT, additional_properties: nil) @items = items @item_count = item_count @prev_page_token = prev_page_token if prev_page_token != OMIT @next_page_token = next_page_token if next_page_token != OMIT @additional_properties = additional_properties @_field_set = { "items": items, "item_count": item_count, "prev_page_token": prev_page_token, "next_page_token": next_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.
21 22 23 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 21 def additional_properties @additional_properties end |
#item_count ⇒ Integer (readonly)
15 16 17 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 15 def item_count @item_count end |
#items ⇒ Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCapture> (readonly)
13 14 15 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 13 def items @items end |
#next_page_token ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 19 def next_page_token @next_page_token end |
#prev_page_token ⇒ String (readonly)
17 18 19 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 17 def prev_page_token @prev_page_token end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePage
Deserialize a JSON object to an instance of ChargeCapturePage
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 54 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::ChargeCapture::V1::Types::ChargeCapture.from_json(json_object: item) end item_count = struct["item_count"] prev_page_token = struct["prev_page_token"] next_page_token = struct["next_page_token"] new( items: items, item_count: item_count, prev_page_token: prev_page_token, next_page_token: next_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.
86 87 88 89 90 91 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 86 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.item_count.is_a?(Integer) != false || raise("Passed value for field obj.item_count 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.") obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ChargeCapturePage to a JSON object
76 77 78 |
# File 'lib/candidhealth/charge_capture/v_1/types/charge_capture_page.rb', line 76 def to_json(*_args) @_field_set&.to_json end |