order_cloud 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +39 -14
  4. data/Rakefile +1 -1
  5. data/docs/AdminUserGroupApi.md +482 -0
  6. data/docs/CategoryApi.md +4 -3
  7. data/docs/ListMessageCCListenerAssignment.md +9 -0
  8. data/docs/{ListApiClient.md → ListMessageConfig.md} +2 -2
  9. data/docs/{ListDevAccessibleCompany.md → ListMessageSender.md} +2 -2
  10. data/docs/ListMessageSenderAssignment.md +9 -0
  11. data/docs/MessageCCListenerAssignment.md +13 -0
  12. data/docs/MessageConfig.md +11 -0
  13. data/docs/MessageSender.md +10 -0
  14. data/docs/MessageSenderAssignment.md +12 -0
  15. data/docs/MessageSendersApi.md +398 -0
  16. data/docs/Product.md +4 -0
  17. data/docs/ProductApi.md +4 -3
  18. data/docs/ProductAssignment.md +2 -2
  19. data/docs/SecurityProfileApi.md +5 -5
  20. data/docs/User.md +1 -0
  21. data/docs/UserApi.md +4 -3
  22. data/docs/UserGroupApi.md +4 -3
  23. data/git_push.sh +0 -0
  24. data/lib/order_cloud.rb +11 -4
  25. data/lib/order_cloud/api/address_api.rb +1 -1
  26. data/lib/order_cloud/api/admin_address_api.rb +1 -1
  27. data/lib/order_cloud/api/admin_user_api.rb +1 -1
  28. data/lib/order_cloud/api/admin_user_group_api.rb +578 -0
  29. data/lib/order_cloud/api/approval_rule_api.rb +1 -1
  30. data/lib/order_cloud/api/buyer_api.rb +1 -1
  31. data/lib/order_cloud/api/category_api.rb +7 -6
  32. data/lib/order_cloud/api/cost_center_api.rb +1 -1
  33. data/lib/order_cloud/api/credit_card_api.rb +1 -1
  34. data/lib/order_cloud/api/email_template_api.rb +1 -1
  35. data/lib/order_cloud/api/line_item_api.rb +1 -1
  36. data/lib/order_cloud/api/me_api.rb +1 -1
  37. data/lib/order_cloud/api/message_senders_api.rb +484 -0
  38. data/lib/order_cloud/api/order_api.rb +1 -1
  39. data/lib/order_cloud/api/password_reset_api.rb +1 -1
  40. data/lib/order_cloud/api/payment_api.rb +1 -1
  41. data/lib/order_cloud/api/price_schedule_api.rb +1 -1
  42. data/lib/order_cloud/api/product_api.rb +7 -6
  43. data/lib/order_cloud/api/promotion_api.rb +1 -1
  44. data/lib/order_cloud/api/security_profile_api.rb +6 -6
  45. data/lib/order_cloud/api/shipment_api.rb +1 -1
  46. data/lib/order_cloud/api/spec_api.rb +1 -1
  47. data/lib/order_cloud/api/spending_account_api.rb +1 -1
  48. data/lib/order_cloud/api/user_api.rb +7 -6
  49. data/lib/order_cloud/api/user_group_api.rb +7 -6
  50. data/lib/order_cloud/api_auth.rb +1 -1
  51. data/lib/order_cloud/api_client.rb +1 -1
  52. data/lib/order_cloud/api_error.rb +1 -1
  53. data/lib/order_cloud/configuration.rb +1 -1
  54. data/lib/order_cloud/models/access_token.rb +1 -1
  55. data/lib/order_cloud/models/address.rb +1 -1
  56. data/lib/order_cloud/models/address_assignment.rb +1 -1
  57. data/lib/order_cloud/models/admin_company.rb +1 -1
  58. data/lib/order_cloud/models/admin_model_on_view.rb +1 -1
  59. data/lib/order_cloud/models/approval_rule.rb +1 -1
  60. data/lib/order_cloud/models/base_spec.rb +1 -1
  61. data/lib/order_cloud/models/buyer.rb +1 -1
  62. data/lib/order_cloud/models/buyer_address.rb +1 -1
  63. data/lib/order_cloud/models/buyer_credit_card.rb +1 -1
  64. data/lib/order_cloud/models/buyer_product.rb +1 -1
  65. data/lib/order_cloud/models/buyer_spec.rb +1 -1
  66. data/lib/order_cloud/models/category.rb +1 -1
  67. data/lib/order_cloud/models/category_assignment.rb +1 -1
  68. data/lib/order_cloud/models/category_product_assignment.rb +1 -1
  69. data/lib/order_cloud/models/cost_center.rb +1 -1
  70. data/lib/order_cloud/models/cost_center_assignment.rb +1 -1
  71. data/lib/order_cloud/models/credit_card.rb +1 -1
  72. data/lib/order_cloud/models/credit_card_assignment.rb +1 -1
  73. data/lib/order_cloud/models/email_template.rb +1 -1
  74. data/lib/order_cloud/models/file.rb +1 -1
  75. data/lib/order_cloud/models/impersonate_token_request.rb +1 -1
  76. data/lib/order_cloud/models/inventory.rb +1 -1
  77. data/lib/order_cloud/models/line_item.rb +1 -1
  78. data/lib/order_cloud/models/line_item_spec.rb +1 -1
  79. data/lib/order_cloud/models/list_address.rb +1 -1
  80. data/lib/order_cloud/models/list_address_assignment.rb +1 -1
  81. data/lib/order_cloud/models/list_admin_company.rb +1 -1
  82. data/lib/order_cloud/models/list_approval_rule.rb +1 -1
  83. data/lib/order_cloud/models/list_buyer.rb +1 -1
  84. data/lib/order_cloud/models/list_buyer_address.rb +1 -1
  85. data/lib/order_cloud/models/list_buyer_credit_card.rb +1 -1
  86. data/lib/order_cloud/models/list_buyer_product.rb +1 -1
  87. data/lib/order_cloud/models/list_buyer_spec.rb +1 -1
  88. data/lib/order_cloud/models/list_category.rb +1 -1
  89. data/lib/order_cloud/models/list_category_assignment.rb +1 -1
  90. data/lib/order_cloud/models/list_category_product_assignment.rb +1 -1
  91. data/lib/order_cloud/models/list_cost_center.rb +1 -1
  92. data/lib/order_cloud/models/list_cost_center_assignment.rb +1 -1
  93. data/lib/order_cloud/models/list_credit_card.rb +1 -1
  94. data/lib/order_cloud/models/list_credit_card_assignment.rb +1 -1
  95. data/lib/order_cloud/models/list_file.rb +1 -1
  96. data/lib/order_cloud/models/list_inventory.rb +1 -1
  97. data/lib/order_cloud/models/list_line_item.rb +1 -1
  98. data/lib/order_cloud/models/list_message_cc_listener_assignment.rb +210 -0
  99. data/lib/order_cloud/models/{list_api_client.rb → list_message_config.rb} +3 -3
  100. data/lib/order_cloud/models/{list_dev_accessible_company.rb → list_message_sender.rb} +3 -3
  101. data/lib/order_cloud/models/list_message_sender_assignment.rb +210 -0
  102. data/lib/order_cloud/models/list_order.rb +1 -1
  103. data/lib/order_cloud/models/list_order_approval.rb +1 -1
  104. data/lib/order_cloud/models/list_order_promotion.rb +1 -1
  105. data/lib/order_cloud/models/list_payment.rb +1 -1
  106. data/lib/order_cloud/models/list_price_schedule.rb +1 -1
  107. data/lib/order_cloud/models/list_product.rb +1 -1
  108. data/lib/order_cloud/models/list_product_assignment.rb +1 -1
  109. data/lib/order_cloud/models/list_promotion.rb +1 -1
  110. data/lib/order_cloud/models/list_promotion_assignment.rb +1 -1
  111. data/lib/order_cloud/models/list_security_profile.rb +1 -1
  112. data/lib/order_cloud/models/list_security_profile_assignment.rb +1 -1
  113. data/lib/order_cloud/models/list_shipment.rb +1 -1
  114. data/lib/order_cloud/models/list_spec.rb +1 -1
  115. data/lib/order_cloud/models/list_spec_option.rb +1 -1
  116. data/lib/order_cloud/models/list_spec_product_assignment.rb +1 -1
  117. data/lib/order_cloud/models/list_spending_account.rb +1 -1
  118. data/lib/order_cloud/models/list_spending_account_assignment.rb +1 -1
  119. data/lib/order_cloud/models/list_user.rb +1 -1
  120. data/lib/order_cloud/models/list_user_group.rb +1 -1
  121. data/lib/order_cloud/models/list_user_group_assignment.rb +1 -1
  122. data/lib/order_cloud/models/list_variant.rb +1 -1
  123. data/lib/order_cloud/models/list_web_hook.rb +1 -1
  124. data/lib/order_cloud/models/list_web_hook_route.rb +1 -1
  125. data/lib/order_cloud/models/list_xp_index.rb +1 -1
  126. data/lib/order_cloud/models/message_cc_listener_assignment.rb +244 -0
  127. data/lib/order_cloud/models/message_config.rb +226 -0
  128. data/lib/order_cloud/models/message_sender.rb +217 -0
  129. data/lib/order_cloud/models/message_sender_assignment.rb +235 -0
  130. data/lib/order_cloud/models/meta.rb +1 -1
  131. data/lib/order_cloud/models/order.rb +1 -1
  132. data/lib/order_cloud/models/order_approval.rb +1 -1
  133. data/lib/order_cloud/models/order_promotion.rb +1 -1
  134. data/lib/order_cloud/models/password_reset.rb +1 -1
  135. data/lib/order_cloud/models/password_reset_request.rb +1 -1
  136. data/lib/order_cloud/models/payment.rb +1 -1
  137. data/lib/order_cloud/models/payment_transaction.rb +1 -1
  138. data/lib/order_cloud/models/ping_response.rb +1 -1
  139. data/lib/order_cloud/models/price_break.rb +1 -1
  140. data/lib/order_cloud/models/price_schedule.rb +1 -1
  141. data/lib/order_cloud/models/product.rb +41 -5
  142. data/lib/order_cloud/models/product_assignment.rb +20 -20
  143. data/lib/order_cloud/models/promotion.rb +1 -1
  144. data/lib/order_cloud/models/promotion_assignment.rb +1 -1
  145. data/lib/order_cloud/models/security_profile.rb +1 -1
  146. data/lib/order_cloud/models/security_profile_assignment.rb +1 -1
  147. data/lib/order_cloud/models/shipment.rb +1 -1
  148. data/lib/order_cloud/models/shipment_item.rb +1 -1
  149. data/lib/order_cloud/models/spec.rb +1 -1
  150. data/lib/order_cloud/models/spec_option.rb +1 -1
  151. data/lib/order_cloud/models/spec_product_assignment.rb +1 -1
  152. data/lib/order_cloud/models/spending_account.rb +1 -1
  153. data/lib/order_cloud/models/spending_account_assignment.rb +1 -1
  154. data/lib/order_cloud/models/user.rb +16 -5
  155. data/lib/order_cloud/models/user_group.rb +1 -1
  156. data/lib/order_cloud/models/user_group_assignment.rb +1 -1
  157. data/lib/order_cloud/models/variant.rb +1 -1
  158. data/lib/order_cloud/models/web_hook.rb +1 -1
  159. data/lib/order_cloud/models/web_hook_route.rb +1 -1
  160. data/lib/order_cloud/models/xp_index.rb +1 -1
  161. data/lib/order_cloud/version.rb +2 -2
  162. data/order_cloud.gemspec +2 -2
  163. data/spec/api/address_api_spec.rb +1 -1
  164. data/spec/api/admin_address_api_spec.rb +1 -1
  165. data/spec/api/admin_user_api_spec.rb +1 -1
  166. data/spec/api/admin_user_group_api_spec.rb +165 -0
  167. data/spec/api/approval_rule_api_spec.rb +1 -1
  168. data/spec/api/buyer_api_spec.rb +1 -1
  169. data/spec/api/category_api_spec.rb +2 -2
  170. data/spec/api/cost_center_api_spec.rb +1 -1
  171. data/spec/api/credit_card_api_spec.rb +1 -1
  172. data/spec/api/email_template_api_spec.rb +1 -1
  173. data/spec/api/line_item_api_spec.rb +1 -1
  174. data/spec/api/me_api_spec.rb +1 -1
  175. data/spec/api/message_senders_api_spec.rb +149 -0
  176. data/spec/api/order_api_spec.rb +1 -1
  177. data/spec/api/password_reset_api_spec.rb +1 -1
  178. data/spec/api/payment_api_spec.rb +1 -1
  179. data/spec/api/price_schedule_api_spec.rb +1 -1
  180. data/spec/api/product_api_spec.rb +2 -2
  181. data/spec/api/promotion_api_spec.rb +1 -1
  182. data/spec/api/security_profile_api_spec.rb +1 -1
  183. data/spec/api/shipment_api_spec.rb +1 -1
  184. data/spec/api/spec_api_spec.rb +1 -1
  185. data/spec/api/spending_account_api_spec.rb +1 -1
  186. data/spec/api/user_api_spec.rb +2 -2
  187. data/spec/api/user_group_api_spec.rb +2 -2
  188. data/spec/api_auth_spec.rb +1 -1
  189. data/spec/api_client_spec.rb +1 -1
  190. data/spec/configuration_spec.rb +3 -3
  191. data/spec/models/access_token_spec.rb +1 -1
  192. data/spec/models/address_assignment_spec.rb +1 -1
  193. data/spec/models/address_spec.rb +1 -1
  194. data/spec/models/admin_company_spec.rb +1 -1
  195. data/spec/models/admin_model_on_view_spec.rb +1 -1
  196. data/spec/models/approval_rule_spec.rb +1 -1
  197. data/spec/models/base_spec_spec.rb +1 -1
  198. data/spec/models/buyer_address_spec.rb +1 -1
  199. data/spec/models/buyer_credit_card_spec.rb +1 -1
  200. data/spec/models/buyer_product_spec.rb +1 -1
  201. data/spec/models/buyer_spec.rb +1 -1
  202. data/spec/models/buyer_spec_spec.rb +1 -1
  203. data/spec/models/category_assignment_spec.rb +1 -1
  204. data/spec/models/category_product_assignment_spec.rb +1 -1
  205. data/spec/models/category_spec.rb +1 -1
  206. data/spec/models/cost_center_assignment_spec.rb +1 -1
  207. data/spec/models/cost_center_spec.rb +1 -1
  208. data/spec/models/credit_card_assignment_spec.rb +1 -1
  209. data/spec/models/credit_card_spec.rb +1 -1
  210. data/spec/models/email_template_spec.rb +1 -1
  211. data/spec/models/file_spec.rb +1 -1
  212. data/spec/models/impersonate_token_request_spec.rb +1 -1
  213. data/spec/models/inventory_spec.rb +1 -1
  214. data/spec/models/line_item_spec.rb +1 -1
  215. data/spec/models/line_item_spec_spec.rb +1 -1
  216. data/spec/models/list_address_assignment_spec.rb +1 -1
  217. data/spec/models/list_address_spec.rb +1 -1
  218. data/spec/models/list_admin_company_spec.rb +1 -1
  219. data/spec/models/list_approval_rule_spec.rb +1 -1
  220. data/spec/models/list_buyer_address_spec.rb +1 -1
  221. data/spec/models/list_buyer_credit_card_spec.rb +1 -1
  222. data/spec/models/list_buyer_product_spec.rb +1 -1
  223. data/spec/models/list_buyer_spec.rb +1 -1
  224. data/spec/models/list_buyer_spec_spec.rb +1 -1
  225. data/spec/models/list_category_assignment_spec.rb +1 -1
  226. data/spec/models/list_category_product_assignment_spec.rb +1 -1
  227. data/spec/models/list_category_spec.rb +1 -1
  228. data/spec/models/list_cost_center_assignment_spec.rb +1 -1
  229. data/spec/models/list_cost_center_spec.rb +1 -1
  230. data/spec/models/list_credit_card_assignment_spec.rb +1 -1
  231. data/spec/models/list_credit_card_spec.rb +1 -1
  232. data/spec/models/list_file_spec.rb +1 -1
  233. data/spec/models/list_inventory_spec.rb +1 -1
  234. data/spec/models/list_line_item_spec.rb +1 -1
  235. data/spec/models/list_message_cc_listener_assignment_spec.rb +59 -0
  236. data/spec/models/{list_api_client_spec.rb → list_message_config_spec.rb} +7 -7
  237. data/spec/models/list_message_sender_assignment_spec.rb +59 -0
  238. data/spec/models/{list_dev_accessible_company_spec.rb → list_message_sender_spec.rb} +7 -7
  239. data/spec/models/list_order_approval_spec.rb +1 -1
  240. data/spec/models/list_order_promotion_spec.rb +1 -1
  241. data/spec/models/list_order_spec.rb +1 -1
  242. data/spec/models/list_payment_spec.rb +1 -1
  243. data/spec/models/list_price_schedule_spec.rb +1 -1
  244. data/spec/models/list_product_assignment_spec.rb +1 -1
  245. data/spec/models/list_product_spec.rb +1 -1
  246. data/spec/models/list_promotion_assignment_spec.rb +1 -1
  247. data/spec/models/list_promotion_spec.rb +1 -1
  248. data/spec/models/list_security_profile_assignment_spec.rb +1 -1
  249. data/spec/models/list_security_profile_spec.rb +1 -1
  250. data/spec/models/list_shipment_spec.rb +1 -1
  251. data/spec/models/list_spec_option_spec.rb +1 -1
  252. data/spec/models/list_spec_product_assignment_spec.rb +1 -1
  253. data/spec/models/list_spec_spec.rb +1 -1
  254. data/spec/models/list_spending_account_assignment_spec.rb +1 -1
  255. data/spec/models/list_spending_account_spec.rb +1 -1
  256. data/spec/models/list_user_group_assignment_spec.rb +1 -1
  257. data/spec/models/list_user_group_spec.rb +1 -1
  258. data/spec/models/list_user_spec.rb +1 -1
  259. data/spec/models/list_variant_spec.rb +1 -1
  260. data/spec/models/list_web_hook_route_spec.rb +1 -1
  261. data/spec/models/list_web_hook_spec.rb +1 -1
  262. data/spec/models/list_xp_index_spec.rb +1 -1
  263. data/spec/models/message_cc_listener_assignment_spec.rb +83 -0
  264. data/spec/models/message_config_spec.rb +71 -0
  265. data/spec/models/message_sender_assignment_spec.rb +77 -0
  266. data/spec/models/message_sender_spec.rb +65 -0
  267. data/spec/models/meta_spec.rb +1 -1
  268. data/spec/models/order_approval_spec.rb +1 -1
  269. data/spec/models/order_promotion_spec.rb +1 -1
  270. data/spec/models/order_spec.rb +1 -1
  271. data/spec/models/password_reset_request_spec.rb +1 -1
  272. data/spec/models/password_reset_spec.rb +1 -1
  273. data/spec/models/payment_spec.rb +1 -1
  274. data/spec/models/payment_transaction_spec.rb +1 -1
  275. data/spec/models/ping_response_spec.rb +1 -1
  276. data/spec/models/price_break_spec.rb +1 -1
  277. data/spec/models/price_schedule_spec.rb +1 -1
  278. data/spec/models/product_assignment_spec.rb +6 -6
  279. data/spec/models/product_spec.rb +25 -1
  280. data/spec/models/promotion_assignment_spec.rb +1 -1
  281. data/spec/models/promotion_spec.rb +1 -1
  282. data/spec/models/security_profile_assignment_spec.rb +1 -1
  283. data/spec/models/security_profile_spec.rb +1 -1
  284. data/spec/models/shipment_item_spec.rb +1 -1
  285. data/spec/models/shipment_spec.rb +1 -1
  286. data/spec/models/spec_option_spec.rb +1 -1
  287. data/spec/models/spec_product_assignment_spec.rb +1 -1
  288. data/spec/models/spec_spec.rb +1 -1
  289. data/spec/models/spending_account_assignment_spec.rb +1 -1
  290. data/spec/models/spending_account_spec.rb +1 -1
  291. data/spec/models/user_group_assignment_spec.rb +1 -1
  292. data/spec/models/user_group_spec.rb +1 -1
  293. data/spec/models/user_spec.rb +7 -1
  294. data/spec/models/variant_spec.rb +1 -1
  295. data/spec/models/web_hook_route_spec.rb +1 -1
  296. data/spec/models/web_hook_spec.rb +1 -1
  297. data/spec/models/xp_index_spec.rb +1 -1
  298. data/spec/spec_helper.rb +1 -1
  299. metadata +42 -15
  300. data/Gemfile.lock +0 -34
  301. data/docs/FileApi.md +0 -162
  302. data/lib/order_cloud/api/file_api.rb +0 -206
  303. data/spec/api/file_api_spec.rb +0 -83
