agent_push_kit 0.1.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.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +145 -0
  4. data/LICENSE +21 -0
  5. data/README.md +195 -0
  6. data/Rakefile +10 -0
  7. data/agent_push_kit.gemspec +39 -0
  8. data/docs/AcceptedResponse.md +18 -0
  9. data/docs/AccountApi.md +137 -0
  10. data/docs/AddMemberInput.md +18 -0
  11. data/docs/AgentToken.md +30 -0
  12. data/docs/AgentTokenCreated.md +32 -0
  13. data/docs/AgentTokensApi.md +279 -0
  14. data/docs/ApiKeySummary.md +22 -0
  15. data/docs/AuthResponse.md +24 -0
  16. data/docs/AuthenticationApi.md +385 -0
  17. data/docs/CreateAgentTokenInput.md +18 -0
  18. data/docs/CreateOrganizationInput.md +18 -0
  19. data/docs/CurrentAccount.md +20 -0
  20. data/docs/CustomerAccountsApi.md +348 -0
  21. data/docs/DeletedResponse.md +18 -0
  22. data/docs/DeliverySummary.md +24 -0
  23. data/docs/Device.md +28 -0
  24. data/docs/DevicesApi.md +344 -0
  25. data/docs/DisabledResponse.md +18 -0
  26. data/docs/ErrorResponse.md +22 -0
  27. data/docs/EventDetail.md +36 -0
  28. data/docs/EventFilter.md +53 -0
  29. data/docs/EventPage.md +20 -0
  30. data/docs/EventSummary.md +32 -0
  31. data/docs/EventsApi.md +505 -0
  32. data/docs/FilterGroup.md +20 -0
  33. data/docs/FilterNot.md +20 -0
  34. data/docs/HealthApi.md +67 -0
  35. data/docs/HealthResponse.md +20 -0
  36. data/docs/IngestionResult.md +22 -0
  37. data/docs/InheritedResponse.md +18 -0
  38. data/docs/Membership.md +24 -0
  39. data/docs/MembershipUser.md +22 -0
  40. data/docs/Organization.md +32 -0
  41. data/docs/OrganizationApiKeyCreated.md +24 -0
  42. data/docs/OrganizationCount.md +20 -0
  43. data/docs/OrganizationCreated.md +20 -0
  44. data/docs/OrganizationRecord.md +24 -0
  45. data/docs/PasswordLoginInput.md +20 -0
  46. data/docs/PasswordResetCompleteInput.md +20 -0
  47. data/docs/PasswordResetRequestInput.md +18 -0
  48. data/docs/PreferenceRecord.md +24 -0
  49. data/docs/PreferencesApi.md +287 -0
  50. data/docs/ProviderLoginInput.md +20 -0
  51. data/docs/RegisterDeviceInput.md +24 -0
  52. data/docs/RegisterInput.md +22 -0
  53. data/docs/RegisterWebPushSubscriptionInput.md +20 -0
  54. data/docs/RegisterWebPushSubscriptionInputKeys.md +20 -0
  55. data/docs/RevokedResponse.md +18 -0
  56. data/docs/SearchEventsInput.md +22 -0
  57. data/docs/SendEventInput.md +32 -0
  58. data/docs/Service.md +26 -0
  59. data/docs/ServiceAllOfCount.md +18 -0
  60. data/docs/ServicePreference.md +26 -0
  61. data/docs/ServiceSummary.md +22 -0
  62. data/docs/SetEnabledInput.md +18 -0
  63. data/docs/TextFilterCondition.md +22 -0
  64. data/docs/TimeFilterCondition.md +22 -0
  65. data/docs/TypeOverride.md +22 -0
  66. data/docs/User.md +28 -0
  67. data/docs/WebPushConfiguration.md +20 -0
  68. data/docs/WebPushSubscription.md +22 -0
  69. data/git_push.sh +57 -0
  70. data/lib/agent_push_kit/api/account_api.rb +132 -0
  71. data/lib/agent_push_kit/api/agent_tokens_api.rb +274 -0
  72. data/lib/agent_push_kit/api/authentication_api.rb +418 -0
  73. data/lib/agent_push_kit/api/customer_accounts_api.rb +339 -0
  74. data/lib/agent_push_kit/api/devices_api.rb +339 -0
  75. data/lib/agent_push_kit/api/events_api.rb +520 -0
  76. data/lib/agent_push_kit/api/health_api.rb +77 -0
  77. data/lib/agent_push_kit/api/preferences_api.rb +308 -0
  78. data/lib/agent_push_kit/api_client.rb +397 -0
  79. data/lib/agent_push_kit/api_error.rb +58 -0
  80. data/lib/agent_push_kit/api_model_base.rb +88 -0
  81. data/lib/agent_push_kit/configuration.rb +325 -0
  82. data/lib/agent_push_kit/models/accepted_response.rb +164 -0
  83. data/lib/agent_push_kit/models/add_member_input.rb +173 -0
  84. data/lib/agent_push_kit/models/agent_token.rb +292 -0
  85. data/lib/agent_push_kit/models/agent_token_created.rb +364 -0
  86. data/lib/agent_push_kit/models/api_key_summary.rb +165 -0
  87. data/lib/agent_push_kit/models/auth_response.rb +228 -0
  88. data/lib/agent_push_kit/models/create_agent_token_input.rb +182 -0
  89. data/lib/agent_push_kit/models/create_organization_input.rb +182 -0
  90. data/lib/agent_push_kit/models/current_account.rb +192 -0
  91. data/lib/agent_push_kit/models/deleted_response.rb +164 -0
  92. data/lib/agent_push_kit/models/delivery_summary.rb +242 -0
  93. data/lib/agent_push_kit/models/device.rb +304 -0
  94. data/lib/agent_push_kit/models/disabled_response.rb +164 -0
  95. data/lib/agent_push_kit/models/error_response.rb +199 -0
  96. data/lib/agent_push_kit/models/event_detail.rb +393 -0
  97. data/lib/agent_push_kit/models/event_filter.rb +106 -0
  98. data/lib/agent_push_kit/models/event_page.rb +178 -0
  99. data/lib/agent_push_kit/models/event_summary.rb +318 -0
  100. data/lib/agent_push_kit/models/filter_group.rb +234 -0
  101. data/lib/agent_push_kit/models/filter_not.rb +214 -0
  102. data/lib/agent_push_kit/models/health_response.rb +216 -0
  103. data/lib/agent_push_kit/models/ingestion_result.rb +216 -0
  104. data/lib/agent_push_kit/models/inherited_response.rb +164 -0
  105. data/lib/agent_push_kit/models/membership.rb +266 -0
  106. data/lib/agent_push_kit/models/membership_user.rb +202 -0
  107. data/lib/agent_push_kit/models/organization.rb +337 -0
  108. data/lib/agent_push_kit/models/organization_api_key_created.rb +253 -0
  109. data/lib/agent_push_kit/models/organization_count.rb +156 -0
  110. data/lib/agent_push_kit/models/organization_created.rb +201 -0
  111. data/lib/agent_push_kit/models/organization_record.rb +242 -0
  112. data/lib/agent_push_kit/models/password_login_input.rb +217 -0
  113. data/lib/agent_push_kit/models/password_reset_complete_input.rb +217 -0
  114. data/lib/agent_push_kit/models/password_reset_request_input.rb +173 -0
  115. data/lib/agent_push_kit/models/preference_record.rb +242 -0
  116. data/lib/agent_push_kit/models/provider_login_input.rb +201 -0
  117. data/lib/agent_push_kit/models/register_device_input.rb +304 -0
  118. data/lib/agent_push_kit/models/register_input.rb +245 -0
  119. data/lib/agent_push_kit/models/register_web_push_subscription_input.rb +199 -0
  120. data/lib/agent_push_kit/models/register_web_push_subscription_input_keys.rb +226 -0
  121. data/lib/agent_push_kit/models/revoked_response.rb +164 -0
  122. data/lib/agent_push_kit/models/search_events_input.rb +212 -0
  123. data/lib/agent_push_kit/models/send_event_input.rb +427 -0
  124. data/lib/agent_push_kit/models/service.rb +275 -0
  125. data/lib/agent_push_kit/models/service_all_of_count.rb +164 -0
  126. data/lib/agent_push_kit/models/service_preference.rb +270 -0
  127. data/lib/agent_push_kit/models/service_summary.rb +216 -0
  128. data/lib/agent_push_kit/models/set_enabled_input.rb +164 -0
  129. data/lib/agent_push_kit/models/text_filter_condition.rb +260 -0
  130. data/lib/agent_push_kit/models/time_filter_condition.rb +242 -0
  131. data/lib/agent_push_kit/models/type_override.rb +216 -0
  132. data/lib/agent_push_kit/models/user.rb +280 -0
  133. data/lib/agent_push_kit/models/web_push_configuration.rb +176 -0
  134. data/lib/agent_push_kit/models/web_push_subscription.rb +216 -0
  135. data/lib/agent_push_kit/version.rb +15 -0
  136. data/lib/agent_push_kit.rb +101 -0
  137. data/spec/api/account_api_spec.rb +55 -0
  138. data/spec/api/agent_tokens_api_spec.rb +80 -0
  139. data/spec/api/authentication_api_spec.rb +101 -0
  140. data/spec/api/customer_accounts_api_spec.rb +91 -0
  141. data/spec/api/devices_api_spec.rb +89 -0
  142. data/spec/api/events_api_spec.rb +121 -0
  143. data/spec/api/health_api_spec.rb +45 -0
  144. data/spec/api/preferences_api_spec.rb +83 -0
  145. data/spec/models/accepted_response_spec.rb +36 -0
  146. data/spec/models/add_member_input_spec.rb +36 -0
  147. data/spec/models/agent_token_created_spec.rb +78 -0
  148. data/spec/models/agent_token_spec.rb +72 -0
  149. data/spec/models/api_key_summary_spec.rb +48 -0
  150. data/spec/models/auth_response_spec.rb +54 -0
  151. data/spec/models/create_agent_token_input_spec.rb +36 -0
  152. data/spec/models/create_organization_input_spec.rb +36 -0
  153. data/spec/models/current_account_spec.rb +42 -0
  154. data/spec/models/deleted_response_spec.rb +36 -0
  155. data/spec/models/delivery_summary_spec.rb +54 -0
  156. data/spec/models/device_spec.rb +70 -0
  157. data/spec/models/disabled_response_spec.rb +36 -0
  158. data/spec/models/error_response_spec.rb +48 -0
  159. data/spec/models/event_detail_spec.rb +90 -0
  160. data/spec/models/event_filter_spec.rb +32 -0
  161. data/spec/models/event_page_spec.rb +42 -0
  162. data/spec/models/event_summary_spec.rb +78 -0
  163. data/spec/models/filter_group_spec.rb +46 -0
  164. data/spec/models/filter_not_spec.rb +46 -0
  165. data/spec/models/health_response_spec.rb +50 -0
  166. data/spec/models/ingestion_result_spec.rb +48 -0
  167. data/spec/models/inherited_response_spec.rb +36 -0
  168. data/spec/models/membership_spec.rb +58 -0
  169. data/spec/models/membership_user_spec.rb +48 -0
  170. data/spec/models/organization_api_key_created_spec.rb +54 -0
  171. data/spec/models/organization_count_spec.rb +42 -0
  172. data/spec/models/organization_created_spec.rb +42 -0
  173. data/spec/models/organization_record_spec.rb +54 -0
  174. data/spec/models/organization_spec.rb +82 -0
  175. data/spec/models/password_login_input_spec.rb +42 -0
  176. data/spec/models/password_reset_complete_input_spec.rb +42 -0
  177. data/spec/models/password_reset_request_input_spec.rb +36 -0
  178. data/spec/models/preference_record_spec.rb +54 -0
  179. data/spec/models/provider_login_input_spec.rb +42 -0
  180. data/spec/models/register_device_input_spec.rb +58 -0
  181. data/spec/models/register_input_spec.rb +48 -0
  182. data/spec/models/register_web_push_subscription_input_keys_spec.rb +42 -0
  183. data/spec/models/register_web_push_subscription_input_spec.rb +42 -0
  184. data/spec/models/revoked_response_spec.rb +36 -0
  185. data/spec/models/search_events_input_spec.rb +48 -0
  186. data/spec/models/send_event_input_spec.rb +78 -0
  187. data/spec/models/service_all_of_count_spec.rb +36 -0
  188. data/spec/models/service_preference_spec.rb +60 -0
  189. data/spec/models/service_spec.rb +60 -0
  190. data/spec/models/service_summary_spec.rb +48 -0
  191. data/spec/models/set_enabled_input_spec.rb +36 -0
  192. data/spec/models/text_filter_condition_spec.rb +56 -0
  193. data/spec/models/time_filter_condition_spec.rb +56 -0
  194. data/spec/models/type_override_spec.rb +48 -0
  195. data/spec/models/user_spec.rb +66 -0
  196. data/spec/models/web_push_configuration_spec.rb +42 -0
  197. data/spec/models/web_push_subscription_spec.rb +48 -0
  198. data/spec/spec_helper.rb +111 -0
  199. metadata +344 -0
