samplify_api_client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +69 -0
  4. data/README.md +221 -0
  5. data/Rakefile +8 -0
  6. data/docs/AppError.md +10 -0
  7. data/docs/ApplicationItemData.md +11 -0
  8. data/docs/AttributeData.md +16 -0
  9. data/docs/AttributeOption.md +10 -0
  10. data/docs/Attributes.md +10 -0
  11. data/docs/AttributesApi.md +78 -0
  12. data/docs/AuthApi.md +191 -0
  13. data/docs/AuthError.md +9 -0
  14. data/docs/Author.md +10 -0
  15. data/docs/BuyProject.md +10 -0
  16. data/docs/BuyProjectItem.md +12 -0
  17. data/docs/BuyProjectResponse.md +9 -0
  18. data/docs/BuyProjectsPayload.md +7 -0
  19. data/docs/Categories.md +10 -0
  20. data/docs/CategoriesApi.md +72 -0
  21. data/docs/CategoryData.md +9 -0
  22. data/docs/CodePayload.md +11 -0
  23. data/docs/Countries.md +10 -0
  24. data/docs/CountriesApi.md +72 -0
  25. data/docs/CountryData.md +11 -0
  26. data/docs/CreateLineItem.md +10 -0
  27. data/docs/DefaultApi.md +88 -0
  28. data/docs/EndLinks.md +13 -0
  29. data/docs/ErrorType.md +9 -0
  30. data/docs/Event.md +10 -0
  31. data/docs/EventData.md +15 -0
  32. data/docs/EventListData.md +15 -0
  33. data/docs/Events.md +10 -0
  34. data/docs/EventsApi.md +287 -0
  35. data/docs/ExclusionData.md +9 -0
  36. data/docs/Feasibility.md +10 -0
  37. data/docs/FeasibilityApi.md +61 -0
  38. data/docs/FeasibilityData.md +14 -0
  39. data/docs/FeasibilityResponseData.md +9 -0
  40. data/docs/LineItemActionResponse.md +14 -0
  41. data/docs/LineItemData.md +22 -0
  42. data/docs/LineItemItemData.md +17 -0
  43. data/docs/LineItemReportData.md +25 -0
  44. data/docs/LineItemResponseData.md +27 -0
  45. data/docs/LineItems.md +10 -0
  46. data/docs/LineItemsApi.md +420 -0
  47. data/docs/Links.md +12 -0
  48. data/docs/LogoutPayload.md +10 -0
  49. data/docs/Meta.md +10 -0
  50. data/docs/Project.md +14 -0
  51. data/docs/ProjectAction.md +10 -0
  52. data/docs/ProjectActionResponse.md +13 -0
  53. data/docs/ProjectCategoryData.md +8 -0
  54. data/docs/ProjectItemData.md +14 -0
  55. data/docs/ProjectReport.md +10 -0
  56. data/docs/ProjectReportData.md +21 -0
  57. data/docs/ProjectReports.md +10 -0
  58. data/docs/ProjectResponse.md +10 -0
  59. data/docs/ProjectResponseData.md +19 -0
  60. data/docs/ProjectSurveyEndLinks.md +10 -0
  61. data/docs/ProjectSurveyEndLinksData.md +12 -0
  62. data/docs/Projects.md +10 -0
  63. data/docs/ProjectsApi.md +620 -0
  64. data/docs/QuotaCell.md +10 -0
  65. data/docs/QuotaCellFeasibility.md +9 -0
  66. data/docs/QuotaGroupData.md +9 -0
  67. data/docs/QuotaGroupFeasibility.md +8 -0
  68. data/docs/QuotaPlanData.md +9 -0
  69. data/docs/Reconcile.md +10 -0
  70. data/docs/ReconcileData.md +7 -0
  71. data/docs/RefreshTokenPayload.md +10 -0
  72. data/docs/Reprice.md +10 -0
  73. data/docs/RepriceData.md +22 -0
  74. data/docs/RepricePayload.md +20 -0
  75. data/docs/RespondentApi.md +86 -0
  76. data/docs/Status.md +9 -0
  77. data/docs/SupportedLanguage.md +10 -0
  78. data/docs/SurveyEndLinks.md +10 -0
  79. data/docs/SurveyTestId.md +10 -0
  80. data/docs/SurveyTestLink.md +9 -0
  81. data/docs/Target.md +11 -0
  82. data/docs/TargetingAttribute.md +10 -0
  83. data/docs/TokenMedia.md +11 -0
  84. data/docs/TokenPayload.md +11 -0
  85. data/docs/URLParam.md +9 -0
  86. data/docs/UpdateLineItem.md +21 -0
  87. data/docs/UpdateProjectData.md +13 -0
  88. data/docs/UpdateProjectLineItem.md +22 -0
  89. data/docs/UserInfo.md +10 -0
  90. data/docs/UserInfoResponseData.md +10 -0
  91. data/docs/UsersApi.md +68 -0
  92. data/examples/auth.rb +18 -0
  93. data/git_push.sh +55 -0
  94. data/lib/samplify_api_client/api/attributes_api.rb +111 -0
  95. data/lib/samplify_api_client/api/auth_api.rb +230 -0
  96. data/lib/samplify_api_client/api/categories_api.rb +99 -0
  97. data/lib/samplify_api_client/api/countries_api.rb +99 -0
  98. data/lib/samplify_api_client/api/default_api.rb +115 -0
  99. data/lib/samplify_api_client/api/events_api.rb +317 -0
  100. data/lib/samplify_api_client/api/feasibility_api.rb +75 -0
  101. data/lib/samplify_api_client/api/line_items_api.rb +468 -0
  102. data/lib/samplify_api_client/api/projects_api.rb +660 -0
  103. data/lib/samplify_api_client/api/respondent_api.rb +113 -0
  104. data/lib/samplify_api_client/api/users_api.rb +81 -0
  105. data/lib/samplify_api_client/api_client.rb +389 -0
  106. data/lib/samplify_api_client/api_error.rb +38 -0
  107. data/lib/samplify_api_client/configuration.rb +209 -0
  108. data/lib/samplify_api_client/models/app_error.rb +218 -0
  109. data/lib/samplify_api_client/models/application_item_data.rb +234 -0
  110. data/lib/samplify_api_client/models/attribute_data.rb +334 -0
  111. data/lib/samplify_api_client/models/attribute_option.rb +219 -0
  112. data/lib/samplify_api_client/models/attributes.rb +219 -0
  113. data/lib/samplify_api_client/models/auth_error.rb +205 -0
  114. data/lib/samplify_api_client/models/author.rb +253 -0
  115. data/lib/samplify_api_client/models/buy_project.rb +219 -0
  116. data/lib/samplify_api_client/models/buy_project_item.rb +243 -0
  117. data/lib/samplify_api_client/models/buy_project_response.rb +194 -0
  118. data/lib/samplify_api_client/models/buy_projects_payload.rb +174 -0
  119. data/lib/samplify_api_client/models/categories.rb +219 -0
  120. data/lib/samplify_api_client/models/category_data.rb +204 -0
  121. data/lib/samplify_api_client/models/code_payload.rb +229 -0
  122. data/lib/samplify_api_client/models/countries.rb +219 -0
  123. data/lib/samplify_api_client/models/country_data.rb +230 -0
  124. data/lib/samplify_api_client/models/create_line_item.rb +217 -0
  125. data/lib/samplify_api_client/models/end_links.rb +288 -0
  126. data/lib/samplify_api_client/models/error_type.rb +204 -0
  127. data/lib/samplify_api_client/models/event.rb +217 -0
  128. data/lib/samplify_api_client/models/event_data.rb +289 -0
  129. data/lib/samplify_api_client/models/event_list_data.rb +289 -0
  130. data/lib/samplify_api_client/models/events.rb +219 -0
  131. data/lib/samplify_api_client/models/exclusion_data.rb +206 -0
  132. data/lib/samplify_api_client/models/feasibility.rb +219 -0
  133. data/lib/samplify_api_client/models/feasibility_data.rb +255 -0
  134. data/lib/samplify_api_client/models/feasibility_response_data.rb +193 -0
  135. data/lib/samplify_api_client/models/line_item_action_response.rb +244 -0
  136. data/lib/samplify_api_client/models/line_item_data.rb +398 -0
  137. data/lib/samplify_api_client/models/line_item_item_data.rb +358 -0
  138. data/lib/samplify_api_client/models/line_item_report_data.rb +478 -0
  139. data/lib/samplify_api_client/models/line_item_response_data.rb +408 -0
  140. data/lib/samplify_api_client/models/line_items.rb +219 -0
  141. data/lib/samplify_api_client/models/links.rb +219 -0
  142. data/lib/samplify_api_client/models/logout_payload.rb +219 -0
  143. data/lib/samplify_api_client/models/meta.rb +203 -0
  144. data/lib/samplify_api_client/models/project.rb +273 -0
  145. data/lib/samplify_api_client/models/project_action.rb +217 -0
  146. data/lib/samplify_api_client/models/project_action_response.rb +236 -0
  147. data/lib/samplify_api_client/models/project_category_data.rb +191 -0
  148. data/lib/samplify_api_client/models/project_item_data.rb +307 -0
  149. data/lib/samplify_api_client/models/project_report.rb +217 -0
  150. data/lib/samplify_api_client/models/project_report_data.rb +414 -0
  151. data/lib/samplify_api_client/models/project_reports.rb +219 -0
  152. data/lib/samplify_api_client/models/project_response.rb +217 -0
  153. data/lib/samplify_api_client/models/project_response_data.rb +347 -0
  154. data/lib/samplify_api_client/models/project_survey_end_links.rb +217 -0
  155. data/lib/samplify_api_client/models/project_survey_end_links_data.rb +272 -0
  156. data/lib/samplify_api_client/models/projects.rb +219 -0
  157. data/lib/samplify_api_client/models/quota_cell.rb +206 -0
  158. data/lib/samplify_api_client/models/quota_cell_feasibility.rb +204 -0
  159. data/lib/samplify_api_client/models/quota_group_data.rb +201 -0
  160. data/lib/samplify_api_client/models/quota_group_feasibility.rb +185 -0
  161. data/lib/samplify_api_client/models/quota_plan_data.rb +198 -0
  162. data/lib/samplify_api_client/models/reconcile.rb +217 -0
  163. data/lib/samplify_api_client/models/reconcile_data.rb +174 -0
  164. data/lib/samplify_api_client/models/refresh_token_payload.rb +214 -0
  165. data/lib/samplify_api_client/models/reprice.rb +217 -0
  166. data/lib/samplify_api_client/models/reprice_data.rb +399 -0
  167. data/lib/samplify_api_client/models/reprice_payload.rb +369 -0
  168. data/lib/samplify_api_client/models/status.rb +206 -0
  169. data/lib/samplify_api_client/models/supported_language.rb +219 -0
  170. data/lib/samplify_api_client/models/survey_end_links.rb +216 -0
  171. data/lib/samplify_api_client/models/survey_test_id.rb +219 -0
  172. data/lib/samplify_api_client/models/survey_test_link.rb +206 -0
  173. data/lib/samplify_api_client/models/target.rb +258 -0
  174. data/lib/samplify_api_client/models/targeting_attribute.rb +216 -0
  175. data/lib/samplify_api_client/models/token_media.rb +235 -0
  176. data/lib/samplify_api_client/models/token_payload.rb +229 -0
  177. data/lib/samplify_api_client/models/update_line_item.rb +353 -0
  178. data/lib/samplify_api_client/models/update_project_data.rb +238 -0
  179. data/lib/samplify_api_client/models/update_project_line_item.rb +368 -0
  180. data/lib/samplify_api_client/models/url_param.rb +204 -0
  181. data/lib/samplify_api_client/models/user_info.rb +217 -0
  182. data/lib/samplify_api_client/models/user_info_response_data.rb +221 -0
  183. data/lib/samplify_api_client/version.rb +15 -0
  184. data/lib/samplify_api_client.rb +125 -0
  185. data/samplify_api_client.gemspec +45 -0
  186. data/spec/api/attributes_api_spec.rb +53 -0
  187. data/spec/api/auth_api_spec.rb +79 -0
  188. data/spec/api/categories_api_spec.rb +51 -0
  189. data/spec/api/countries_api_spec.rb +51 -0
  190. data/spec/api/default_api_spec.rb +55 -0
  191. data/spec/api/events_api_spec.rb +100 -0
  192. data/spec/api/feasibility_api_spec.rb +46 -0
  193. data/spec/api/line_items_api_spec.rb +128 -0
  194. data/spec/api/projects_api_spec.rb +168 -0
  195. data/spec/api/respondent_api_spec.rb +55 -0
  196. data/spec/api/users_api_spec.rb +49 -0
  197. data/spec/api_client_spec.rb +226 -0
  198. data/spec/configuration_spec.rb +42 -0
  199. data/spec/models/app_error_spec.rb +53 -0
  200. data/spec/models/application_item_data_spec.rb +59 -0
  201. data/spec/models/attribute_data_spec.rb +93 -0
  202. data/spec/models/attribute_option_spec.rb +53 -0
  203. data/spec/models/attributes_spec.rb +53 -0
  204. data/spec/models/auth_error_spec.rb +47 -0
  205. data/spec/models/author_spec.rb +57 -0
  206. data/spec/models/buy_project_item_spec.rb +65 -0
  207. data/spec/models/buy_project_response_spec.rb +47 -0
  208. data/spec/models/buy_project_spec.rb +53 -0
  209. data/spec/models/buy_projects_payload_spec.rb +35 -0
  210. data/spec/models/categories_spec.rb +53 -0
  211. data/spec/models/category_data_spec.rb +47 -0
  212. data/spec/models/code_payload_spec.rb +59 -0
  213. data/spec/models/countries_spec.rb +53 -0
  214. data/spec/models/country_data_spec.rb +59 -0
  215. data/spec/models/create_line_item_spec.rb +53 -0
  216. data/spec/models/end_links_spec.rb +75 -0
  217. data/spec/models/error_type_spec.rb +47 -0
  218. data/spec/models/event_data_spec.rb +83 -0
  219. data/spec/models/event_list_data_spec.rb +83 -0
  220. data/spec/models/event_spec.rb +53 -0
  221. data/spec/models/events_spec.rb +53 -0
  222. data/spec/models/exclusion_data_spec.rb +47 -0
  223. data/spec/models/feasibility_data_spec.rb +77 -0
  224. data/spec/models/feasibility_response_data_spec.rb +47 -0
  225. data/spec/models/feasibility_spec.rb +53 -0
  226. data/spec/models/line_item_action_response_spec.rb +77 -0
  227. data/spec/models/line_item_data_spec.rb +129 -0
  228. data/spec/models/line_item_item_data_spec.rb +99 -0
  229. data/spec/models/line_item_report_data_spec.rb +147 -0
  230. data/spec/models/line_item_response_data_spec.rb +159 -0
  231. data/spec/models/line_items_spec.rb +53 -0
  232. data/spec/models/links_spec.rb +65 -0
  233. data/spec/models/logout_payload_spec.rb +53 -0
  234. data/spec/models/meta_spec.rb +53 -0
  235. data/spec/models/project_action_response_spec.rb +71 -0
  236. data/spec/models/project_action_spec.rb +53 -0
  237. data/spec/models/project_category_data_spec.rb +41 -0
  238. data/spec/models/project_item_data_spec.rb +81 -0
  239. data/spec/models/project_report_data_spec.rb +123 -0
  240. data/spec/models/project_report_spec.rb +53 -0
  241. data/spec/models/project_reports_spec.rb +53 -0
  242. data/spec/models/project_response_data_spec.rb +107 -0
  243. data/spec/models/project_response_spec.rb +53 -0
  244. data/spec/models/project_spec.rb +77 -0
  245. data/spec/models/project_survey_end_links_data_spec.rb +69 -0
  246. data/spec/models/project_survey_end_links_spec.rb +53 -0
  247. data/spec/models/projects_spec.rb +53 -0
  248. data/spec/models/quota_cell_feasibility_spec.rb +47 -0
  249. data/spec/models/quota_cell_spec.rb +53 -0
  250. data/spec/models/quota_group_data_spec.rb +47 -0
  251. data/spec/models/quota_group_feasibility_spec.rb +41 -0
  252. data/spec/models/quota_plan_data_spec.rb +47 -0
  253. data/spec/models/reconcile_data_spec.rb +35 -0
  254. data/spec/models/reconcile_spec.rb +53 -0
  255. data/spec/models/refresh_token_payload_spec.rb +53 -0
  256. data/spec/models/reprice_data_spec.rb +125 -0
  257. data/spec/models/reprice_payload_spec.rb +113 -0
  258. data/spec/models/reprice_spec.rb +53 -0
  259. data/spec/models/status_spec.rb +47 -0
  260. data/spec/models/supported_language_spec.rb +53 -0
  261. data/spec/models/survey_end_links_spec.rb +53 -0
  262. data/spec/models/survey_test_id_spec.rb +53 -0
  263. data/spec/models/survey_test_link_spec.rb +47 -0
  264. data/spec/models/target_spec.rb +63 -0
  265. data/spec/models/targeting_attribute_spec.rb +53 -0
  266. data/spec/models/token_media_spec.rb +59 -0
  267. data/spec/models/token_payload_spec.rb +59 -0
  268. data/spec/models/update_line_item_spec.rb +123 -0
  269. data/spec/models/update_project_data_spec.rb +71 -0
  270. data/spec/models/update_project_line_item_spec.rb +129 -0
  271. data/spec/models/url_param_spec.rb +47 -0
  272. data/spec/models/user_info_response_data_spec.rb +53 -0
  273. data/spec/models/user_info_spec.rb +53 -0
  274. data/spec/spec_helper.rb +111 -0
  275. metadata +585 -0
