Class: CandidApiClient::PreEncounter::Common::Types::VersionConflictErrorBody
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Common::Types::VersionConflictErrorBody
- Defined in:
- lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #code ⇒ String readonly
- #latest_version ⇒ Integer readonly
- #message ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Common::Types::VersionConflictErrorBody
Deserialize a JSON object to an instance of VersionConflictErrorBody.
-
.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(code:, latest_version:, message:, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Common::Types::VersionConflictErrorBody constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of VersionConflictErrorBody to a JSON object.
Constructor Details
#initialize(code:, latest_version:, message:, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Common::Types::VersionConflictErrorBody
30 31 32 33 34 35 36 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 30 def initialize(code:, latest_version:, message:, additional_properties: nil) @code = code @latest_version = latest_version @message = @additional_properties = additional_properties @_field_set = { "code": code, "latest_version": latest_version, "message": } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 18 def additional_properties @additional_properties end |
#code ⇒ String (readonly)
12 13 14 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 12 def code @code end |
#latest_version ⇒ Integer (readonly)
14 15 16 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 14 def latest_version @latest_version end |
#message ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 16 def @message end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Common::Types::VersionConflictErrorBody
Deserialize a JSON object to an instance of VersionConflictErrorBody
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) code = struct["code"] latest_version = struct["latest_version"] = struct["message"] new( code: code, latest_version: latest_version, message: , 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.
68 69 70 71 72 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 68 def self.validate_raw(obj:) obj.code.is_a?(String) != false || raise("Passed value for field obj.code is not the expected type, validation failed.") obj.latest_version.is_a?(Integer) != false || raise("Passed value for field obj.latest_version is not the expected type, validation failed.") obj..is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of VersionConflictErrorBody to a JSON object
58 59 60 |
# File 'lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb', line 58 def to_json(*_args) @_field_set&.to_json end |