rcs 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/lib/environment.rb +7 -0
  3. data/lib/gemconfig.rb +14 -0
  4. data/lib/rcs/company/client.rb +416 -0
  5. data/lib/rcs/company/types/company_register_response.rb +63 -0
  6. data/lib/rcs/company/types/company_register_response_brand.rb +67 -0
  7. data/lib/rcs/company/types/company_update_response.rb +63 -0
  8. data/lib/rcs/company/types/company_update_response_brand.rb +67 -0
  9. data/lib/rcs/send/client.rb +343 -0
  10. data/lib/rcs/send/types/send_mms_response.rb +67 -0
  11. data/lib/rcs/send/types/send_rcs_response.rb +67 -0
  12. data/lib/rcs/send/types/send_sms_response.rb +67 -0
  13. data/lib/rcs/types/action.rb +146 -0
  14. data/lib/rcs/types/action_lat_long.rb +68 -0
  15. data/lib/rcs/types/action_type.rb +16 -0
  16. data/lib/rcs/types/additional_email.rb +65 -0
  17. data/lib/rcs/types/additional_phone_number.rb +65 -0
  18. data/lib/rcs/types/additional_website.rb +65 -0
  19. data/lib/rcs/types/bad_request_error_body.rb +57 -0
  20. data/lib/rcs/types/card.rb +90 -0
  21. data/lib/rcs/types/company.rb +268 -0
  22. data/lib/rcs/types/company_additional_emails_item.rb +67 -0
  23. data/lib/rcs/types/company_additional_phone_numbers_item.rb +67 -0
  24. data/lib/rcs/types/company_additional_websites_item.rb +67 -0
  25. data/lib/rcs/types/company_contact.rb +117 -0
  26. data/lib/rcs/types/company_details.rb +110 -0
  27. data/lib/rcs/types/forbidden_error_body.rb +57 -0
  28. data/lib/rcs/types/internal_server_error_body.rb +57 -0
  29. data/lib/rcs/types/optionals.rb +99 -0
  30. data/lib/rcs/types/point_of_contact.rb +72 -0
  31. data/lib/rcs/types/rcs_functionalities.rb +117 -0
  32. data/lib/rcs/types/unauthorized_error_body.rb +57 -0
  33. data/lib/rcs.rb +126 -0
  34. data/lib/requests.rb +163 -0
  35. data/lib/types_export.rb +29 -0
  36. metadata +158 -0
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class CompanyDetails
8
+ # @return [String] The name of the company.
9
+ attr_reader :name
10
+ # @return [String] The address of the company.
11
+ attr_reader :address
12
+ # @return [String] The EIN (Employer Identification Number) of the company.
13
+ attr_reader :ein
14
+ # @return [String] A description of the company.
15
+ attr_reader :description
16
+ # @return [String] The brand color in hex format, must pass a contrast ratio of at least 4.5:1 with
17
+ # white.
18
+ attr_reader :brand_color
19
+ # @return [String] URL of the company logo.
20
+ attr_reader :logo_url
21
+ # @return [String] URL of the company's hero image.
22
+ attr_reader :hero_url
23
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
24
+ attr_reader :additional_properties
25
+ # @return [Object]
26
+ attr_reader :_field_set
27
+ protected :_field_set
28
+
29
+ OMIT = Object.new
30
+
31
+ # @param name [String] The name of the company.
32
+ # @param address [String] The address of the company.
33
+ # @param ein [String] The EIN (Employer Identification Number) of the company.
34
+ # @param description [String] A description of the company.
35
+ # @param brand_color [String] The brand color in hex format, must pass a contrast ratio of at least 4.5:1 with
36
+ # white.
37
+ # @param logo_url [String] URL of the company logo.
38
+ # @param hero_url [String] URL of the company's hero image.
39
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
40
+ # @return [Pinnacle::CompanyDetails]
41
+ def initialize(name:, address:, ein:, description:, brand_color:, logo_url:, hero_url:, additional_properties: nil)
42
+ @name = name
43
+ @address = address
44
+ @ein = ein
45
+ @description = description
46
+ @brand_color = brand_color
47
+ @logo_url = logo_url
48
+ @hero_url = hero_url
49
+ @additional_properties = additional_properties
50
+ @_field_set = {
51
+ "name": name,
52
+ "address": address,
53
+ "ein": ein,
54
+ "description": description,
55
+ "brandColor": brand_color,
56
+ "logoUrl": logo_url,
57
+ "heroUrl": hero_url
58
+ }
59
+ end
60
+
61
+ # Deserialize a JSON object to an instance of CompanyDetails
62
+ #
63
+ # @param json_object [String]
64
+ # @return [Pinnacle::CompanyDetails]
65
+ def self.from_json(json_object:)
66
+ struct = JSON.parse(json_object, object_class: OpenStruct)
67
+ parsed_json = JSON.parse(json_object)
68
+ name = parsed_json["name"]
69
+ address = parsed_json["address"]
70
+ ein = parsed_json["ein"]
71
+ description = parsed_json["description"]
72
+ brand_color = parsed_json["brandColor"]
73
+ logo_url = parsed_json["logoUrl"]
74
+ hero_url = parsed_json["heroUrl"]
75
+ new(
76
+ name: name,
77
+ address: address,
78
+ ein: ein,
79
+ description: description,
80
+ brand_color: brand_color,
81
+ logo_url: logo_url,
82
+ hero_url: hero_url,
83
+ additional_properties: struct
84
+ )
85
+ end
86
+
87
+ # Serialize an instance of CompanyDetails to a JSON object
88
+ #
89
+ # @return [String]
90
+ def to_json(*_args)
91
+ @_field_set&.to_json
92
+ end
93
+
94
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
95
+ # hash and check each fields type against the current object's property
96
+ # definitions.
97
+ #
98
+ # @param obj [Object]
99
+ # @return [Void]
100
+ def self.validate_raw(obj:)
101
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
102
+ obj.address.is_a?(String) != false || raise("Passed value for field obj.address is not the expected type, validation failed.")
103
+ obj.ein.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.")
104
+ obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
105
+ obj.brand_color.is_a?(String) != false || raise("Passed value for field obj.brand_color is not the expected type, validation failed.")
106
+ obj.logo_url.is_a?(String) != false || raise("Passed value for field obj.logo_url is not the expected type, validation failed.")
107
+ obj.hero_url.is_a?(String) != false || raise("Passed value for field obj.hero_url is not the expected type, validation failed.")
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class ForbiddenErrorBody
8
+ # @return [Array<String>]
9
+ attr_reader :errors
10
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
11
+ attr_reader :additional_properties
12
+ # @return [Object]
13
+ attr_reader :_field_set
14
+ protected :_field_set
15
+
16
+ OMIT = Object.new
17
+
18
+ # @param errors [Array<String>]
19
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
20
+ # @return [Pinnacle::ForbiddenErrorBody]
21
+ def initialize(errors: OMIT, additional_properties: nil)
22
+ @errors = errors if errors != OMIT
23
+ @additional_properties = additional_properties
24
+ @_field_set = { "errors": errors }.reject do |_k, v|
25
+ v == OMIT
26
+ end
27
+ end
28
+
29
+ # Deserialize a JSON object to an instance of ForbiddenErrorBody
30
+ #
31
+ # @param json_object [String]
32
+ # @return [Pinnacle::ForbiddenErrorBody]
33
+ def self.from_json(json_object:)
34
+ struct = JSON.parse(json_object, object_class: OpenStruct)
35
+ parsed_json = JSON.parse(json_object)
36
+ errors = parsed_json["errors"]
37
+ new(errors: errors, additional_properties: struct)
38
+ end
39
+
40
+ # Serialize an instance of ForbiddenErrorBody to a JSON object
41
+ #
42
+ # @return [String]
43
+ def to_json(*_args)
44
+ @_field_set&.to_json
45
+ end
46
+
47
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
48
+ # hash and check each fields type against the current object's property
49
+ # definitions.
50
+ #
51
+ # @param obj [Object]
52
+ # @return [Void]
53
+ def self.validate_raw(obj:)
54
+ obj.errors&.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class InternalServerErrorBody
8
+ # @return [Array<String>]
9
+ attr_reader :errors
10
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
11
+ attr_reader :additional_properties
12
+ # @return [Object]
13
+ attr_reader :_field_set
14
+ protected :_field_set
15
+
16
+ OMIT = Object.new
17
+
18
+ # @param errors [Array<String>]
19
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
20
+ # @return [Pinnacle::InternalServerErrorBody]
21
+ def initialize(errors: OMIT, additional_properties: nil)
22
+ @errors = errors if errors != OMIT
23
+ @additional_properties = additional_properties
24
+ @_field_set = { "errors": errors }.reject do |_k, v|
25
+ v == OMIT
26
+ end
27
+ end
28
+
29
+ # Deserialize a JSON object to an instance of InternalServerErrorBody
30
+ #
31
+ # @param json_object [String]
32
+ # @return [Pinnacle::InternalServerErrorBody]
33
+ def self.from_json(json_object:)
34
+ struct = JSON.parse(json_object, object_class: OpenStruct)
35
+ parsed_json = JSON.parse(json_object)
36
+ errors = parsed_json["errors"]
37
+ new(errors: errors, additional_properties: struct)
38
+ end
39
+
40
+ # Serialize an instance of InternalServerErrorBody to a JSON object
41
+ #
42
+ # @return [String]
43
+ def to_json(*_args)
44
+ @_field_set&.to_json
45
+ end
46
+
47
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
48
+ # hash and check each fields type against the current object's property
49
+ # definitions.
50
+ #
51
+ # @param obj [Object]
52
+ # @return [Void]
53
+ def self.validate_raw(obj:)
54
+ obj.errors&.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "additional_website"
4
+ require_relative "additional_phone_number"
5
+ require_relative "additional_email"
6
+ require "ostruct"
7
+ require "json"
8
+
9
+ module Pinnacle
10
+ class Optionals
11
+ # @return [Array<Pinnacle::AdditionalWebsite>] List of additional websites, up to 2.
12
+ attr_reader :additional_websites
13
+ # @return [Array<Pinnacle::AdditionalPhoneNumber>] List of additional phone numbers, up to 2.
14
+ attr_reader :additional_phone_numbers
15
+ # @return [Array<Pinnacle::AdditionalEmail>] List of additional email addresses, up to 2.
16
+ attr_reader :additional_emails
17
+ # @return [Array<String>]
18
+ attr_reader :test_numbers
19
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
20
+ attr_reader :additional_properties
21
+ # @return [Object]
22
+ attr_reader :_field_set
23
+ protected :_field_set
24
+
25
+ OMIT = Object.new
26
+
27
+ # @param additional_websites [Array<Pinnacle::AdditionalWebsite>] List of additional websites, up to 2.
28
+ # @param additional_phone_numbers [Array<Pinnacle::AdditionalPhoneNumber>] List of additional phone numbers, up to 2.
29
+ # @param additional_emails [Array<Pinnacle::AdditionalEmail>] List of additional email addresses, up to 2.
30
+ # @param test_numbers [Array<String>]
31
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
32
+ # @return [Pinnacle::Optionals]
33
+ def initialize(additional_websites: OMIT, additional_phone_numbers: OMIT, additional_emails: OMIT,
34
+ test_numbers: OMIT, additional_properties: nil)
35
+ @additional_websites = additional_websites if additional_websites != OMIT
36
+ @additional_phone_numbers = additional_phone_numbers if additional_phone_numbers != OMIT
37
+ @additional_emails = additional_emails if additional_emails != OMIT
38
+ @test_numbers = test_numbers if test_numbers != OMIT
39
+ @additional_properties = additional_properties
40
+ @_field_set = {
41
+ "additionalWebsites": additional_websites,
42
+ "additionalPhoneNumbers": additional_phone_numbers,
43
+ "additionalEmails": additional_emails,
44
+ "testNumbers": test_numbers
45
+ }.reject do |_k, v|
46
+ v == OMIT
47
+ end
48
+ end
49
+
50
+ # Deserialize a JSON object to an instance of Optionals
51
+ #
52
+ # @param json_object [String]
53
+ # @return [Pinnacle::Optionals]
54
+ def self.from_json(json_object:)
55
+ struct = JSON.parse(json_object, object_class: OpenStruct)
56
+ parsed_json = JSON.parse(json_object)
57
+ additional_websites = parsed_json["additionalWebsites"]&.map do |item|
58
+ item = item.to_json
59
+ Pinnacle::AdditionalWebsite.from_json(json_object: item)
60
+ end
61
+ additional_phone_numbers = parsed_json["additionalPhoneNumbers"]&.map do |item|
62
+ item = item.to_json
63
+ Pinnacle::AdditionalPhoneNumber.from_json(json_object: item)
64
+ end
65
+ additional_emails = parsed_json["additionalEmails"]&.map do |item|
66
+ item = item.to_json
67
+ Pinnacle::AdditionalEmail.from_json(json_object: item)
68
+ end
69
+ test_numbers = parsed_json["testNumbers"]
70
+ new(
71
+ additional_websites: additional_websites,
72
+ additional_phone_numbers: additional_phone_numbers,
73
+ additional_emails: additional_emails,
74
+ test_numbers: test_numbers,
75
+ additional_properties: struct
76
+ )
77
+ end
78
+
79
+ # Serialize an instance of Optionals to a JSON object
80
+ #
81
+ # @return [String]
82
+ def to_json(*_args)
83
+ @_field_set&.to_json
84
+ end
85
+
86
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
87
+ # hash and check each fields type against the current object's property
88
+ # definitions.
89
+ #
90
+ # @param obj [Object]
91
+ # @return [Void]
92
+ def self.validate_raw(obj:)
93
+ obj.additional_websites&.is_a?(Array) != false || raise("Passed value for field obj.additional_websites is not the expected type, validation failed.")
94
+ obj.additional_phone_numbers&.is_a?(Array) != false || raise("Passed value for field obj.additional_phone_numbers is not the expected type, validation failed.")
95
+ obj.additional_emails&.is_a?(Array) != false || raise("Passed value for field obj.additional_emails is not the expected type, validation failed.")
96
+ obj.test_numbers&.is_a?(Array) != false || raise("Passed value for field obj.test_numbers is not the expected type, validation failed.")
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class PointOfContact
8
+ # @return [String] Point of contact's name.
9
+ attr_reader :poc_name
10
+ # @return [String] Point of contact's title.
11
+ attr_reader :poc_title
12
+ # @return [String] Point of contact's email address.
13
+ attr_reader :poc_email
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param poc_name [String] Point of contact's name.
23
+ # @param poc_title [String] Point of contact's title.
24
+ # @param poc_email [String] Point of contact's email address.
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Pinnacle::PointOfContact]
27
+ def initialize(poc_name:, poc_title:, poc_email:, additional_properties: nil)
28
+ @poc_name = poc_name
29
+ @poc_title = poc_title
30
+ @poc_email = poc_email
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "pocName": poc_name, "pocTitle": poc_title, "pocEmail": poc_email }
33
+ end
34
+
35
+ # Deserialize a JSON object to an instance of PointOfContact
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Pinnacle::PointOfContact]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ poc_name = parsed_json["pocName"]
43
+ poc_title = parsed_json["pocTitle"]
44
+ poc_email = parsed_json["pocEmail"]
45
+ new(
46
+ poc_name: poc_name,
47
+ poc_title: poc_title,
48
+ poc_email: poc_email,
49
+ additional_properties: struct
50
+ )
51
+ end
52
+
53
+ # Serialize an instance of PointOfContact to a JSON object
54
+ #
55
+ # @return [String]
56
+ def to_json(*_args)
57
+ @_field_set&.to_json
58
+ end
59
+
60
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
61
+ # hash and check each fields type against the current object's property
62
+ # definitions.
63
+ #
64
+ # @param obj [Object]
65
+ # @return [Void]
66
+ def self.validate_raw(obj:)
67
+ obj.poc_name.is_a?(String) != false || raise("Passed value for field obj.poc_name is not the expected type, validation failed.")
68
+ obj.poc_title.is_a?(String) != false || raise("Passed value for field obj.poc_title is not the expected type, validation failed.")
69
+ obj.poc_email.is_a?(String) != false || raise("Passed value for field obj.poc_email is not the expected type, validation failed.")
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,117 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class RcsFunctionalities
8
+ # @return [Boolean] Indicates if RCS is enabled.
9
+ attr_reader :is_enabled
10
+ # @return [Boolean] Indicates if standalone rich cards are supported.
11
+ attr_reader :standalone_rich_card
12
+ # @return [Boolean] Indicates if carousel rich cards are supported.
13
+ attr_reader :carousel_rich_card
14
+ # @return [Boolean] Indicates if buttons to create a calendar event are supported.
15
+ attr_reader :create_calendar_event_action
16
+ # @return [Boolean] Indicates if dial buttons are supported.
17
+ attr_reader :dial_action
18
+ # @return [Boolean] Indicates if open URL buttons are supported.
19
+ attr_reader :open_url_action
20
+ # @return [Boolean] Indicates if share location buttons are supported.
21
+ attr_reader :share_location_action
22
+ # @return [Boolean] Indicates if view location buttons are supported.
23
+ attr_reader :view_location_action
24
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
25
+ attr_reader :additional_properties
26
+ # @return [Object]
27
+ attr_reader :_field_set
28
+ protected :_field_set
29
+
30
+ OMIT = Object.new
31
+
32
+ # @param is_enabled [Boolean] Indicates if RCS is enabled.
33
+ # @param standalone_rich_card [Boolean] Indicates if standalone rich cards are supported.
34
+ # @param carousel_rich_card [Boolean] Indicates if carousel rich cards are supported.
35
+ # @param create_calendar_event_action [Boolean] Indicates if buttons to create a calendar event are supported.
36
+ # @param dial_action [Boolean] Indicates if dial buttons are supported.
37
+ # @param open_url_action [Boolean] Indicates if open URL buttons are supported.
38
+ # @param share_location_action [Boolean] Indicates if share location buttons are supported.
39
+ # @param view_location_action [Boolean] Indicates if view location buttons are supported.
40
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
41
+ # @return [Pinnacle::RcsFunctionalities]
42
+ def initialize(is_enabled:, standalone_rich_card:, carousel_rich_card:, create_calendar_event_action:,
43
+ dial_action:, open_url_action:, share_location_action:, view_location_action:, additional_properties: nil)
44
+ @is_enabled = is_enabled
45
+ @standalone_rich_card = standalone_rich_card
46
+ @carousel_rich_card = carousel_rich_card
47
+ @create_calendar_event_action = create_calendar_event_action
48
+ @dial_action = dial_action
49
+ @open_url_action = open_url_action
50
+ @share_location_action = share_location_action
51
+ @view_location_action = view_location_action
52
+ @additional_properties = additional_properties
53
+ @_field_set = {
54
+ "is_enabled": is_enabled,
55
+ "standalone_rich_card": standalone_rich_card,
56
+ "carousel_rich_card": carousel_rich_card,
57
+ "create_calendar_event_action": create_calendar_event_action,
58
+ "dial_action": dial_action,
59
+ "open_url_action": open_url_action,
60
+ "share_location_action": share_location_action,
61
+ "view_location_action": view_location_action
62
+ }
63
+ end
64
+
65
+ # Deserialize a JSON object to an instance of RcsFunctionalities
66
+ #
67
+ # @param json_object [String]
68
+ # @return [Pinnacle::RcsFunctionalities]
69
+ def self.from_json(json_object:)
70
+ struct = JSON.parse(json_object, object_class: OpenStruct)
71
+ parsed_json = JSON.parse(json_object)
72
+ is_enabled = parsed_json["is_enabled"]
73
+ standalone_rich_card = parsed_json["standalone_rich_card"]
74
+ carousel_rich_card = parsed_json["carousel_rich_card"]
75
+ create_calendar_event_action = parsed_json["create_calendar_event_action"]
76
+ dial_action = parsed_json["dial_action"]
77
+ open_url_action = parsed_json["open_url_action"]
78
+ share_location_action = parsed_json["share_location_action"]
79
+ view_location_action = parsed_json["view_location_action"]
80
+ new(
81
+ is_enabled: is_enabled,
82
+ standalone_rich_card: standalone_rich_card,
83
+ carousel_rich_card: carousel_rich_card,
84
+ create_calendar_event_action: create_calendar_event_action,
85
+ dial_action: dial_action,
86
+ open_url_action: open_url_action,
87
+ share_location_action: share_location_action,
88
+ view_location_action: view_location_action,
89
+ additional_properties: struct
90
+ )
91
+ end
92
+
93
+ # Serialize an instance of RcsFunctionalities to a JSON object
94
+ #
95
+ # @return [String]
96
+ def to_json(*_args)
97
+ @_field_set&.to_json
98
+ end
99
+
100
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
101
+ # hash and check each fields type against the current object's property
102
+ # definitions.
103
+ #
104
+ # @param obj [Object]
105
+ # @return [Void]
106
+ def self.validate_raw(obj:)
107
+ obj.is_enabled.is_a?(Boolean) != false || raise("Passed value for field obj.is_enabled is not the expected type, validation failed.")
108
+ obj.standalone_rich_card.is_a?(Boolean) != false || raise("Passed value for field obj.standalone_rich_card is not the expected type, validation failed.")
109
+ obj.carousel_rich_card.is_a?(Boolean) != false || raise("Passed value for field obj.carousel_rich_card is not the expected type, validation failed.")
110
+ obj.create_calendar_event_action.is_a?(Boolean) != false || raise("Passed value for field obj.create_calendar_event_action is not the expected type, validation failed.")
111
+ obj.dial_action.is_a?(Boolean) != false || raise("Passed value for field obj.dial_action is not the expected type, validation failed.")
112
+ obj.open_url_action.is_a?(Boolean) != false || raise("Passed value for field obj.open_url_action is not the expected type, validation failed.")
113
+ obj.share_location_action.is_a?(Boolean) != false || raise("Passed value for field obj.share_location_action is not the expected type, validation failed.")
114
+ obj.view_location_action.is_a?(Boolean) != false || raise("Passed value for field obj.view_location_action is not the expected type, validation failed.")
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class UnauthorizedErrorBody
8
+ # @return [Array<String>]
9
+ attr_reader :errors
10
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
11
+ attr_reader :additional_properties
12
+ # @return [Object]
13
+ attr_reader :_field_set
14
+ protected :_field_set
15
+
16
+ OMIT = Object.new
17
+
18
+ # @param errors [Array<String>]
19
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
20
+ # @return [Pinnacle::UnauthorizedErrorBody]
21
+ def initialize(errors: OMIT, additional_properties: nil)
22
+ @errors = errors if errors != OMIT
23
+ @additional_properties = additional_properties
24
+ @_field_set = { "errors": errors }.reject do |_k, v|
25
+ v == OMIT
26
+ end
27
+ end
28
+
29
+ # Deserialize a JSON object to an instance of UnauthorizedErrorBody
30
+ #
31
+ # @param json_object [String]
32
+ # @return [Pinnacle::UnauthorizedErrorBody]
33
+ def self.from_json(json_object:)
34
+ struct = JSON.parse(json_object, object_class: OpenStruct)
35
+ parsed_json = JSON.parse(json_object)
36
+ errors = parsed_json["errors"]
37
+ new(errors: errors, additional_properties: struct)
38
+ end
39
+
40
+ # Serialize an instance of UnauthorizedErrorBody to a JSON object
41
+ #
42
+ # @return [String]
43
+ def to_json(*_args)
44
+ @_field_set&.to_json
45
+ end
46
+
47
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
48
+ # hash and check each fields type against the current object's property
49
+ # definitions.
50
+ #
51
+ # @param obj [Object]
52
+ # @return [Void]
53
+ def self.validate_raw(obj:)
54
+ obj.errors&.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
55
+ end
56
+ end
57
+ end