rcs 1.0.14 → 1.0.15
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.
- checksums.yaml +4 -4
- data/lib/rcs/company/client.rb +61 -6
- data/lib/rcs/types/company.rb +53 -2
- data/lib/rcs/types/company_category.rb +20 -0
- data/lib/rcs/types/company_details.rb +11 -1
- data/lib/rcs/types/inbound_action_message.rb +117 -0
- data/lib/rcs/types/inbound_location_message.rb +106 -0
- data/lib/rcs/types/inbound_location_message_coordinates.rb +65 -0
- data/lib/rcs/types/inbound_media_message.rb +112 -0
- data/lib/rcs/types/inbound_message.rb +88 -0
- data/lib/rcs/types/inbound_message_message_type.rb +10 -0
- data/lib/rcs/types/inbound_message_metadata.rb +79 -0
- data/lib/rcs/types/inbound_text_message.rb +100 -0
- data/lib/rcs/types/media_payload.rb +65 -0
- data/lib/rcs/types/message_metadata.rb +56 -0
- data/lib/rcs/types/messaging.rb +95 -0
- data/lib/rcs/types/sender_metadata.rb +74 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +13 -0
- metadata +15 -2
@@ -0,0 +1,95 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
class Messaging
|
8
|
+
# @return [String] Explain how users will opt in to receive messages.
|
9
|
+
attr_reader :opt_in
|
10
|
+
# @return [String] Explain how users will opt out of receiving messages.
|
11
|
+
attr_reader :opt_out
|
12
|
+
# @return [Array<String>] Please provide the unique keywords to opt out. Each keyword should not contain
|
13
|
+
# spaces.
|
14
|
+
attr_reader :opt_out_keywords
|
15
|
+
# @return [String] Please define what your agent will do.
|
16
|
+
attr_reader :agent_use_case
|
17
|
+
# @return [String] Please provide some example messages that your agent will send.
|
18
|
+
attr_reader :expected_agent_responses
|
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 opt_in [String] Explain how users will opt in to receive messages.
|
28
|
+
# @param opt_out [String] Explain how users will opt out of receiving messages.
|
29
|
+
# @param opt_out_keywords [Array<String>] Please provide the unique keywords to opt out. Each keyword should not contain
|
30
|
+
# spaces.
|
31
|
+
# @param agent_use_case [String] Please define what your agent will do.
|
32
|
+
# @param expected_agent_responses [String] Please provide some example messages that your agent will send.
|
33
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
34
|
+
# @return [Pinnacle::Messaging]
|
35
|
+
def initialize(opt_in:, opt_out:, opt_out_keywords:, agent_use_case:, expected_agent_responses:,
|
36
|
+
additional_properties: nil)
|
37
|
+
@opt_in = opt_in
|
38
|
+
@opt_out = opt_out
|
39
|
+
@opt_out_keywords = opt_out_keywords
|
40
|
+
@agent_use_case = agent_use_case
|
41
|
+
@expected_agent_responses = expected_agent_responses
|
42
|
+
@additional_properties = additional_properties
|
43
|
+
@_field_set = {
|
44
|
+
"optIn": opt_in,
|
45
|
+
"optOut": opt_out,
|
46
|
+
"optOutKeywords": opt_out_keywords,
|
47
|
+
"agentUseCase": agent_use_case,
|
48
|
+
"expectedAgentResponses": expected_agent_responses
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Deserialize a JSON object to an instance of Messaging
|
53
|
+
#
|
54
|
+
# @param json_object [String]
|
55
|
+
# @return [Pinnacle::Messaging]
|
56
|
+
def self.from_json(json_object:)
|
57
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
58
|
+
parsed_json = JSON.parse(json_object)
|
59
|
+
opt_in = parsed_json["optIn"]
|
60
|
+
opt_out = parsed_json["optOut"]
|
61
|
+
opt_out_keywords = parsed_json["optOutKeywords"]
|
62
|
+
agent_use_case = parsed_json["agentUseCase"]
|
63
|
+
expected_agent_responses = parsed_json["expectedAgentResponses"]
|
64
|
+
new(
|
65
|
+
opt_in: opt_in,
|
66
|
+
opt_out: opt_out,
|
67
|
+
opt_out_keywords: opt_out_keywords,
|
68
|
+
agent_use_case: agent_use_case,
|
69
|
+
expected_agent_responses: expected_agent_responses,
|
70
|
+
additional_properties: struct
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Serialize an instance of Messaging to a JSON object
|
75
|
+
#
|
76
|
+
# @return [String]
|
77
|
+
def to_json(*_args)
|
78
|
+
@_field_set&.to_json
|
79
|
+
end
|
80
|
+
|
81
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
82
|
+
# hash and check each fields type against the current object's property
|
83
|
+
# definitions.
|
84
|
+
#
|
85
|
+
# @param obj [Object]
|
86
|
+
# @return [Void]
|
87
|
+
def self.validate_raw(obj:)
|
88
|
+
obj.opt_in.is_a?(String) != false || raise("Passed value for field obj.opt_in is not the expected type, validation failed.")
|
89
|
+
obj.opt_out.is_a?(String) != false || raise("Passed value for field obj.opt_out is not the expected type, validation failed.")
|
90
|
+
obj.opt_out_keywords.is_a?(Array) != false || raise("Passed value for field obj.opt_out_keywords is not the expected type, validation failed.")
|
91
|
+
obj.agent_use_case.is_a?(String) != false || raise("Passed value for field obj.agent_use_case is not the expected type, validation failed.")
|
92
|
+
obj.expected_agent_responses.is_a?(String) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
class SenderMetadata
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :city
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :state
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :country
|
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 city [String]
|
23
|
+
# @param state [String]
|
24
|
+
# @param country [String]
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [Pinnacle::SenderMetadata]
|
27
|
+
def initialize(city: OMIT, state: OMIT, country: OMIT, additional_properties: nil)
|
28
|
+
@city = city if city != OMIT
|
29
|
+
@state = state if state != OMIT
|
30
|
+
@country = country if country != OMIT
|
31
|
+
@additional_properties = additional_properties
|
32
|
+
@_field_set = { "city": city, "state": state, "country": country }.reject do |_k, v|
|
33
|
+
v == OMIT
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# Deserialize a JSON object to an instance of SenderMetadata
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [Pinnacle::SenderMetadata]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
parsed_json = JSON.parse(json_object)
|
44
|
+
city = parsed_json["city"]
|
45
|
+
state = parsed_json["state"]
|
46
|
+
country = parsed_json["country"]
|
47
|
+
new(
|
48
|
+
city: city,
|
49
|
+
state: state,
|
50
|
+
country: country,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of SenderMetadata to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.")
|
70
|
+
obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
|
71
|
+
obj.country&.is_a?(String) != false || raise("Passed value for field obj.country is not the expected type, validation failed.")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
data/lib/requests.rb
CHANGED
@@ -43,7 +43,7 @@ module Pinnacle
|
|
43
43
|
|
44
44
|
# @return [Hash{String => String}]
|
45
45
|
def get_headers
|
46
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.
|
46
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.15" }
|
47
47
|
headers["PINNACLE-API-Key"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
48
48
|
headers
|
49
49
|
end
|
@@ -87,7 +87,7 @@ module Pinnacle
|
|
87
87
|
|
88
88
|
# @return [Hash{String => String}]
|
89
89
|
def get_headers
|
90
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.
|
90
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.15" }
|
91
91
|
headers["PINNACLE-API-Key"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
92
92
|
headers
|
93
93
|
end
|
data/lib/types_export.rb
CHANGED
@@ -18,9 +18,11 @@ require_relative "rcs/types/company_additional_websites_item"
|
|
18
18
|
require_relative "rcs/types/company_additional_emails_item"
|
19
19
|
require_relative "rcs/types/company_additional_phone_numbers_item"
|
20
20
|
require_relative "rcs/types/company"
|
21
|
+
require_relative "rcs/types/company_category"
|
21
22
|
require_relative "rcs/types/company_details"
|
22
23
|
require_relative "rcs/types/company_contact"
|
23
24
|
require_relative "rcs/types/point_of_contact"
|
25
|
+
require_relative "rcs/types/messaging"
|
24
26
|
require_relative "rcs/types/additional_website"
|
25
27
|
require_relative "rcs/types/additional_phone_number"
|
26
28
|
require_relative "rcs/types/additional_email"
|
@@ -29,3 +31,14 @@ require_relative "rcs/types/card"
|
|
29
31
|
require_relative "rcs/types/action_type"
|
30
32
|
require_relative "rcs/types/action_lat_long"
|
31
33
|
require_relative "rcs/types/action"
|
34
|
+
require_relative "rcs/types/inbound_message_message_type"
|
35
|
+
require_relative "rcs/types/inbound_message_metadata"
|
36
|
+
require_relative "rcs/types/inbound_message"
|
37
|
+
require_relative "rcs/types/sender_metadata"
|
38
|
+
require_relative "rcs/types/message_metadata"
|
39
|
+
require_relative "rcs/types/inbound_text_message"
|
40
|
+
require_relative "rcs/types/media_payload"
|
41
|
+
require_relative "rcs/types/inbound_media_message"
|
42
|
+
require_relative "rcs/types/inbound_action_message"
|
43
|
+
require_relative "rcs/types/inbound_location_message_coordinates"
|
44
|
+
require_relative "rcs/types/inbound_location_message"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -121,14 +121,27 @@ files:
|
|
121
121
|
- lib/rcs/types/company_additional_emails_item.rb
|
122
122
|
- lib/rcs/types/company_additional_phone_numbers_item.rb
|
123
123
|
- lib/rcs/types/company_additional_websites_item.rb
|
124
|
+
- lib/rcs/types/company_category.rb
|
124
125
|
- lib/rcs/types/company_contact.rb
|
125
126
|
- lib/rcs/types/company_details.rb
|
126
127
|
- lib/rcs/types/forbidden_error_body.rb
|
128
|
+
- lib/rcs/types/inbound_action_message.rb
|
129
|
+
- lib/rcs/types/inbound_location_message.rb
|
130
|
+
- lib/rcs/types/inbound_location_message_coordinates.rb
|
131
|
+
- lib/rcs/types/inbound_media_message.rb
|
132
|
+
- lib/rcs/types/inbound_message.rb
|
133
|
+
- lib/rcs/types/inbound_message_message_type.rb
|
134
|
+
- lib/rcs/types/inbound_message_metadata.rb
|
135
|
+
- lib/rcs/types/inbound_text_message.rb
|
127
136
|
- lib/rcs/types/internal_server_error_body.rb
|
137
|
+
- lib/rcs/types/media_payload.rb
|
138
|
+
- lib/rcs/types/message_metadata.rb
|
139
|
+
- lib/rcs/types/messaging.rb
|
128
140
|
- lib/rcs/types/optionals.rb
|
129
141
|
- lib/rcs/types/payment_required_error_body.rb
|
130
142
|
- lib/rcs/types/point_of_contact.rb
|
131
143
|
- lib/rcs/types/rcs_functionalities.rb
|
144
|
+
- lib/rcs/types/sender_metadata.rb
|
132
145
|
- lib/rcs/types/unauthorized_error_body.rb
|
133
146
|
- lib/requests.rb
|
134
147
|
- lib/types_export.rb
|