@@ -0,0 +1,212 @@
1
+ =begin
2
+ #Agent Push Kit API
3
+
4
+ #The complete Agent Push Kit REST API. Application event ingestion uses an organization key beginning with `apk_`. Authenticated user operations accept either an Agent Push Kit login JWT or an agent access token beginning with `apt_`.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module AgentPushKit
17
+ class SearchEventsInput < ApiModelBase
18
+ attr_accessor :filter
19
+
20
+ attr_accessor :cursor
21
+
22
+ attr_accessor :limit
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'filter' => :'filter',
28
+ :'cursor' => :'cursor',
29
+ :'limit' => :'limit'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'filter' => :'EventFilter',
47
+ :'cursor' => :'String',
48
+ :'limit' => :'Integer'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AgentPushKit::SearchEventsInput` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AgentPushKit::SearchEventsInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'filter')
75
+ self.filter = attributes[:'filter']
76
+ else
77
+ self.filter = nil
78
+ end
79
+
80
+ if attributes.key?(:'cursor')
81
+ self.cursor = attributes[:'cursor']
82
+ end
83
+
84
+ if attributes.key?(:'limit')
85
+ self.limit = attributes[:'limit']
86
+ else
87
+ self.limit = 50
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @filter.nil?
97
+ invalid_properties.push('invalid value for "filter", filter cannot be nil.')
98
+ end
99
+
100
+ if !@limit.nil? && @limit > 100
101
+ invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.')
102
+ end
103
+
104
+ if !@limit.nil? && @limit < 1
105
+ invalid_properties.push('invalid value for "limit", must be greater than or equal to 1.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if @filter.nil?
116
+ return false if !@limit.nil? && @limit > 100
117
+ return false if !@limit.nil? && @limit < 1
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] filter Value to be assigned
123
+ def filter=(filter)
124
+ if filter.nil?
125
+ fail ArgumentError, 'filter cannot be nil'
126
+ end
127
+
128
+ @filter = filter
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] limit Value to be assigned
133
+ def limit=(limit)
134
+ if limit.nil?
135
+ fail ArgumentError, 'limit cannot be nil'
136
+ end
137
+
138
+ if limit > 100
139
+ fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
140
+ end
141
+
142
+ if limit < 1
143
+ fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
144
+ end
145
+
146
+ @limit = limit
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ filter == o.filter &&
155
+ cursor == o.cursor &&
156
+ limit == o.limit
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
+ [filter, cursor, limit].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
@@ -0,0 +1,427 @@
1
+ =begin
2
+ #Agent Push Kit API
3
+
4
+ #The complete Agent Push Kit REST API. Application event ingestion uses an organization key beginning with `apk_`. Authenticated user operations accept either an Agent Push Kit login JWT or an agent access token beginning with `apt_`.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module AgentPushKit
17
+ class SendEventInput < ApiModelBase
18
+ attr_accessor :service
19
+
20
+ attr_accessor :service_display_name
21
+
22
+ attr_accessor :type
23
+
24
+ attr_accessor :title
25
+
26
+ attr_accessor :body
27
+
28
+ attr_accessor :metadata
29
+
30
+ attr_accessor :external_id
31
+
32
+ attr_accessor :action_url
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'service' => :'service',
38
+ :'service_display_name' => :'serviceDisplayName',
39
+ :'type' => :'type',
40
+ :'title' => :'title',
41
+ :'body' => :'body',
42
+ :'metadata' => :'metadata',
43
+ :'external_id' => :'externalId',
44
+ :'action_url' => :'actionUrl'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'service' => :'String',
62
+ :'service_display_name' => :'String',
63
+ :'type' => :'String',
64
+ :'title' => :'String',
65
+ :'body' => :'String',
66
+ :'metadata' => :'Hash<String, Object>',
67
+ :'external_id' => :'String',
68
+ :'action_url' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AgentPushKit::SendEventInput` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AgentPushKit::SendEventInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'service')
95
+ self.service = attributes[:'service']
96
+ else
97
+ self.service = nil
98
+ end
99
+
100
+ if attributes.key?(:'service_display_name')
101
+ self.service_display_name = attributes[:'service_display_name']
102
+ end
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = nil
108
+ end
109
+
110
+ if attributes.key?(:'title')
111
+ self.title = attributes[:'title']
112
+ else
113
+ self.title = nil
114
+ end
115
+
116
+ if attributes.key?(:'body')
117
+ self.body = attributes[:'body']
118
+ else
119
+ self.body = nil
120
+ end
121
+
122
+ if attributes.key?(:'metadata')
123
+ if (value = attributes[:'metadata']).is_a?(Hash)
124
+ self.metadata = value
125
+ end
126
+ end
127
+
128
+ if attributes.key?(:'external_id')
129
+ self.external_id = attributes[:'external_id']
130
+ end
131
+
132
+ if attributes.key?(:'action_url')
133
+ self.action_url = attributes[:'action_url']
134
+ end
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properties with the reasons
139
+ def list_invalid_properties
140
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
141
+ invalid_properties = Array.new
142
+ if @service.nil?
143
+ invalid_properties.push('invalid value for "service", service cannot be nil.')
144
+ end
145
+
146
+ if @service.to_s.length > 120
147
+ invalid_properties.push('invalid value for "service", the character length must be smaller than or equal to 120.')
148
+ end
149
+
150
+ if @service.to_s.length < 1
151
+ invalid_properties.push('invalid value for "service", the character length must be greater than or equal to 1.')
152
+ end
153
+
154
+ if !@service_display_name.nil? && @service_display_name.to_s.length > 120
155
+ invalid_properties.push('invalid value for "service_display_name", the character length must be smaller than or equal to 120.')
156
+ end
157
+
158
+ if !@service_display_name.nil? && @service_display_name.to_s.length < 1
159
+ invalid_properties.push('invalid value for "service_display_name", the character length must be greater than or equal to 1.')
160
+ end
161
+
162
+ if @type.nil?
163
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
164
+ end
165
+
166
+ if @type.to_s.length > 120
167
+ invalid_properties.push('invalid value for "type", the character length must be smaller than or equal to 120.')
168
+ end
169
+
170
+ if @type.to_s.length < 1
171
+ invalid_properties.push('invalid value for "type", the character length must be greater than or equal to 1.')
172
+ end
173
+
174
+ if @title.nil?
175
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
176
+ end
177
+
178
+ if @title.to_s.length > 200
179
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 200.')
180
+ end
181
+
182
+ if @title.to_s.length < 1
183
+ invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.')
184
+ end
185
+
186
+ if @body.nil?
187
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
188
+ end
189
+
190
+ if @body.to_s.length > 10000
191
+ invalid_properties.push('invalid value for "body", the character length must be smaller than or equal to 10000.')
192
+ end
193
+
194
+ if @body.to_s.length < 1
195
+ invalid_properties.push('invalid value for "body", the character length must be greater than or equal to 1.')
196
+ end
197
+
198
+ if !@external_id.nil? && @external_id.to_s.length > 300
199
+ invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 300.')
200
+ end
201
+
202
+ if !@external_id.nil? && @external_id.to_s.length < 1
203
+ invalid_properties.push('invalid value for "external_id", the character length must be greater than or equal to 1.')
204
+ end
205
+
206
+ if !@action_url.nil? && @action_url.to_s.length > 2000
207
+ invalid_properties.push('invalid value for "action_url", the character length must be smaller than or equal to 2000.')
208
+ end
209
+
210
+ invalid_properties
211
+ end
212
+
213
+ # Check to see if the all the properties in the model are valid
214
+ # @return true if the model is valid
215
+ def valid?
216
+ warn '[DEPRECATED] the `valid?` method is obsolete'
217
+ return false if @service.nil?
218
+ return false if @service.to_s.length > 120
219
+ return false if @service.to_s.length < 1
220
+ return false if !@service_display_name.nil? && @service_display_name.to_s.length > 120
221
+ return false if !@service_display_name.nil? && @service_display_name.to_s.length < 1
222
+ return false if @type.nil?
223
+ return false if @type.to_s.length > 120
224
+ return false if @type.to_s.length < 1
225
+ return false if @title.nil?
226
+ return false if @title.to_s.length > 200
227
+ return false if @title.to_s.length < 1
228
+ return false if @body.nil?
229
+ return false if @body.to_s.length > 10000
230
+ return false if @body.to_s.length < 1
231
+ return false if !@external_id.nil? && @external_id.to_s.length > 300
232
+ return false if !@external_id.nil? && @external_id.to_s.length < 1
233
+ return false if !@action_url.nil? && @action_url.to_s.length > 2000
234
+ true
235
+ end
236
+
237
+ # Custom attribute writer method with validation
238
+ # @param [Object] service Value to be assigned
239
+ def service=(service)
240
+ if service.nil?
241
+ fail ArgumentError, 'service cannot be nil'
242
+ end
243
+
244
+ if service.to_s.length > 120
245
+ fail ArgumentError, 'invalid value for "service", the character length must be smaller than or equal to 120.'
246
+ end
247
+
248
+ if service.to_s.length < 1
249
+ fail ArgumentError, 'invalid value for "service", the character length must be greater than or equal to 1.'
250
+ end
251
+
252
+ @service = service
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] service_display_name Value to be assigned
257
+ def service_display_name=(service_display_name)
258
+ if service_display_name.nil?
259
+ fail ArgumentError, 'service_display_name cannot be nil'
260
+ end
261
+
262
+ if service_display_name.to_s.length > 120
263
+ fail ArgumentError, 'invalid value for "service_display_name", the character length must be smaller than or equal to 120.'
264
+ end
265
+
266
+ if service_display_name.to_s.length < 1
267
+ fail ArgumentError, 'invalid value for "service_display_name", the character length must be greater than or equal to 1.'
268
+ end
269
+
270
+ @service_display_name = service_display_name
271
+ end
272
+
273
+ # Custom attribute writer method with validation
274
+ # @param [Object] type Value to be assigned
275
+ def type=(type)
276
+ if type.nil?
277
+ fail ArgumentError, 'type cannot be nil'
278
+ end
279
+
280
+ if type.to_s.length > 120
281
+ fail ArgumentError, 'invalid value for "type", the character length must be smaller than or equal to 120.'
282
+ end
283
+
284
+ if type.to_s.length < 1
285
+ fail ArgumentError, 'invalid value for "type", the character length must be greater than or equal to 1.'
286
+ end
287
+
288
+ @type = type
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] title Value to be assigned
293
+ def title=(title)
294
+ if title.nil?
295
+ fail ArgumentError, 'title cannot be nil'
296
+ end
297
+
298
+ if title.to_s.length > 200
299
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 200.'
300
+ end
301
+
302
+ if title.to_s.length < 1
303
+ fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.'
304
+ end
305
+
306
+ @title = title
307
+ end
308
+
309
+ # Custom attribute writer method with validation
310
+ # @param [Object] body Value to be assigned
311
+ def body=(body)
312
+ if body.nil?
313
+ fail ArgumentError, 'body cannot be nil'
314
+ end
315
+
316
+ if body.to_s.length > 10000
317
+ fail ArgumentError, 'invalid value for "body", the character length must be smaller than or equal to 10000.'
318
+ end
319
+
320
+ if body.to_s.length < 1
321
+ fail ArgumentError, 'invalid value for "body", the character length must be greater than or equal to 1.'
322
+ end
323
+
324
+ @body = body
325
+ end
326
+
327
+ # Custom attribute writer method with validation
328
+ # @param [Object] external_id Value to be assigned
329
+ def external_id=(external_id)
330
+ if external_id.nil?
331
+ fail ArgumentError, 'external_id cannot be nil'
332
+ end
333
+
334
+ if external_id.to_s.length > 300
335
+ fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 300.'
336
+ end
337
+
338
+ if external_id.to_s.length < 1
339
+ fail ArgumentError, 'invalid value for "external_id", the character length must be greater than or equal to 1.'
340
+ end
341
+
342
+ @external_id = external_id
343
+ end
344
+
345
+ # Custom attribute writer method with validation
346
+ # @param [Object] action_url Value to be assigned
347
+ def action_url=(action_url)
348
+ if action_url.nil?
349
+ fail ArgumentError, 'action_url cannot be nil'
350
+ end
351
+
352
+ if action_url.to_s.length > 2000
353
+ fail ArgumentError, 'invalid value for "action_url", the character length must be smaller than or equal to 2000.'
354
+ end
355
+
356
+ @action_url = action_url
357
+ end
358
+
359
+ # Checks equality by comparing each attribute.
360
+ # @param [Object] Object to be compared
361
+ def ==(o)
362
+ return true if self.equal?(o)
363
+ self.class == o.class &&
364
+ service == o.service &&
365
+ service_display_name == o.service_display_name &&
366
+ type == o.type &&
367
+ title == o.title &&
368
+ body == o.body &&
369
+ metadata == o.metadata &&
370
+ external_id == o.external_id &&
371
+ action_url == o.action_url
372
+ end
373
+
374
+ # @see the `==` method
375
+ # @param [Object] Object to be compared
376
+ def eql?(o)
377
+ self == o
378
+ end
379
+
380
+ # Calculates hash code according to all attributes.
381
+ # @return [Integer] Hash code
382
+ def hash
383
+ [service, service_display_name, type, title, body, metadata, external_id, action_url].hash
384
+ end
385
+
386
+ # Builds the object from hash
387
+ # @param [Hash] attributes Model attributes in the form of hash
388
+ # @return [Object] Returns the model itself
389
+ def self.build_from_hash(attributes)
390
+ return nil unless attributes.is_a?(Hash)
391
+ attributes = attributes.transform_keys(&:to_sym)
392
+ transformed_hash = {}
393
+ openapi_types.each_pair do |key, type|
394
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
395
+ transformed_hash["#{key}"] = nil
396
+ elsif type =~ /\AArray<(.*)>/i
397
+ # check to ensure the input is an array given that the attribute
398
+ # is documented as an array but the input is not
399
+ if attributes[attribute_map[key]].is_a?(Array)
400
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
401
+ end
402
+ elsif !attributes[attribute_map[key]].nil?
403
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
404
+ end
405
+ end
406
+ new(transformed_hash)
407
+ end
408
+
409
+ # Returns the object in the form of hash
410
+ # @return [Hash] Returns the object in the form of hash
411
+ def to_hash
412
+ hash = {}
413
+ self.class.attribute_map.each_pair do |attr, param|
414
+ value = self.send(attr)
415
+ if value.nil?
416
+ is_nullable = self.class.openapi_nullable.include?(attr)
417
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
418
+ end
419
+
420
+ hash[param] = _to_hash(value)
421
+ end
422
+ hash
423
+ end
424
+
425
+ end
426
+
427
+ end