@@ -0,0 +1,193 @@
1
+ =begin
2
+ #Samplify API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SamplifyAPIClient
16
+ class FeasibilityResponseData
17
+ # A unique identifier for your Line Item
18
+ attr_accessor :ext_line_item_id
19
+
20
+ attr_accessor :feasibility
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'ext_line_item_id' => :'extLineItemId',
26
+ :'feasibility' => :'feasibility'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'ext_line_item_id' => :'String',
34
+ :'feasibility' => :'FeasibilityData'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'extLineItemId')
47
+ self.ext_line_item_id = attributes[:'extLineItemId']
48
+ end
49
+
50
+ if attributes.has_key?(:'feasibility')
51
+ self.feasibility = attributes[:'feasibility']
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ ext_line_item_id == o.ext_line_item_id &&
74
+ feasibility == o.feasibility
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Fixnum] Hash code
85
+ def hash
86
+ [ext_line_item_id, feasibility].hash
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def build_from_hash(attributes)
93
+ return nil unless attributes.is_a?(Hash)
94
+ self.class.swagger_types.each_pair do |key, type|
95
+ if type =~ /\AArray<(.*)>/i
96
+ # check to ensure the input is an array given that the the attribute
97
+ # is documented as an array but the input is not
98
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
99
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
104
+ end
105
+
106
+ self
107
+ end
108
+
109
+ # Deserializes the data based on type
110
+ # @param string type Data type
111
+ # @param string value Value to be deserialized
112
+ # @return [Object] Deserialized data
113
+ def _deserialize(type, value)
114
+ case type.to_sym
115
+ when :DateTime
116
+ DateTime.parse(value)
117
+ when :Date
118
+ Date.parse(value)
119
+ when :String
120
+ value.to_s
121
+ when :Integer
122
+ value.to_i
123
+ when :Float
124
+ value.to_f
125
+ when :BOOLEAN
126
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
+ true
128
+ else
129
+ false
130
+ end
131
+ when :Object
132
+ # generic object (usually a Hash), return directly
133
+ value
134
+ when /\AArray<(?<inner_type>.+)>\z/
135
+ inner_type = Regexp.last_match[:inner_type]
136
+ value.map { |v| _deserialize(inner_type, v) }
137
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
138
+ k_type = Regexp.last_match[:k_type]
139
+ v_type = Regexp.last_match[:v_type]
140
+ {}.tap do |hash|
141
+ value.each do |k, v|
142
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
143
+ end
144
+ end
145
+ else # model
146
+ temp_model = SamplifyAPIClient.const_get(type).new
147
+ temp_model.build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ next if value.nil?
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+ end
193
+ end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Samplify API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SamplifyAPIClient
16
+ class LineItemActionResponse
17
+ # Timestamp of when the line item was created
18
+ attr_accessor :created_at
19
+
20
+ # Unique line item Id
21
+ attr_accessor :ext_line_item_id
22
+
23
+ # Timestamp of when the line item launched on RN SSI panelists
24
+ attr_accessor :launched_at
25
+
26
+ # Unique line item Id
27
+ attr_accessor :state
28
+
29
+ # Timestamp of when the line item last changed its state
30
+ attr_accessor :state_last_updated_at
31
+
32
+ # Reason for the current state of the line item
33
+ attr_accessor :state_reason
34
+
35
+ # Timestamp of when the line item was updated
36
+ attr_accessor :updated_at
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'created_at' => :'createdAt',
42
+ :'ext_line_item_id' => :'extLineItemId',
43
+ :'launched_at' => :'launchedAt',
44
+ :'state' => :'state',
45
+ :'state_last_updated_at' => :'stateLastUpdatedAt',
46
+ :'state_reason' => :'stateReason',
47
+ :'updated_at' => :'updatedAt'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.swagger_types
53
+ {
54
+ :'created_at' => :'String',
55
+ :'ext_line_item_id' => :'String',
56
+ :'launched_at' => :'String',
57
+ :'state' => :'String',
58
+ :'state_last_updated_at' => :'String',
59
+ :'state_reason' => :'String',
60
+ :'updated_at' => :'String'
61
+ }
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ return unless attributes.is_a?(Hash)
68
+
69
+ # convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
71
+
72
+ if attributes.has_key?(:'createdAt')
73
+ self.created_at = attributes[:'createdAt']
74
+ end
75
+
76
+ if attributes.has_key?(:'extLineItemId')
77
+ self.ext_line_item_id = attributes[:'extLineItemId']
78
+ end
79
+
80
+ if attributes.has_key?(:'launchedAt')
81
+ self.launched_at = attributes[:'launchedAt']
82
+ end
83
+
84
+ if attributes.has_key?(:'state')
85
+ self.state = attributes[:'state']
86
+ end
87
+
88
+ if attributes.has_key?(:'stateLastUpdatedAt')
89
+ self.state_last_updated_at = attributes[:'stateLastUpdatedAt']
90
+ end
91
+
92
+ if attributes.has_key?(:'stateReason')
93
+ self.state_reason = attributes[:'stateReason']
94
+ end
95
+
96
+ if attributes.has_key?(:'updatedAt')
97
+ self.updated_at = attributes[:'updatedAt']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ created_at == o.created_at &&
120
+ ext_line_item_id == o.ext_line_item_id &&
121
+ launched_at == o.launched_at &&
122
+ state == o.state &&
123
+ state_last_updated_at == o.state_last_updated_at &&
124
+ state_reason == o.state_reason &&
125
+ updated_at == o.updated_at
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Fixnum] Hash code
136
+ def hash
137
+ [created_at, ext_line_item_id, launched_at, state, state_last_updated_at, state_reason, updated_at].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.swagger_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :BOOLEAN
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ temp_model = SamplifyAPIClient.const_get(type).new
198
+ temp_model.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ next if value.nil?
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+ end
244
+ end
@@ -0,0 +1,398 @@
1
+ =begin
2
+ #Samplify API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SamplifyAPIClient
16
+ class LineItemData
17
+ # ISO country code
18
+ attr_accessor :country_iso_code
19
+
20
+ # Duration of the project in days.
21
+ attr_accessor :days_in_field
22
+
23
+ # Delivery type: SLOW, BALANCED,FAST or BURST.
24
+ attr_accessor :delivery_type
25
+
26
+ # Unique line item Id
27
+ attr_accessor :ext_line_item_id
28
+
29
+ # Expected incidence of the survey
30
+ attr_accessor :indicative_incidence
31
+
32
+ # ISO language code
33
+ attr_accessor :language_iso_code
34
+
35
+ # expected duration of the survey in minutes
36
+ attr_accessor :length_of_interview
37
+
38
+ attr_accessor :quota_plan
39
+
40
+ # Number of complete required for the line item
41
+ attr_accessor :required_completes
42
+
43
+ # Entry link for the user.
44
+ attr_accessor :survey_test_url
45
+
46
+ # SurveyTestURL Params of the line item.
47
+ attr_accessor :survey_test_url_params
48
+
49
+ # Entry link for the user.
50
+ attr_accessor :survey_url
51
+
52
+ # SurveyURL Params of the line item.
53
+ attr_accessor :survey_url_params
54
+
55
+ # Data of completes/starts required for the line item
56
+ attr_accessor :targets
57
+
58
+ # A title for the line item
59
+ attr_accessor :title
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'country_iso_code' => :'countryISOCode',
87
+ :'days_in_field' => :'daysInField',
88
+ :'delivery_type' => :'deliveryType',
89
+ :'ext_line_item_id' => :'extLineItemId',
90
+ :'indicative_incidence' => :'indicativeIncidence',
91
+ :'language_iso_code' => :'languageISOCode',
92
+ :'length_of_interview' => :'lengthOfInterview',
93
+ :'quota_plan' => :'quotaPlan',
94
+ :'required_completes' => :'requiredCompletes',
95
+ :'survey_test_url' => :'surveyTestURL',
96
+ :'survey_test_url_params' => :'surveyTestURLParams',
97
+ :'survey_url' => :'surveyURL',
98
+ :'survey_url_params' => :'surveyURLParams',
99
+ :'targets' => :'targets',
100
+ :'title' => :'title'
101
+ }
102
+ end
103
+
104
+ # Attribute type mapping.
105
+ def self.swagger_types
106
+ {
107
+ :'country_iso_code' => :'String',
108
+ :'days_in_field' => :'Integer',
109
+ :'delivery_type' => :'String',
110
+ :'ext_line_item_id' => :'String',
111
+ :'indicative_incidence' => :'Float',
112
+ :'language_iso_code' => :'String',
113
+ :'length_of_interview' => :'Integer',
114
+ :'quota_plan' => :'QuotaPlanData',
115
+ :'required_completes' => :'Integer',
116
+ :'survey_test_url' => :'String',
117
+ :'survey_test_url_params' => :'Array<URLParam>',
118
+ :'survey_url' => :'String',
119
+ :'survey_url_params' => :'Array<URLParam>',
120
+ :'targets' => :'Array<Target>',
121
+ :'title' => :'String'
122
+ }
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ return unless attributes.is_a?(Hash)
129
+
130
+ # convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
132
+
133
+ if attributes.has_key?(:'countryISOCode')
134
+ self.country_iso_code = attributes[:'countryISOCode']
135
+ end
136
+
137
+ if attributes.has_key?(:'daysInField')
138
+ self.days_in_field = attributes[:'daysInField']
139
+ end
140
+
141
+ if attributes.has_key?(:'deliveryType')
142
+ self.delivery_type = attributes[:'deliveryType']
143
+ end
144
+
145
+ if attributes.has_key?(:'extLineItemId')
146
+ self.ext_line_item_id = attributes[:'extLineItemId']
147
+ end
148
+
149
+ if attributes.has_key?(:'indicativeIncidence')
150
+ self.indicative_incidence = attributes[:'indicativeIncidence']
151
+ end
152
+
153
+ if attributes.has_key?(:'languageISOCode')
154
+ self.language_iso_code = attributes[:'languageISOCode']
155
+ end
156
+
157
+ if attributes.has_key?(:'lengthOfInterview')
158
+ self.length_of_interview = attributes[:'lengthOfInterview']
159
+ end
160
+
161
+ if attributes.has_key?(:'quotaPlan')
162
+ self.quota_plan = attributes[:'quotaPlan']
163
+ end
164
+
165
+ if attributes.has_key?(:'requiredCompletes')
166
+ self.required_completes = attributes[:'requiredCompletes']
167
+ end
168
+
169
+ if attributes.has_key?(:'surveyTestURL')
170
+ self.survey_test_url = attributes[:'surveyTestURL']
171
+ end
172
+
173
+ if attributes.has_key?(:'surveyTestURLParams')
174
+ if (value = attributes[:'surveyTestURLParams']).is_a?(Array)
175
+ self.survey_test_url_params = value
176
+ end
177
+ end
178
+
179
+ if attributes.has_key?(:'surveyURL')
180
+ self.survey_url = attributes[:'surveyURL']
181
+ end
182
+
183
+ if attributes.has_key?(:'surveyURLParams')
184
+ if (value = attributes[:'surveyURLParams']).is_a?(Array)
185
+ self.survey_url_params = value
186
+ end
187
+ end
188
+
189
+ if attributes.has_key?(:'targets')
190
+ if (value = attributes[:'targets']).is_a?(Array)
191
+ self.targets = value
192
+ end
193
+ end
194
+
195
+ if attributes.has_key?(:'title')
196
+ self.title = attributes[:'title']
197
+ end
198
+ end
199
+
200
+ # Show invalid properties with the reasons. Usually used together with valid?
201
+ # @return Array for valid properties with the reasons
202
+ def list_invalid_properties
203
+ invalid_properties = Array.new
204
+ if @country_iso_code.nil?
205
+ invalid_properties.push('invalid value for "country_iso_code", country_iso_code cannot be nil.')
206
+ end
207
+
208
+ if @days_in_field.nil?
209
+ invalid_properties.push('invalid value for "days_in_field", days_in_field cannot be nil.')
210
+ end
211
+
212
+ if @ext_line_item_id.nil?
213
+ invalid_properties.push('invalid value for "ext_line_item_id", ext_line_item_id cannot be nil.')
214
+ end
215
+
216
+ if @indicative_incidence.nil?
217
+ invalid_properties.push('invalid value for "indicative_incidence", indicative_incidence cannot be nil.')
218
+ end
219
+
220
+ if @language_iso_code.nil?
221
+ invalid_properties.push('invalid value for "language_iso_code", language_iso_code cannot be nil.')
222
+ end
223
+
224
+ if @length_of_interview.nil?
225
+ invalid_properties.push('invalid value for "length_of_interview", length_of_interview cannot be nil.')
226
+ end
227
+
228
+ if @title.nil?
229
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
230
+ end
231
+
232
+ invalid_properties
233
+ end
234
+
235
+ # Check to see if the all the properties in the model are valid
236
+ # @return true if the model is valid
237
+ def valid?
238
+ return false if @country_iso_code.nil?
239
+ return false if @days_in_field.nil?
240
+ delivery_type_validator = EnumAttributeValidator.new('String', ['SLOW', 'BALANCED', 'FAST', 'BURST'])
241
+ return false unless delivery_type_validator.valid?(@delivery_type)
242
+ return false if @ext_line_item_id.nil?
243
+ return false if @indicative_incidence.nil?
244
+ return false if @language_iso_code.nil?
245
+ return false if @length_of_interview.nil?
246
+ return false if @title.nil?
247
+ true
248
+ end
249
+
250
+ # Custom attribute writer method checking allowed values (enum).
251
+ # @param [Object] delivery_type Object to be assigned
252
+ def delivery_type=(delivery_type)
253
+ validator = EnumAttributeValidator.new('String', ['SLOW', 'BALANCED', 'FAST', 'BURST'])
254
+ unless validator.valid?(delivery_type)
255
+ fail ArgumentError, 'invalid value for "delivery_type", must be one of #{validator.allowable_values}.'
256
+ end
257
+ @delivery_type = delivery_type
258
+ end
259
+
260
+ # Checks equality by comparing each attribute.
261
+ # @param [Object] Object to be compared
262
+ def ==(o)
263
+ return true if self.equal?(o)
264
+ self.class == o.class &&
265
+ country_iso_code == o.country_iso_code &&
266
+ days_in_field == o.days_in_field &&
267
+ delivery_type == o.delivery_type &&
268
+ ext_line_item_id == o.ext_line_item_id &&
269
+ indicative_incidence == o.indicative_incidence &&
270
+ language_iso_code == o.language_iso_code &&
271
+ length_of_interview == o.length_of_interview &&
272
+ quota_plan == o.quota_plan &&
273
+ required_completes == o.required_completes &&
274
+ survey_test_url == o.survey_test_url &&
275
+ survey_test_url_params == o.survey_test_url_params &&
276
+ survey_url == o.survey_url &&
277
+ survey_url_params == o.survey_url_params &&
278
+ targets == o.targets &&
279
+ title == o.title
280
+ end
281
+
282
+ # @see the `==` method
283
+ # @param [Object] Object to be compared
284
+ def eql?(o)
285
+ self == o
286
+ end
287
+
288
+ # Calculates hash code according to all attributes.
289
+ # @return [Fixnum] Hash code
290
+ def hash
291
+ [country_iso_code, days_in_field, delivery_type, ext_line_item_id, indicative_incidence, language_iso_code, length_of_interview, quota_plan, required_completes, survey_test_url, survey_test_url_params, survey_url, survey_url_params, targets, title].hash
292
+ end
293
+
294
+ # Builds the object from hash
295
+ # @param [Hash] attributes Model attributes in the form of hash
296
+ # @return [Object] Returns the model itself
297
+ def build_from_hash(attributes)
298
+ return nil unless attributes.is_a?(Hash)
299
+ self.class.swagger_types.each_pair do |key, type|
300
+ if type =~ /\AArray<(.*)>/i
301
+ # check to ensure the input is an array given that the the attribute
302
+ # is documented as an array but the input is not
303
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
304
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
305
+ end
306
+ elsif !attributes[self.class.attribute_map[key]].nil?
307
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
308
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
309
+ end
310
+
311
+ self
312
+ end
313
+
314
+ # Deserializes the data based on type
315
+ # @param string type Data type
316
+ # @param string value Value to be deserialized
317
+ # @return [Object] Deserialized data
318
+ def _deserialize(type, value)
319
+ case type.to_sym
320
+ when :DateTime
321
+ DateTime.parse(value)
322
+ when :Date
323
+ Date.parse(value)
324
+ when :String
325
+ value.to_s
326
+ when :Integer
327
+ value.to_i
328
+ when :Float
329
+ value.to_f
330
+ when :BOOLEAN
331
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
332
+ true
333
+ else
334
+ false
335
+ end
336
+ when :Object
337
+ # generic object (usually a Hash), return directly
338
+ value
339
+ when /\AArray<(?<inner_type>.+)>\z/
340
+ inner_type = Regexp.last_match[:inner_type]
341
+ value.map { |v| _deserialize(inner_type, v) }
342
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
343
+ k_type = Regexp.last_match[:k_type]
344
+ v_type = Regexp.last_match[:v_type]
345
+ {}.tap do |hash|
346
+ value.each do |k, v|
347
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
348
+ end
349
+ end
350
+ else # model
351
+ temp_model = SamplifyAPIClient.const_get(type).new
352
+ temp_model.build_from_hash(value)
353
+ end
354
+ end
355
+
356
+ # Returns the string representation of the object
357
+ # @return [String] String presentation of the object
358
+ def to_s
359
+ to_hash.to_s
360
+ end
361
+
362
+ # to_body is an alias to to_hash (backward compatibility)
363
+ # @return [Hash] Returns the object in the form of hash
364
+ def to_body
365
+ to_hash
366
+ end
367
+
368
+ # Returns the object in the form of hash
369
+ # @return [Hash] Returns the object in the form of hash
370
+ def to_hash
371
+ hash = {}
372
+ self.class.attribute_map.each_pair do |attr, param|
373
+ value = self.send(attr)
374
+ next if value.nil?
375
+ hash[param] = _to_hash(value)
376
+ end
377
+ hash
378
+ end
379
+
380
+ # Outputs non-array value in the form of hash
381
+ # For object, use to_hash. Otherwise, just return the value
382
+ # @param [Object] value Any valid value
383
+ # @return [Hash] Returns the value in the form of hash
384
+ def _to_hash(value)
385
+ if value.is_a?(Array)
386
+ value.compact.map { |v| _to_hash(v) }
387
+ elsif value.is_a?(Hash)
388
+ {}.tap do |hash|
389
+ value.each { |k, v| hash[k] = _to_hash(v) }
390
+ end
391
+ elsif value.respond_to? :to_hash
392
+ value.to_hash
393
+ else
394
+ value
395
+ end
396
+ end
397
+ end
398
+ end