candidhealth 0.43.1 → 0.45.0

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.
@@ -0,0 +1,125 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/street_address_short_zip_optional"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module EncounterProviders
9
+ module V2
10
+ module Types
11
+ class RenderingProviderUpdateWithOptionalAddress
12
+ # @return [String] A National Provider Identifier is a unique 10-digit identification
13
+ # number issued to health care providers in the United States
14
+ attr_reader :npi
15
+ # @return [String]
16
+ attr_reader :taxonomy_code
17
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
18
+ attr_reader :address
19
+ # @return [String] If the provider is an individual, this should be set instead of organization
20
+ # name
21
+ attr_reader :first_name
22
+ # @return [String] If the provider is an individual, this should be set instead of organization
23
+ # name
24
+ attr_reader :last_name
25
+ # @return [String] If the provider is an organization, this should be set instead of first + last
26
+ # name
27
+ attr_reader :organization_name
28
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
29
+ attr_reader :additional_properties
30
+ # @return [Object]
31
+ attr_reader :_field_set
32
+ protected :_field_set
33
+
34
+ OMIT = Object.new
35
+
36
+ # @param npi [String] A National Provider Identifier is a unique 10-digit identification
37
+ # number issued to health care providers in the United States
38
+ # @param taxonomy_code [String]
39
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
40
+ # @param first_name [String] If the provider is an individual, this should be set instead of organization
41
+ # name
42
+ # @param last_name [String] If the provider is an individual, this should be set instead of organization
43
+ # name
44
+ # @param organization_name [String] If the provider is an organization, this should be set instead of first + last
45
+ # name
46
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
47
+ # @return [CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdateWithOptionalAddress]
48
+ def initialize(npi: OMIT, taxonomy_code: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT,
49
+ organization_name: OMIT, additional_properties: nil)
50
+ @npi = npi if npi != OMIT
51
+ @taxonomy_code = taxonomy_code if taxonomy_code != OMIT
52
+ @address = address if address != OMIT
53
+ @first_name = first_name if first_name != OMIT
54
+ @last_name = last_name if last_name != OMIT
55
+ @organization_name = organization_name if organization_name != OMIT
56
+ @additional_properties = additional_properties
57
+ @_field_set = {
58
+ "npi": npi,
59
+ "taxonomy_code": taxonomy_code,
60
+ "address": address,
61
+ "first_name": first_name,
62
+ "last_name": last_name,
63
+ "organization_name": organization_name
64
+ }.reject do |_k, v|
65
+ v == OMIT
66
+ end
67
+ end
68
+
69
+ # Deserialize a JSON object to an instance of
70
+ # RenderingProviderUpdateWithOptionalAddress
71
+ #
72
+ # @param json_object [String]
73
+ # @return [CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdateWithOptionalAddress]
74
+ def self.from_json(json_object:)
75
+ struct = JSON.parse(json_object, object_class: OpenStruct)
76
+ parsed_json = JSON.parse(json_object)
77
+ npi = struct["npi"]
78
+ taxonomy_code = struct["taxonomy_code"]
79
+ if parsed_json["address"].nil?
80
+ address = nil
81
+ else
82
+ address = parsed_json["address"].to_json
83
+ address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address)
84
+ end
85
+ first_name = struct["first_name"]
86
+ last_name = struct["last_name"]
87
+ organization_name = struct["organization_name"]
88
+ new(
89
+ npi: npi,
90
+ taxonomy_code: taxonomy_code,
91
+ address: address,
92
+ first_name: first_name,
93
+ last_name: last_name,
94
+ organization_name: organization_name,
95
+ additional_properties: struct
96
+ )
97
+ end
98
+
99
+ # Serialize an instance of RenderingProviderUpdateWithOptionalAddress to a JSON
100
+ # object
101
+ #
102
+ # @return [String]
103
+ def to_json(*_args)
104
+ @_field_set&.to_json
105
+ end
106
+
107
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
108
+ # hash and check each fields type against the current object's property
109
+ # definitions.
110
+ #
111
+ # @param obj [Object]
112
+ # @return [Void]
113
+ def self.validate_raw(obj:)
114
+ obj.npi&.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
115
+ obj.taxonomy_code&.is_a?(String) != false || raise("Passed value for field obj.taxonomy_code is not the expected type, validation failed.")
116
+ obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address)
117
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
118
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
119
+ obj.organization_name&.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,125 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/street_address_short_zip_optional"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module EncounterProviders
9
+ module V2
10
+ module Types
11
+ class SupervisingProviderUpdateWithOptionalAddress
12
+ # @return [String] A National Provider Identifier is a unique 10-digit identification
13
+ # number issued to health care providers in the United States
14
+ attr_reader :npi
15
+ # @return [String]
16
+ attr_reader :taxonomy_code
17
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
18
+ attr_reader :address
19
+ # @return [String] If the provider is an individual, this should be set instead of organization
20
+ # name
21
+ attr_reader :first_name
22
+ # @return [String] If the provider is an individual, this should be set instead of organization
23
+ # name
24
+ attr_reader :last_name
25
+ # @return [String] If the provider is an organization, this should be set instead of first + last
26
+ # name
27
+ attr_reader :organization_name
28
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
29
+ attr_reader :additional_properties
30
+ # @return [Object]
31
+ attr_reader :_field_set
32
+ protected :_field_set
33
+
34
+ OMIT = Object.new
35
+
36
+ # @param npi [String] A National Provider Identifier is a unique 10-digit identification
37
+ # number issued to health care providers in the United States
38
+ # @param taxonomy_code [String]
39
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional]
40
+ # @param first_name [String] If the provider is an individual, this should be set instead of organization
41
+ # name
42
+ # @param last_name [String] If the provider is an individual, this should be set instead of organization
43
+ # name
44
+ # @param organization_name [String] If the provider is an organization, this should be set instead of first + last
45
+ # name
46
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
47
+ # @return [CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdateWithOptionalAddress]
48
+ def initialize(npi: OMIT, taxonomy_code: OMIT, address: OMIT, first_name: OMIT, last_name: OMIT,
49
+ organization_name: OMIT, additional_properties: nil)
50
+ @npi = npi if npi != OMIT
51
+ @taxonomy_code = taxonomy_code if taxonomy_code != OMIT
52
+ @address = address if address != OMIT
53
+ @first_name = first_name if first_name != OMIT
54
+ @last_name = last_name if last_name != OMIT
55
+ @organization_name = organization_name if organization_name != OMIT
56
+ @additional_properties = additional_properties
57
+ @_field_set = {
58
+ "npi": npi,
59
+ "taxonomy_code": taxonomy_code,
60
+ "address": address,
61
+ "first_name": first_name,
62
+ "last_name": last_name,
63
+ "organization_name": organization_name
64
+ }.reject do |_k, v|
65
+ v == OMIT
66
+ end
67
+ end
68
+
69
+ # Deserialize a JSON object to an instance of
70
+ # SupervisingProviderUpdateWithOptionalAddress
71
+ #
72
+ # @param json_object [String]
73
+ # @return [CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdateWithOptionalAddress]
74
+ def self.from_json(json_object:)
75
+ struct = JSON.parse(json_object, object_class: OpenStruct)
76
+ parsed_json = JSON.parse(json_object)
77
+ npi = struct["npi"]
78
+ taxonomy_code = struct["taxonomy_code"]
79
+ if parsed_json["address"].nil?
80
+ address = nil
81
+ else
82
+ address = parsed_json["address"].to_json
83
+ address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address)
84
+ end
85
+ first_name = struct["first_name"]
86
+ last_name = struct["last_name"]
87
+ organization_name = struct["organization_name"]
88
+ new(
89
+ npi: npi,
90
+ taxonomy_code: taxonomy_code,
91
+ address: address,
92
+ first_name: first_name,
93
+ last_name: last_name,
94
+ organization_name: organization_name,
95
+ additional_properties: struct
96
+ )
97
+ end
98
+
99
+ # Serialize an instance of SupervisingProviderUpdateWithOptionalAddress to a JSON
100
+ # object
101
+ #
102
+ # @return [String]
103
+ def to_json(*_args)
104
+ @_field_set&.to_json
105
+ end
106
+
107
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
108
+ # hash and check each fields type against the current object's property
109
+ # definitions.
110
+ #
111
+ # @param obj [Object]
112
+ # @return [Void]
113
+ def self.validate_raw(obj:)
114
+ obj.npi&.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
115
+ obj.taxonomy_code&.is_a?(String) != false || raise("Passed value for field obj.taxonomy_code is not the expected type, validation failed.")
116
+ obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address)
117
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
118
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
119
+ obj.organization_name&.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end