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,243 @@
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 BuyProjectItem
17
+ # A unique identifier for your Line Item
18
+ attr_accessor :ext_line_item_id
19
+
20
+ # Survey Test URL. Required for survey verification
21
+ attr_accessor :survey_test_url
22
+
23
+ # SurveyTestURL Params of the line item.
24
+ attr_accessor :survey_test_url_params
25
+
26
+ # Survey URL to send panelist into
27
+ attr_accessor :survey_url
28
+
29
+ # SurveyURL Params of the line item.
30
+ attr_accessor :survey_url_params
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'ext_line_item_id' => :'extLineItemId',
36
+ :'survey_test_url' => :'surveyTestURL',
37
+ :'survey_test_url_params' => :'surveyTestURLParams',
38
+ :'survey_url' => :'surveyURL',
39
+ :'survey_url_params' => :'surveyURLParams'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'ext_line_item_id' => :'String',
47
+ :'survey_test_url' => :'String',
48
+ :'survey_test_url_params' => :'Array<URLParam>',
49
+ :'survey_url' => :'String',
50
+ :'survey_url_params' => :'Array<URLParam>'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
+
62
+ if attributes.has_key?(:'extLineItemId')
63
+ self.ext_line_item_id = attributes[:'extLineItemId']
64
+ end
65
+
66
+ if attributes.has_key?(:'surveyTestURL')
67
+ self.survey_test_url = attributes[:'surveyTestURL']
68
+ end
69
+
70
+ if attributes.has_key?(:'surveyTestURLParams')
71
+ if (value = attributes[:'surveyTestURLParams']).is_a?(Array)
72
+ self.survey_test_url_params = value
73
+ end
74
+ end
75
+
76
+ if attributes.has_key?(:'surveyURL')
77
+ self.survey_url = attributes[:'surveyURL']
78
+ end
79
+
80
+ if attributes.has_key?(:'surveyURLParams')
81
+ if (value = attributes[:'surveyURLParams']).is_a?(Array)
82
+ self.survey_url_params = value
83
+ end
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ if @ext_line_item_id.nil?
92
+ invalid_properties.push('invalid value for "ext_line_item_id", ext_line_item_id cannot be nil.')
93
+ end
94
+
95
+ if @survey_test_url.nil?
96
+ invalid_properties.push('invalid value for "survey_test_url", survey_test_url cannot be nil.')
97
+ end
98
+
99
+ if @survey_url.nil?
100
+ invalid_properties.push('invalid value for "survey_url", survey_url cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @ext_line_item_id.nil?
110
+ return false if @survey_test_url.nil?
111
+ return false if @survey_url.nil?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ ext_line_item_id == o.ext_line_item_id &&
121
+ survey_test_url == o.survey_test_url &&
122
+ survey_test_url_params == o.survey_test_url_params &&
123
+ survey_url == o.survey_url &&
124
+ survey_url_params == o.survey_url_params
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Fixnum] Hash code
135
+ def hash
136
+ [ext_line_item_id, survey_test_url, survey_test_url_params, survey_url, survey_url_params].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.swagger_types.each_pair do |key, type|
145
+ if type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :DateTime
166
+ DateTime.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :BOOLEAN
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ temp_model = SamplifyAPIClient.const_get(type).new
197
+ temp_model.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ next if value.nil?
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+ end
243
+ end
@@ -0,0 +1,194 @@
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 BuyProjectResponse
17
+ # A unique identifier for your Line Item
18
+ attr_accessor :ext_line_item_id
19
+
20
+ # The current state of the line item: PROVISIONED, AWAITING_APPROVAL, LAUNCHED, PAUSED, CLOSED, INVOICED
21
+ attr_accessor :state
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'ext_line_item_id' => :'extLineItemId',
27
+ :'state' => :'state'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'ext_line_item_id' => :'String',
35
+ :'state' => :'String'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'extLineItemId')
48
+ self.ext_line_item_id = attributes[:'extLineItemId']
49
+ end
50
+
51
+ if attributes.has_key?(:'state')
52
+ self.state = attributes[:'state']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ ext_line_item_id == o.ext_line_item_id &&
75
+ state == o.state
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] Object to be compared
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [ext_line_item_id, state].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ temp_model = SamplifyAPIClient.const_get(type).new
148
+ temp_model.build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ next if value.nil?
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map { |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+ end
194
+ end
@@ -0,0 +1,174 @@
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 BuyProjectsPayload
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+ end
37
+
38
+ # Show invalid properties with the reasons. Usually used together with valid?
39
+ # @return Array for valid properties with the reasons
40
+ def list_invalid_properties
41
+ invalid_properties = Array.new
42
+ invalid_properties
43
+ end
44
+
45
+ # Check to see if the all the properties in the model are valid
46
+ # @return true if the model is valid
47
+ def valid?
48
+ true
49
+ end
50
+
51
+ # Checks equality by comparing each attribute.
52
+ # @param [Object] Object to be compared
53
+ def ==(o)
54
+ return true if self.equal?(o)
55
+ self.class == o.class
56
+ end
57
+
58
+ # @see the `==` method
59
+ # @param [Object] Object to be compared
60
+ def eql?(o)
61
+ self == o
62
+ end
63
+
64
+ # Calculates hash code according to all attributes.
65
+ # @return [Fixnum] Hash code
66
+ def hash
67
+ [].hash
68
+ end
69
+
70
+ # Builds the object from hash
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ # @return [Object] Returns the model itself
73
+ def build_from_hash(attributes)
74
+ return nil unless attributes.is_a?(Hash)
75
+ self.class.swagger_types.each_pair do |key, type|
76
+ if type =~ /\AArray<(.*)>/i
77
+ # check to ensure the input is an array given that the the attribute
78
+ # is documented as an array but the input is not
79
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
80
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
81
+ end
82
+ elsif !attributes[self.class.attribute_map[key]].nil?
83
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
84
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
85
+ end
86
+
87
+ self
88
+ end
89
+
90
+ # Deserializes the data based on type
91
+ # @param string type Data type
92
+ # @param string value Value to be deserialized
93
+ # @return [Object] Deserialized data
94
+ def _deserialize(type, value)
95
+ case type.to_sym
96
+ when :DateTime
97
+ DateTime.parse(value)
98
+ when :Date
99
+ Date.parse(value)
100
+ when :String
101
+ value.to_s
102
+ when :Integer
103
+ value.to_i
104
+ when :Float
105
+ value.to_f
106
+ when :BOOLEAN
107
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
108
+ true
109
+ else
110
+ false
111
+ end
112
+ when :Object
113
+ # generic object (usually a Hash), return directly
114
+ value
115
+ when /\AArray<(?<inner_type>.+)>\z/
116
+ inner_type = Regexp.last_match[:inner_type]
117
+ value.map { |v| _deserialize(inner_type, v) }
118
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
119
+ k_type = Regexp.last_match[:k_type]
120
+ v_type = Regexp.last_match[:v_type]
121
+ {}.tap do |hash|
122
+ value.each do |k, v|
123
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
124
+ end
125
+ end
126
+ else # model
127
+ temp_model = SamplifyAPIClient.const_get(type).new
128
+ temp_model.build_from_hash(value)
129
+ end
130
+ end
131
+
132
+ # Returns the string representation of the object
133
+ # @return [String] String presentation of the object
134
+ def to_s
135
+ to_hash.to_s
136
+ end
137
+
138
+ # to_body is an alias to to_hash (backward compatibility)
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_body
141
+ to_hash
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = self.send(attr)
150
+ next if value.nil?
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ # Outputs non-array value in the form of hash
157
+ # For object, use to_hash. Otherwise, just return the value
158
+ # @param [Object] value Any valid value
159
+ # @return [Hash] Returns the value in the form of hash
160
+ def _to_hash(value)
161
+ if value.is_a?(Array)
162
+ value.compact.map { |v| _to_hash(v) }
163
+ elsif value.is_a?(Hash)
164
+ {}.tap do |hash|
165
+ value.each { |k, v| hash[k] = _to_hash(v) }
166
+ end
167
+ elsif value.respond_to? :to_hash
168
+ value.to_hash
169
+ else
170
+ value
171
+ end
172
+ end
173
+ end
174
+ end