@@ -0,0 +1,217 @@
1
+ =begin
2
+ #OrderCloud
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+ Contact: ordercloud@four51.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module OrderCloud
27
+
28
+ class MessageSender
29
+ attr_accessor :id
30
+
31
+ attr_accessor :name
32
+
33
+ attr_accessor :message_types
34
+
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'id' => :'ID',
40
+ :'name' => :'Name',
41
+ :'message_types' => :'MessageTypes'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'id' => :'String',
49
+ :'name' => :'String',
50
+ :'message_types' => :'String'
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?(:'ID')
63
+ self.id = attributes[:'ID']
64
+ end
65
+
66
+ if attributes.has_key?(:'Name')
67
+ self.name = attributes[:'Name']
68
+ end
69
+
70
+ if attributes.has_key?(:'MessageTypes')
71
+ self.message_types = attributes[:'MessageTypes']
72
+ end
73
+
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properies with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ return invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ return true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ id == o.id &&
95
+ name == o.name &&
96
+ message_types == o.message_types
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Fixnum] Hash code
107
+ def hash
108
+ [id, name, message_types].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /^Array<(.*)>/i
118
+ # check to ensure the input is an array given that the the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = OrderCloud.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map{ |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+
215
+ end
216
+
217
+ end
@@ -0,0 +1,235 @@
1
+ =begin
2
+ #OrderCloud
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+ Contact: ordercloud@four51.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module OrderCloud
27
+
28
+ class MessageSenderAssignment
29
+ attr_accessor :message_sender_id
30
+
31
+ attr_accessor :buyer_id
32
+
33
+ attr_accessor :user_id
34
+
35
+ attr_accessor :user_group_id
36
+
37
+ attr_accessor :message_config_name
38
+
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'message_sender_id' => :'MessageSenderID',
44
+ :'buyer_id' => :'BuyerID',
45
+ :'user_id' => :'UserID',
46
+ :'user_group_id' => :'UserGroupID',
47
+ :'message_config_name' => :'MessageConfigName'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.swagger_types
53
+ {
54
+ :'message_sender_id' => :'String',
55
+ :'buyer_id' => :'String',
56
+ :'user_id' => :'String',
57
+ :'user_group_id' => :'String',
58
+ :'message_config_name' => :'String'
59
+ }
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ return unless attributes.is_a?(Hash)
66
+
67
+ # convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
69
+
70
+ if attributes.has_key?(:'MessageSenderID')
71
+ self.message_sender_id = attributes[:'MessageSenderID']
72
+ end
73
+
74
+ if attributes.has_key?(:'BuyerID')
75
+ self.buyer_id = attributes[:'BuyerID']
76
+ end
77
+
78
+ if attributes.has_key?(:'UserID')
79
+ self.user_id = attributes[:'UserID']
80
+ end
81
+
82
+ if attributes.has_key?(:'UserGroupID')
83
+ self.user_group_id = attributes[:'UserGroupID']
84
+ end
85
+
86
+ if attributes.has_key?(:'MessageConfigName')
87
+ self.message_config_name = attributes[:'MessageConfigName']
88
+ end
89
+
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properies with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ return invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ return true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ message_sender_id == o.message_sender_id &&
111
+ buyer_id == o.buyer_id &&
112
+ user_id == o.user_id &&
113
+ user_group_id == o.user_group_id &&
114
+ message_config_name == o.message_config_name
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Fixnum] Hash code
125
+ def hash
126
+ [message_sender_id, buyer_id, user_id, user_group_id, message_config_name].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ if type =~ /^Array<(.*)>/i
136
+ # check to ensure the input is an array given that the the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :DateTime
156
+ DateTime.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :BOOLEAN
166
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ temp_model = OrderCloud.const_get(type).new
187
+ temp_model.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ next if value.nil?
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map{ |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+
235
+ end