fastcomments 1.2.0 → 1.2.1
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/client/README.md +27 -0
- data/client/docs/APIComment.md +1 -1
- data/client/docs/APICommentBase.md +1 -1
- data/client/docs/APICommentBaseMeta.md +20 -0
- data/client/docs/APITicket.md +34 -0
- data/client/docs/APITicketDetail.md +42 -0
- data/client/docs/APITicketFile.md +36 -0
- data/client/docs/APIUserSubscription.md +2 -0
- data/client/docs/ChangeTicketState200Response.md +34 -0
- data/client/docs/ChangeTicketStateBody.md +18 -0
- data/client/docs/ChangeTicketStateResponse.md +20 -0
- data/client/docs/CommentData.md +3 -1
- data/client/docs/CreateAPIUserSubscriptionData.md +2 -0
- data/client/docs/CreateCommentParams.md +2 -0
- data/client/docs/CreateTenantPackageBody.md +2 -0
- data/client/docs/CreateTicket200Response.md +34 -0
- data/client/docs/CreateTicketBody.md +18 -0
- data/client/docs/CreateTicketResponse.md +20 -0
- data/client/docs/CustomConfigParameters.md +21 -1
- data/client/docs/DefaultApi.md +384 -0
- data/client/docs/FComment.md +3 -1
- data/client/docs/FCommentMeta.md +2 -0
- data/client/docs/GetTicket200Response.md +36 -0
- data/client/docs/GetTicketResponse.md +22 -0
- data/client/docs/GetTickets200Response.md +34 -0
- data/client/docs/GetTicketsResponse.md +20 -0
- data/client/docs/HeaderAccountNotification.md +34 -0
- data/client/docs/HeaderState.md +3 -1
- data/client/docs/MentionAutoCompleteMode.md +15 -0
- data/client/docs/Moderator.md +3 -1
- data/client/docs/PublicApi.md +3 -1
- data/client/docs/ReplaceTenantPackageBody.md +2 -0
- data/client/docs/SearchUsers200Response.md +2 -0
- data/client/docs/SearchUsersSectionedResponse.md +20 -0
- data/client/docs/TOSConfig.md +22 -0
- data/client/docs/TenantPackage.md +4 -0
- data/client/docs/UpdatableCommentParams.md +1 -1
- data/client/docs/UpdateAPIUserSubscriptionData.md +18 -0
- data/client/docs/UpdateSubscriptionAPIResponse.md +24 -0
- data/client/docs/UpdateTenantPackageBody.md +2 -0
- data/client/docs/User.md +17 -1
- data/client/docs/UserBadge.md +3 -1
- data/client/docs/UserBadgeProgress.md +3 -1
- data/client/docs/UserSearchSection.md +15 -0
- data/client/docs/UserSearchSectionResult.md +20 -0
- data/client/docs/UserSessionInfo.md +2 -0
- data/client/lib/fastcomments-client/api/default_api.rb +383 -0
- data/client/lib/fastcomments-client/api/public_api.rb +7 -0
- data/client/lib/fastcomments-client/models/api_comment.rb +1 -1
- data/client/lib/fastcomments-client/models/api_comment_base.rb +1 -1
- data/client/lib/fastcomments-client/models/api_comment_base_meta.rb +156 -0
- data/client/lib/fastcomments-client/models/api_ticket.rb +374 -0
- data/client/lib/fastcomments-client/models/api_ticket_detail.rb +432 -0
- data/client/lib/fastcomments-client/models/api_ticket_file.rb +381 -0
- data/client/lib/fastcomments-client/models/api_user_subscription.rb +10 -1
- data/client/lib/fastcomments-client/models/change_ticket_state200_response.rb +103 -0
- data/client/lib/fastcomments-client/models/change_ticket_state_body.rb +164 -0
- data/client/lib/fastcomments-client/models/change_ticket_state_response.rb +212 -0
- data/client/lib/fastcomments-client/models/comment_data.rb +13 -4
- data/client/lib/fastcomments-client/models/create_api_user_subscription_data.rb +10 -1
- data/client/lib/fastcomments-client/models/create_comment_params.rb +10 -1
- data/client/lib/fastcomments-client/models/create_tenant_package_body.rb +10 -1
- data/client/lib/fastcomments-client/models/create_ticket200_response.rb +103 -0
- data/client/lib/fastcomments-client/models/create_ticket_body.rb +164 -0
- data/client/lib/fastcomments-client/models/create_ticket_response.rb +212 -0
- data/client/lib/fastcomments-client/models/custom_config_parameters.rb +97 -4
- data/client/lib/fastcomments-client/models/f_comment.rb +13 -4
- data/client/lib/fastcomments-client/models/f_comment_meta.rb +10 -1
- data/client/lib/fastcomments-client/models/get_ticket200_response.rb +103 -0
- data/client/lib/fastcomments-client/models/get_ticket_response.rb +240 -0
- data/client/lib/fastcomments-client/models/get_tickets200_response.rb +103 -0
- data/client/lib/fastcomments-client/models/get_tickets_response.rb +214 -0
- data/client/lib/fastcomments-client/models/header_account_notification.rb +322 -0
- data/client/lib/fastcomments-client/models/header_state.rb +32 -4
- data/client/lib/fastcomments-client/models/mention_auto_complete_mode.rb +41 -0
- data/client/lib/fastcomments-client/models/moderator.rb +14 -5
- data/client/lib/fastcomments-client/models/replace_tenant_package_body.rb +10 -1
- data/client/lib/fastcomments-client/models/search_users200_response.rb +2 -1
- data/client/lib/fastcomments-client/models/search_users_sectioned_response.rb +214 -0
- data/client/lib/fastcomments-client/models/tenant_package.rb +36 -1
- data/client/lib/fastcomments-client/models/tos_config.rb +168 -0
- data/client/lib/fastcomments-client/models/updatable_comment_params.rb +1 -1
- data/client/lib/fastcomments-client/models/update_api_user_subscription_data.rb +147 -0
- data/client/lib/fastcomments-client/models/update_subscription_api_response.rb +191 -0
- data/client/lib/fastcomments-client/models/update_tenant_package_body.rb +10 -1
- data/client/lib/fastcomments-client/models/user.rb +76 -4
- data/client/lib/fastcomments-client/models/user_badge.rb +14 -4
- data/client/lib/fastcomments-client/models/user_badge_progress.rb +13 -4
- data/client/lib/fastcomments-client/models/user_search_section.rb +41 -0
- data/client/lib/fastcomments-client/models/user_search_section_result.rb +214 -0
- data/client/lib/fastcomments-client/models/user_session_info.rb +10 -1
- data/client/lib/fastcomments-client.rb +22 -0
- data/client/spec/api/default_api_spec.rb +64 -0
- data/client/spec/api/public_api_spec.rb +1 -0
- data/client/spec/models/api_comment_base_meta_spec.rb +42 -0
- data/client/spec/models/api_ticket_detail_spec.rb +108 -0
- data/client/spec/models/api_ticket_file_spec.rb +90 -0
- data/client/spec/models/api_ticket_spec.rb +84 -0
- data/client/spec/models/api_user_subscription_spec.rb +6 -0
- data/client/spec/models/change_ticket_state200_response_spec.rb +21 -0
- data/client/spec/models/change_ticket_state_body_spec.rb +36 -0
- data/client/spec/models/change_ticket_state_response_spec.rb +42 -0
- data/client/spec/models/comment_data_spec.rb +6 -0
- data/client/spec/models/create_api_user_subscription_data_spec.rb +6 -0
- data/client/spec/models/create_comment_params_spec.rb +6 -0
- data/client/spec/models/create_tenant_package_body_spec.rb +6 -0
- data/client/spec/models/create_ticket200_response_spec.rb +21 -0
- data/client/spec/models/create_ticket_body_spec.rb +36 -0
- data/client/spec/models/create_ticket_response_spec.rb +42 -0
- data/client/spec/models/custom_config_parameters_spec.rb +60 -0
- data/client/spec/models/f_comment_meta_spec.rb +6 -0
- data/client/spec/models/f_comment_spec.rb +6 -0
- data/client/spec/models/get_ticket200_response_spec.rb +21 -0
- data/client/spec/models/get_ticket_response_spec.rb +48 -0
- data/client/spec/models/get_tickets200_response_spec.rb +21 -0
- data/client/spec/models/get_tickets_response_spec.rb +42 -0
- data/client/spec/models/header_account_notification_spec.rb +84 -0
- data/client/spec/models/header_state_spec.rb +6 -0
- data/client/spec/models/mention_auto_complete_mode_spec.rb +30 -0
- data/client/spec/models/moderator_spec.rb +6 -0
- data/client/spec/models/replace_tenant_package_body_spec.rb +6 -0
- data/client/spec/models/search_users_sectioned_response_spec.rb +42 -0
- data/client/spec/models/tenant_package_spec.rb +12 -0
- data/client/spec/models/tos_config_spec.rb +48 -0
- data/client/spec/models/update_api_user_subscription_data_spec.rb +36 -0
- data/client/spec/models/update_subscription_api_response_spec.rb +54 -0
- data/client/spec/models/update_tenant_package_body_spec.rb +6 -0
- data/client/spec/models/user_badge_progress_spec.rb +6 -0
- data/client/spec/models/user_badge_spec.rb +6 -0
- data/client/spec/models/user_search_section_result_spec.rb +42 -0
- data/client/spec/models/user_search_section_spec.rb +30 -0
- data/client/spec/models/user_session_info_spec.rb +6 -0
- data/client/spec/models/user_spec.rb +48 -0
- data/lib/fastcomments.rb +1 -1
- metadata +68 -2
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#fastcomments
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FastCommentsClient
|
|
17
|
+
class CreateTicketResponse < ApiModelBase
|
|
18
|
+
attr_accessor :status
|
|
19
|
+
|
|
20
|
+
attr_accessor :ticket
|
|
21
|
+
|
|
22
|
+
class EnumAttributeValidator
|
|
23
|
+
attr_reader :datatype
|
|
24
|
+
attr_reader :allowable_values
|
|
25
|
+
|
|
26
|
+
def initialize(datatype, allowable_values)
|
|
27
|
+
@allowable_values = allowable_values.map do |value|
|
|
28
|
+
case datatype.to_s
|
|
29
|
+
when /Integer/i
|
|
30
|
+
value.to_i
|
|
31
|
+
when /Float/i
|
|
32
|
+
value.to_f
|
|
33
|
+
else
|
|
34
|
+
value
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def valid?(value)
|
|
40
|
+
!value || allowable_values.include?(value)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
45
|
+
def self.attribute_map
|
|
46
|
+
{
|
|
47
|
+
:'status' => :'status',
|
|
48
|
+
:'ticket' => :'ticket'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'status' => :'APIStatus',
|
|
66
|
+
:'ticket' => :'APITicket'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FastCommentsClient::CreateTicketResponse` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FastCommentsClient::CreateTicketResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'status')
|
|
93
|
+
self.status = attributes[:'status']
|
|
94
|
+
else
|
|
95
|
+
self.status = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'ticket')
|
|
99
|
+
self.ticket = attributes[:'ticket']
|
|
100
|
+
else
|
|
101
|
+
self.ticket = nil
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
106
|
+
# @return Array for valid properties with the reasons
|
|
107
|
+
def list_invalid_properties
|
|
108
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
109
|
+
invalid_properties = Array.new
|
|
110
|
+
if @status.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @ticket.nil?
|
|
115
|
+
invalid_properties.push('invalid value for "ticket", ticket cannot be nil.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
invalid_properties
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Check to see if the all the properties in the model are valid
|
|
122
|
+
# @return true if the model is valid
|
|
123
|
+
def valid?
|
|
124
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
125
|
+
return false if @status.nil?
|
|
126
|
+
return false if @ticket.nil?
|
|
127
|
+
true
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Custom attribute writer method with validation
|
|
131
|
+
# @param [Object] status Value to be assigned
|
|
132
|
+
def status=(status)
|
|
133
|
+
if status.nil?
|
|
134
|
+
fail ArgumentError, 'status cannot be nil'
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
@status = status
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Custom attribute writer method with validation
|
|
141
|
+
# @param [Object] ticket Value to be assigned
|
|
142
|
+
def ticket=(ticket)
|
|
143
|
+
if ticket.nil?
|
|
144
|
+
fail ArgumentError, 'ticket cannot be nil'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
@ticket = ticket
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Checks equality by comparing each attribute.
|
|
151
|
+
# @param [Object] Object to be compared
|
|
152
|
+
def ==(o)
|
|
153
|
+
return true if self.equal?(o)
|
|
154
|
+
self.class == o.class &&
|
|
155
|
+
status == o.status &&
|
|
156
|
+
ticket == o.ticket
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# @see the `==` method
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def eql?(o)
|
|
162
|
+
self == o
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Calculates hash code according to all attributes.
|
|
166
|
+
# @return [Integer] Hash code
|
|
167
|
+
def hash
|
|
168
|
+
[status, ticket].hash
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Builds the object from hash
|
|
172
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
173
|
+
# @return [Object] Returns the model itself
|
|
174
|
+
def self.build_from_hash(attributes)
|
|
175
|
+
return nil unless attributes.is_a?(Hash)
|
|
176
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
177
|
+
transformed_hash = {}
|
|
178
|
+
openapi_types.each_pair do |key, type|
|
|
179
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
180
|
+
transformed_hash["#{key}"] = nil
|
|
181
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
182
|
+
# check to ensure the input is an array given that the attribute
|
|
183
|
+
# is documented as an array but the input is not
|
|
184
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
185
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
186
|
+
end
|
|
187
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
188
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
new(transformed_hash)
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Returns the object in the form of hash
|
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
|
196
|
+
def to_hash
|
|
197
|
+
hash = {}
|
|
198
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
199
|
+
value = self.send(attr)
|
|
200
|
+
if value.nil?
|
|
201
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
202
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
hash[param] = _to_hash(value)
|
|
206
|
+
end
|
|
207
|
+
hash
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
end
|
|
@@ -63,6 +63,10 @@ module FastCommentsClient
|
|
|
63
63
|
|
|
64
64
|
attr_accessor :disable_notification_bell
|
|
65
65
|
|
|
66
|
+
attr_accessor :disable_profile_comments
|
|
67
|
+
|
|
68
|
+
attr_accessor :disable_profile_direct_messages
|
|
69
|
+
|
|
66
70
|
attr_accessor :disable_profiles
|
|
67
71
|
|
|
68
72
|
attr_accessor :disable_success_message
|
|
@@ -111,6 +115,8 @@ module FastCommentsClient
|
|
|
111
115
|
|
|
112
116
|
attr_accessor :no_custom_config
|
|
113
117
|
|
|
118
|
+
attr_accessor :mention_auto_complete_mode
|
|
119
|
+
|
|
114
120
|
attr_accessor :no_image_uploads
|
|
115
121
|
|
|
116
122
|
attr_accessor :no_styles
|
|
@@ -152,6 +158,8 @@ module FastCommentsClient
|
|
|
152
158
|
|
|
153
159
|
attr_accessor :widget_question_results_style
|
|
154
160
|
|
|
161
|
+
attr_accessor :widget_question_show_breakdown
|
|
162
|
+
|
|
155
163
|
attr_accessor :widget_question_style
|
|
156
164
|
|
|
157
165
|
attr_accessor :widget_question_when_to_save
|
|
@@ -162,6 +170,18 @@ module FastCommentsClient
|
|
|
162
170
|
|
|
163
171
|
attr_accessor :wrap
|
|
164
172
|
|
|
173
|
+
attr_accessor :ticket_base_url
|
|
174
|
+
|
|
175
|
+
attr_accessor :ticket_kb_search_endpoint
|
|
176
|
+
|
|
177
|
+
attr_accessor :ticket_file_uploads_enabled
|
|
178
|
+
|
|
179
|
+
attr_accessor :ticket_max_file_size
|
|
180
|
+
|
|
181
|
+
attr_accessor :ticket_auto_assign_user_ids
|
|
182
|
+
|
|
183
|
+
attr_accessor :tos
|
|
184
|
+
|
|
165
185
|
class EnumAttributeValidator
|
|
166
186
|
attr_reader :datatype
|
|
167
187
|
attr_reader :allowable_values
|
|
@@ -211,6 +231,8 @@ module FastCommentsClient
|
|
|
211
231
|
:'disable_email_inputs' => :'disableEmailInputs',
|
|
212
232
|
:'disable_live_commenting' => :'disableLiveCommenting',
|
|
213
233
|
:'disable_notification_bell' => :'disableNotificationBell',
|
|
234
|
+
:'disable_profile_comments' => :'disableProfileComments',
|
|
235
|
+
:'disable_profile_direct_messages' => :'disableProfileDirectMessages',
|
|
214
236
|
:'disable_profiles' => :'disableProfiles',
|
|
215
237
|
:'disable_success_message' => :'disableSuccessMessage',
|
|
216
238
|
:'disable_toolbar' => :'disableToolbar',
|
|
@@ -235,6 +257,7 @@ module FastCommentsClient
|
|
|
235
257
|
:'max_comment_character_length' => :'maxCommentCharacterLength',
|
|
236
258
|
:'max_comment_created_count_pupm' => :'maxCommentCreatedCountPUPM',
|
|
237
259
|
:'no_custom_config' => :'noCustomConfig',
|
|
260
|
+
:'mention_auto_complete_mode' => :'mentionAutoCompleteMode',
|
|
238
261
|
:'no_image_uploads' => :'noImageUploads',
|
|
239
262
|
:'no_styles' => :'noStyles',
|
|
240
263
|
:'page_size' => :'pageSize',
|
|
@@ -255,11 +278,18 @@ module FastCommentsClient
|
|
|
255
278
|
:'vote_style' => :'voteStyle',
|
|
256
279
|
:'widget_question_id' => :'widgetQuestionId',
|
|
257
280
|
:'widget_question_results_style' => :'widgetQuestionResultsStyle',
|
|
281
|
+
:'widget_question_show_breakdown' => :'widgetQuestionShowBreakdown',
|
|
258
282
|
:'widget_question_style' => :'widgetQuestionStyle',
|
|
259
283
|
:'widget_question_when_to_save' => :'widgetQuestionWhenToSave',
|
|
260
284
|
:'widget_questions_required' => :'widgetQuestionsRequired',
|
|
261
285
|
:'widget_sub_question_visibility' => :'widgetSubQuestionVisibility',
|
|
262
|
-
:'wrap' => :'wrap'
|
|
286
|
+
:'wrap' => :'wrap',
|
|
287
|
+
:'ticket_base_url' => :'ticketBaseUrl',
|
|
288
|
+
:'ticket_kb_search_endpoint' => :'ticketKBSearchEndpoint',
|
|
289
|
+
:'ticket_file_uploads_enabled' => :'ticketFileUploadsEnabled',
|
|
290
|
+
:'ticket_max_file_size' => :'ticketMaxFileSize',
|
|
291
|
+
:'ticket_auto_assign_user_ids' => :'ticketAutoAssignUserIds',
|
|
292
|
+
:'tos' => :'tos'
|
|
263
293
|
}
|
|
264
294
|
end
|
|
265
295
|
|
|
@@ -300,6 +330,8 @@ module FastCommentsClient
|
|
|
300
330
|
:'disable_email_inputs' => :'Boolean',
|
|
301
331
|
:'disable_live_commenting' => :'Boolean',
|
|
302
332
|
:'disable_notification_bell' => :'Boolean',
|
|
333
|
+
:'disable_profile_comments' => :'Boolean',
|
|
334
|
+
:'disable_profile_direct_messages' => :'Boolean',
|
|
303
335
|
:'disable_profiles' => :'Boolean',
|
|
304
336
|
:'disable_success_message' => :'Boolean',
|
|
305
337
|
:'disable_toolbar' => :'Boolean',
|
|
@@ -324,6 +356,7 @@ module FastCommentsClient
|
|
|
324
356
|
:'max_comment_character_length' => :'Integer',
|
|
325
357
|
:'max_comment_created_count_pupm' => :'Integer',
|
|
326
358
|
:'no_custom_config' => :'Boolean',
|
|
359
|
+
:'mention_auto_complete_mode' => :'MentionAutoCompleteMode',
|
|
327
360
|
:'no_image_uploads' => :'Boolean',
|
|
328
361
|
:'no_styles' => :'Boolean',
|
|
329
362
|
:'page_size' => :'Integer',
|
|
@@ -344,11 +377,18 @@ module FastCommentsClient
|
|
|
344
377
|
:'vote_style' => :'VoteStyle',
|
|
345
378
|
:'widget_question_id' => :'String',
|
|
346
379
|
:'widget_question_results_style' => :'CommentQuestionResultsRenderingType',
|
|
380
|
+
:'widget_question_show_breakdown' => :'Boolean',
|
|
347
381
|
:'widget_question_style' => :'QuestionRenderingType',
|
|
348
382
|
:'widget_question_when_to_save' => :'QuestionWhenSave',
|
|
349
383
|
:'widget_questions_required' => :'CommentQuestionsRequired',
|
|
350
384
|
:'widget_sub_question_visibility' => :'QuestionSubQuestionVisibility',
|
|
351
|
-
:'wrap' => :'Boolean'
|
|
385
|
+
:'wrap' => :'Boolean',
|
|
386
|
+
:'ticket_base_url' => :'String',
|
|
387
|
+
:'ticket_kb_search_endpoint' => :'String',
|
|
388
|
+
:'ticket_file_uploads_enabled' => :'Boolean',
|
|
389
|
+
:'ticket_max_file_size' => :'Integer',
|
|
390
|
+
:'ticket_auto_assign_user_ids' => :'Array<String>',
|
|
391
|
+
:'tos' => :'TOSConfig'
|
|
352
392
|
}
|
|
353
393
|
end
|
|
354
394
|
|
|
@@ -368,6 +408,7 @@ module FastCommentsClient
|
|
|
368
408
|
:'locale',
|
|
369
409
|
:'max_comment_character_length',
|
|
370
410
|
:'max_comment_created_count_pupm',
|
|
411
|
+
:'mention_auto_complete_mode',
|
|
371
412
|
:'page_size',
|
|
372
413
|
:'restricted_link_domains',
|
|
373
414
|
:'translations',
|
|
@@ -488,6 +529,14 @@ module FastCommentsClient
|
|
|
488
529
|
self.disable_notification_bell = attributes[:'disable_notification_bell']
|
|
489
530
|
end
|
|
490
531
|
|
|
532
|
+
if attributes.key?(:'disable_profile_comments')
|
|
533
|
+
self.disable_profile_comments = attributes[:'disable_profile_comments']
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
if attributes.key?(:'disable_profile_direct_messages')
|
|
537
|
+
self.disable_profile_direct_messages = attributes[:'disable_profile_direct_messages']
|
|
538
|
+
end
|
|
539
|
+
|
|
491
540
|
if attributes.key?(:'disable_profiles')
|
|
492
541
|
self.disable_profiles = attributes[:'disable_profiles']
|
|
493
542
|
end
|
|
@@ -584,6 +633,10 @@ module FastCommentsClient
|
|
|
584
633
|
self.no_custom_config = attributes[:'no_custom_config']
|
|
585
634
|
end
|
|
586
635
|
|
|
636
|
+
if attributes.key?(:'mention_auto_complete_mode')
|
|
637
|
+
self.mention_auto_complete_mode = attributes[:'mention_auto_complete_mode']
|
|
638
|
+
end
|
|
639
|
+
|
|
587
640
|
if attributes.key?(:'no_image_uploads')
|
|
588
641
|
self.no_image_uploads = attributes[:'no_image_uploads']
|
|
589
642
|
end
|
|
@@ -670,6 +723,10 @@ module FastCommentsClient
|
|
|
670
723
|
self.widget_question_results_style = attributes[:'widget_question_results_style']
|
|
671
724
|
end
|
|
672
725
|
|
|
726
|
+
if attributes.key?(:'widget_question_show_breakdown')
|
|
727
|
+
self.widget_question_show_breakdown = attributes[:'widget_question_show_breakdown']
|
|
728
|
+
end
|
|
729
|
+
|
|
673
730
|
if attributes.key?(:'widget_question_style')
|
|
674
731
|
self.widget_question_style = attributes[:'widget_question_style']
|
|
675
732
|
end
|
|
@@ -689,6 +746,32 @@ module FastCommentsClient
|
|
|
689
746
|
if attributes.key?(:'wrap')
|
|
690
747
|
self.wrap = attributes[:'wrap']
|
|
691
748
|
end
|
|
749
|
+
|
|
750
|
+
if attributes.key?(:'ticket_base_url')
|
|
751
|
+
self.ticket_base_url = attributes[:'ticket_base_url']
|
|
752
|
+
end
|
|
753
|
+
|
|
754
|
+
if attributes.key?(:'ticket_kb_search_endpoint')
|
|
755
|
+
self.ticket_kb_search_endpoint = attributes[:'ticket_kb_search_endpoint']
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
if attributes.key?(:'ticket_file_uploads_enabled')
|
|
759
|
+
self.ticket_file_uploads_enabled = attributes[:'ticket_file_uploads_enabled']
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
if attributes.key?(:'ticket_max_file_size')
|
|
763
|
+
self.ticket_max_file_size = attributes[:'ticket_max_file_size']
|
|
764
|
+
end
|
|
765
|
+
|
|
766
|
+
if attributes.key?(:'ticket_auto_assign_user_ids')
|
|
767
|
+
if (value = attributes[:'ticket_auto_assign_user_ids']).is_a?(Array)
|
|
768
|
+
self.ticket_auto_assign_user_ids = value
|
|
769
|
+
end
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
if attributes.key?(:'tos')
|
|
773
|
+
self.tos = attributes[:'tos']
|
|
774
|
+
end
|
|
692
775
|
end
|
|
693
776
|
|
|
694
777
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -735,6 +818,8 @@ module FastCommentsClient
|
|
|
735
818
|
disable_email_inputs == o.disable_email_inputs &&
|
|
736
819
|
disable_live_commenting == o.disable_live_commenting &&
|
|
737
820
|
disable_notification_bell == o.disable_notification_bell &&
|
|
821
|
+
disable_profile_comments == o.disable_profile_comments &&
|
|
822
|
+
disable_profile_direct_messages == o.disable_profile_direct_messages &&
|
|
738
823
|
disable_profiles == o.disable_profiles &&
|
|
739
824
|
disable_success_message == o.disable_success_message &&
|
|
740
825
|
disable_toolbar == o.disable_toolbar &&
|
|
@@ -759,6 +844,7 @@ module FastCommentsClient
|
|
|
759
844
|
max_comment_character_length == o.max_comment_character_length &&
|
|
760
845
|
max_comment_created_count_pupm == o.max_comment_created_count_pupm &&
|
|
761
846
|
no_custom_config == o.no_custom_config &&
|
|
847
|
+
mention_auto_complete_mode == o.mention_auto_complete_mode &&
|
|
762
848
|
no_image_uploads == o.no_image_uploads &&
|
|
763
849
|
no_styles == o.no_styles &&
|
|
764
850
|
page_size == o.page_size &&
|
|
@@ -779,11 +865,18 @@ module FastCommentsClient
|
|
|
779
865
|
vote_style == o.vote_style &&
|
|
780
866
|
widget_question_id == o.widget_question_id &&
|
|
781
867
|
widget_question_results_style == o.widget_question_results_style &&
|
|
868
|
+
widget_question_show_breakdown == o.widget_question_show_breakdown &&
|
|
782
869
|
widget_question_style == o.widget_question_style &&
|
|
783
870
|
widget_question_when_to_save == o.widget_question_when_to_save &&
|
|
784
871
|
widget_questions_required == o.widget_questions_required &&
|
|
785
872
|
widget_sub_question_visibility == o.widget_sub_question_visibility &&
|
|
786
|
-
wrap == o.wrap
|
|
873
|
+
wrap == o.wrap &&
|
|
874
|
+
ticket_base_url == o.ticket_base_url &&
|
|
875
|
+
ticket_kb_search_endpoint == o.ticket_kb_search_endpoint &&
|
|
876
|
+
ticket_file_uploads_enabled == o.ticket_file_uploads_enabled &&
|
|
877
|
+
ticket_max_file_size == o.ticket_max_file_size &&
|
|
878
|
+
ticket_auto_assign_user_ids == o.ticket_auto_assign_user_ids &&
|
|
879
|
+
tos == o.tos
|
|
787
880
|
end
|
|
788
881
|
|
|
789
882
|
# @see the `==` method
|
|
@@ -795,7 +888,7 @@ module FastCommentsClient
|
|
|
795
888
|
# Calculates hash code according to all attributes.
|
|
796
889
|
# @return [Integer] Hash code
|
|
797
890
|
def hash
|
|
798
|
-
[absolute_and_relative_dates, absolute_dates, allow_anon, allow_anon_flag, allow_anon_votes, allowed_languages, collapse_replies, comment_count_format, comment_html_rendering_mode, comment_thread_delete_mode, commenter_name_format, count_above_toggle, custom_css, default_avatar_src, default_sort_direction, default_username, disable_auto_admin_migration, disable_auto_hash_tag_creation, disable_blocking, disable_commenter_comment_delete, disable_commenter_comment_edit, disable_email_inputs, disable_live_commenting, disable_notification_bell, disable_profiles, disable_success_message, disable_toolbar, disable_unverified_label, disable_voting, enable_commenter_links, enable_search, enable_spoilers, enable_third_party_cookie_bypass, enable_view_counts, enable_vote_list, enable_wysiwyg, gif_rating, has_dark_background, header_html, hide_avatars, hide_comments_under_count_text_format, image_content_profanity_level, input_after_comments, limit_comments_by_groups, locale, max_comment_character_length, max_comment_created_count_pupm, no_custom_config, no_image_uploads, no_styles, page_size, readonly, no_new_root_comments, require_sso, enable_resize_handle, restricted_link_domains, show_badges_in_top_bar, show_comment_save_success, show_live_right_away, show_question, spam_rules, sso_sec_lvl, translations, use_show_comments_toggle, use_single_line_comment_input, vote_style, widget_question_id, widget_question_results_style, widget_question_style, widget_question_when_to_save, widget_questions_required, widget_sub_question_visibility, wrap].hash
|
|
891
|
+
[absolute_and_relative_dates, absolute_dates, allow_anon, allow_anon_flag, allow_anon_votes, allowed_languages, collapse_replies, comment_count_format, comment_html_rendering_mode, comment_thread_delete_mode, commenter_name_format, count_above_toggle, custom_css, default_avatar_src, default_sort_direction, default_username, disable_auto_admin_migration, disable_auto_hash_tag_creation, disable_blocking, disable_commenter_comment_delete, disable_commenter_comment_edit, disable_email_inputs, disable_live_commenting, disable_notification_bell, disable_profile_comments, disable_profile_direct_messages, disable_profiles, disable_success_message, disable_toolbar, disable_unverified_label, disable_voting, enable_commenter_links, enable_search, enable_spoilers, enable_third_party_cookie_bypass, enable_view_counts, enable_vote_list, enable_wysiwyg, gif_rating, has_dark_background, header_html, hide_avatars, hide_comments_under_count_text_format, image_content_profanity_level, input_after_comments, limit_comments_by_groups, locale, max_comment_character_length, max_comment_created_count_pupm, no_custom_config, mention_auto_complete_mode, no_image_uploads, no_styles, page_size, readonly, no_new_root_comments, require_sso, enable_resize_handle, restricted_link_domains, show_badges_in_top_bar, show_comment_save_success, show_live_right_away, show_question, spam_rules, sso_sec_lvl, translations, use_show_comments_toggle, use_single_line_comment_input, vote_style, widget_question_id, widget_question_results_style, widget_question_show_breakdown, widget_question_style, widget_question_when_to_save, widget_questions_required, widget_sub_question_visibility, wrap, ticket_base_url, ticket_kb_search_endpoint, ticket_file_uploads_enabled, ticket_max_file_size, ticket_auto_assign_user_ids, tos].hash
|
|
799
892
|
end
|
|
800
893
|
|
|
801
894
|
# Builds the object from hash
|
|
@@ -157,6 +157,8 @@ module FastCommentsClient
|
|
|
157
157
|
|
|
158
158
|
attr_accessor :edit_key
|
|
159
159
|
|
|
160
|
+
attr_accessor :tos_accepted_at
|
|
161
|
+
|
|
160
162
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
161
163
|
def self.attribute_map
|
|
162
164
|
{
|
|
@@ -230,7 +232,8 @@ module FastCommentsClient
|
|
|
230
232
|
:'group_ids' => :'groupIds',
|
|
231
233
|
:'view_count' => :'viewCount',
|
|
232
234
|
:'requires_verification' => :'requiresVerification',
|
|
233
|
-
:'edit_key' => :'editKey'
|
|
235
|
+
:'edit_key' => :'editKey',
|
|
236
|
+
:'tos_accepted_at' => :'tosAcceptedAt'
|
|
234
237
|
}
|
|
235
238
|
end
|
|
236
239
|
|
|
@@ -317,7 +320,8 @@ module FastCommentsClient
|
|
|
317
320
|
:'group_ids' => :'Array<String>',
|
|
318
321
|
:'view_count' => :'Integer',
|
|
319
322
|
:'requires_verification' => :'Boolean',
|
|
320
|
-
:'edit_key' => :'String'
|
|
323
|
+
:'edit_key' => :'String',
|
|
324
|
+
:'tos_accepted_at' => :'Time'
|
|
321
325
|
}
|
|
322
326
|
end
|
|
323
327
|
|
|
@@ -695,6 +699,10 @@ module FastCommentsClient
|
|
|
695
699
|
if attributes.key?(:'edit_key')
|
|
696
700
|
self.edit_key = attributes[:'edit_key']
|
|
697
701
|
end
|
|
702
|
+
|
|
703
|
+
if attributes.key?(:'tos_accepted_at')
|
|
704
|
+
self.tos_accepted_at = attributes[:'tos_accepted_at']
|
|
705
|
+
end
|
|
698
706
|
end
|
|
699
707
|
|
|
700
708
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -922,7 +930,8 @@ module FastCommentsClient
|
|
|
922
930
|
group_ids == o.group_ids &&
|
|
923
931
|
view_count == o.view_count &&
|
|
924
932
|
requires_verification == o.requires_verification &&
|
|
925
|
-
edit_key == o.edit_key
|
|
933
|
+
edit_key == o.edit_key &&
|
|
934
|
+
tos_accepted_at == o.tos_accepted_at
|
|
926
935
|
end
|
|
927
936
|
|
|
928
937
|
# @see the `==` method
|
|
@@ -934,7 +943,7 @@ module FastCommentsClient
|
|
|
934
943
|
# Calculates hash code according to all attributes.
|
|
935
944
|
# @return [Integer] Hash code
|
|
936
945
|
def hash
|
|
937
|
-
[_id, tenant_id, url_id, url_id_raw, url, page_title, user_id, anon_user_id, commenter_email, commenter_name, commenter_link, comment, comment_html, parent_id, date, local_date_string, local_date_hours, votes, votes_up, votes_down, expire_at, verified, verified_date, verification_id, notification_sent_for_parent, notification_sent_for_parent_tenant, reviewed, imported, external_id, external_parent_id, avatar_src, is_spam, perm_not_spam, ai_determined_spam, has_images, page_number, page_number_of, page_number_nf, has_links, has_code, approved, locale, is_deleted, is_deleted_user, is_banned_user, is_by_admin, is_by_moderator, is_pinned, is_locked, flag_count, rating, display_label, from_product_id, meta, ip_hash, mentions, hash_tags, badges, domain, veteran_badge_processed, moderation_group_ids, did_process_badges, from_offline_restore, autoplay_job_id, autoplay_delay_ms, feedback_ids, logs, group_ids, view_count, requires_verification, edit_key].hash
|
|
946
|
+
[_id, tenant_id, url_id, url_id_raw, url, page_title, user_id, anon_user_id, commenter_email, commenter_name, commenter_link, comment, comment_html, parent_id, date, local_date_string, local_date_hours, votes, votes_up, votes_down, expire_at, verified, verified_date, verification_id, notification_sent_for_parent, notification_sent_for_parent_tenant, reviewed, imported, external_id, external_parent_id, avatar_src, is_spam, perm_not_spam, ai_determined_spam, has_images, page_number, page_number_of, page_number_nf, has_links, has_code, approved, locale, is_deleted, is_deleted_user, is_banned_user, is_by_admin, is_by_moderator, is_pinned, is_locked, flag_count, rating, display_label, from_product_id, meta, ip_hash, mentions, hash_tags, badges, domain, veteran_badge_processed, moderation_group_ids, did_process_badges, from_offline_restore, autoplay_job_id, autoplay_delay_ms, feedback_ids, logs, group_ids, view_count, requires_verification, edit_key, tos_accepted_at].hash
|
|
938
947
|
end
|
|
939
948
|
|
|
940
949
|
# Builds the object from hash
|
|
@@ -15,6 +15,8 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FastCommentsClient
|
|
17
17
|
class FCommentMeta < ApiModelBase
|
|
18
|
+
attr_accessor :wp_id
|
|
19
|
+
|
|
18
20
|
attr_accessor :wp_user_id
|
|
19
21
|
|
|
20
22
|
attr_accessor :wp_post_id
|
|
@@ -22,6 +24,7 @@ module FastCommentsClient
|
|
|
22
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
25
|
def self.attribute_map
|
|
24
26
|
{
|
|
27
|
+
:'wp_id' => :'wpId',
|
|
25
28
|
:'wp_user_id' => :'wpUserId',
|
|
26
29
|
:'wp_post_id' => :'wpPostId'
|
|
27
30
|
}
|
|
@@ -40,6 +43,7 @@ module FastCommentsClient
|
|
|
40
43
|
# Attribute type mapping.
|
|
41
44
|
def self.openapi_types
|
|
42
45
|
{
|
|
46
|
+
:'wp_id' => :'String',
|
|
43
47
|
:'wp_user_id' => :'String',
|
|
44
48
|
:'wp_post_id' => :'String'
|
|
45
49
|
}
|
|
@@ -67,6 +71,10 @@ module FastCommentsClient
|
|
|
67
71
|
h[k.to_sym] = v
|
|
68
72
|
}
|
|
69
73
|
|
|
74
|
+
if attributes.key?(:'wp_id')
|
|
75
|
+
self.wp_id = attributes[:'wp_id']
|
|
76
|
+
end
|
|
77
|
+
|
|
70
78
|
if attributes.key?(:'wp_user_id')
|
|
71
79
|
self.wp_user_id = attributes[:'wp_user_id']
|
|
72
80
|
end
|
|
@@ -96,6 +104,7 @@ module FastCommentsClient
|
|
|
96
104
|
def ==(o)
|
|
97
105
|
return true if self.equal?(o)
|
|
98
106
|
self.class == o.class &&
|
|
107
|
+
wp_id == o.wp_id &&
|
|
99
108
|
wp_user_id == o.wp_user_id &&
|
|
100
109
|
wp_post_id == o.wp_post_id
|
|
101
110
|
end
|
|
@@ -109,7 +118,7 @@ module FastCommentsClient
|
|
|
109
118
|
# Calculates hash code according to all attributes.
|
|
110
119
|
# @return [Integer] Hash code
|
|
111
120
|
def hash
|
|
112
|
-
[wp_user_id, wp_post_id].hash
|
|
121
|
+
[wp_id, wp_user_id, wp_post_id].hash
|
|
113
122
|
end
|
|
114
123
|
|
|
115
124
|
# Builds the object from hash
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#fastcomments
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FastCommentsClient
|
|
17
|
+
module GetTicket200Response
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
|
+
[
|
|
22
|
+
:'APIError',
|
|
23
|
+
:'GetTicketResponse'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_any_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
return find_and_cast_into_type(klass, data)
|
|
41
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
51
|
+
|
|
52
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
53
|
+
def find_and_cast_into_type(klass, data)
|
|
54
|
+
return if data.nil?
|
|
55
|
+
|
|
56
|
+
case klass.to_s
|
|
57
|
+
when 'Boolean'
|
|
58
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
59
|
+
when 'Float'
|
|
60
|
+
return data if data.instance_of?(Float)
|
|
61
|
+
when 'Integer'
|
|
62
|
+
return data if data.instance_of?(Integer)
|
|
63
|
+
when 'Time'
|
|
64
|
+
return Time.parse(data)
|
|
65
|
+
when 'Date'
|
|
66
|
+
return Date.iso8601(data)
|
|
67
|
+
when 'String'
|
|
68
|
+
return data if data.instance_of?(String)
|
|
69
|
+
when 'Object' # "type: object"
|
|
70
|
+
return data if data.instance_of?(Hash)
|
|
71
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
72
|
+
if data.instance_of?(Array)
|
|
73
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
74
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
75
|
+
end
|
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
+
end
|
|
81
|
+
else # model
|
|
82
|
+
const = FastCommentsClient.const_get(klass)
|
|
83
|
+
if const
|
|
84
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
85
|
+
model = const.build(data)
|
|
86
|
+
return model if model
|
|
87
|
+
else
|
|
88
|
+
# raise if data contains keys that are not known to the model
|
|
89
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
90
|
+
model = const.build_from_hash(data)
|
|
91
|
+
return model if model
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
raise # if no match by now, raise
|
|
97
|
+
rescue
|
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|