Class: CandidApiClient::NonInsurancePayers::V1::Types::CreateNonInsurancePayerRequest
- Inherits:
-
Object
- Object
- CandidApiClient::NonInsurancePayers::V1::Types::CreateNonInsurancePayerRequest
- Defined in:
- lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #address ⇒ CandidApiClient::Commons::Types::StreetAddressShortZip readonly
-
#category ⇒ String
readonly
Max 255 characters allowed.
-
#clinical_trials ⇒ Array<CandidApiClient::ClinicalTrials::V1::Types::MutableClinicalTrial>
readonly
The same name cannot be used across several clinical trials.
-
#description ⇒ String
readonly
Max 255 characters allowed.
-
#name ⇒ String
readonly
Max 50 characters allowed.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::CreateNonInsurancePayerRequest
Deserialize a JSON object to an instance of CreateNonInsurancePayerRequest.
-
.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(name:, description: OMIT, category: OMIT, address: OMIT, clinical_trials: OMIT, additional_properties: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::CreateNonInsurancePayerRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateNonInsurancePayerRequest to a JSON object.
Constructor Details
#initialize(name:, description: OMIT, category: OMIT, address: OMIT, clinical_trials: OMIT, additional_properties: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::CreateNonInsurancePayerRequest
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 38 def initialize(name:, description: OMIT, category: OMIT, address: OMIT, clinical_trials: OMIT, additional_properties: nil) @name = name @description = description if description != OMIT @category = category if category != OMIT @address = address if address != OMIT @clinical_trials = clinical_trials if clinical_trials != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "description": description, "category": category, "address": address, "clinical_trials": clinical_trials }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 24 def additional_properties @additional_properties end |
#address ⇒ CandidApiClient::Commons::Types::StreetAddressShortZip (readonly)
20 21 22 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 20 def address @address end |
#category ⇒ String (readonly)
Returns Max 255 characters allowed.
18 19 20 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 18 def category @category end |
#clinical_trials ⇒ Array<CandidApiClient::ClinicalTrials::V1::Types::MutableClinicalTrial> (readonly)
Returns The same name cannot be used across several clinical trials.
22 23 24 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 22 def clinical_trials @clinical_trials end |
#description ⇒ String (readonly)
Returns Max 255 characters allowed.
16 17 18 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 16 def description @description end |
#name ⇒ String (readonly)
Returns Max 50 characters allowed.
14 15 16 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 14 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::CreateNonInsurancePayerRequest
Deserialize a JSON object to an instance of CreateNonInsurancePayerRequest
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 61 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = struct["name"] description = struct["description"] category = struct["category"] if parsed_json["address"].nil? address = nil else address = parsed_json["address"].to_json address = CandidApiClient::Commons::Types::StreetAddressShortZip.from_json(json_object: address) end clinical_trials = parsed_json["clinical_trials"]&.map do |item| item = item.to_json CandidApiClient::ClinicalTrials::V1::Types::MutableClinicalTrial.from_json(json_object: item) end new( name: name, description: description, category: category, address: address, clinical_trials: clinical_trials, 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.
100 101 102 103 104 105 106 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 100 def self.validate_raw(obj:) obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.") obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZip.validate_raw(obj: obj.address) obj.clinical_trials&.is_a?(Array) != false || raise("Passed value for field obj.clinical_trials is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateNonInsurancePayerRequest to a JSON object
90 91 92 |
# File 'lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb', line 90 def to_json(*_args) @_field_set&.to_json end |