voucherify 8.0.1 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +1 -1
  3. data/ENDPOINTS-COVERAGE.md +64 -60
  4. data/Gemfile.lock +4 -4
  5. data/README.md +11 -0
  6. data/docs/Campaign.md +2 -2
  7. data/docs/CampaignBase.md +2 -2
  8. data/docs/CampaignsApi.md +3 -3
  9. data/docs/CampaignsCreateRequestBody.md +1 -1
  10. data/docs/CampaignsCreateResponseBody.md +2 -2
  11. data/docs/CampaignsGetResponseBody.md +2 -2
  12. data/docs/CampaignsUpdateRequestBody.md +2 -2
  13. data/docs/CampaignsUpdateResponseBody.md +2 -2
  14. data/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md +3 -2
  15. data/docs/Error.md +1 -0
  16. data/docs/ErrorError.md +8 -0
  17. data/docs/LoyaltiesCreateCampaignRequestBody.md +1 -1
  18. data/docs/LoyaltiesMembersBalanceUpdateResponseBody.md +1 -1
  19. data/docs/LoyaltiesMembersPointsExpirationListResponseBodyDataItem.md +9 -9
  20. data/docs/LoyaltiesMembersPointsExpirationListResponseBodyDataItemBucket.md +1 -1
  21. data/docs/LoyaltiesUpdateCampaignRequestBody.md +2 -2
  22. data/docs/LoyaltyCardTransaction.md +2 -2
  23. data/docs/LoyaltyCardTransactionDetailsBalance.md +5 -4
  24. data/docs/LoyaltyCardTransactionDetailsBalanceRelatedObject.md +1 -1
  25. data/docs/LoyaltyPointsBucket.md +16 -0
  26. data/docs/LoyaltyPointsBucketBucket.md +8 -0
  27. data/docs/Order.md +1 -1
  28. data/docs/OrderCalculated.md +1 -1
  29. data/docs/OrderCalculatedItem.md +1 -1
  30. data/docs/OrderCalculatedItemProduct.md +1 -1
  31. data/docs/OrderCalculatedItemSku.md +1 -0
  32. data/docs/OrderItem.md +1 -1
  33. data/docs/OrderItemProduct.md +1 -1
  34. data/docs/OrderItemSku.md +1 -0
  35. data/docs/OrdersCreateRequestBody.md +1 -1
  36. data/docs/OrdersCreateResponseBody.md +1 -1
  37. data/docs/OrdersGetResponseBody.md +1 -1
  38. data/docs/OrdersImportCreateRequestBodyItem.md +1 -1
  39. data/docs/OrdersUpdateRequestBody.md +1 -1
  40. data/docs/OrdersUpdateResponseBody.md +1 -1
  41. data/docs/Product.md +1 -1
  42. data/docs/ProductCollectionsProductsListResponseBodyDataItem.md +1 -1
  43. data/docs/ProductWithoutSkus.md +1 -1
  44. data/docs/ProductsCreateResponseBody.md +1 -1
  45. data/docs/ProductsGetResponseBody.md +1 -1
  46. data/docs/ProductsSkusCreateResponseBody.md +1 -1
  47. data/docs/ProductsSkusUpdateResponseBody.md +1 -1
  48. data/docs/ProductsUpdateResponseBody.md +1 -1
  49. data/docs/RedemptionEntryOrder.md +1 -1
  50. data/docs/RedemptionsGetResponseBodyOrder.md +1 -1
  51. data/docs/RedemptionsListResponseBodyRedemptionsItemOrder.md +1 -1
  52. data/docs/Sku.md +1 -1
  53. data/docs/SkusGetResponseBody.md +1 -1
  54. data/docs/TemplatesCampaignsCampaignSetupCreateRequestBody.md +1 -1
  55. data/docs/ValidationsRedeemableInapplicable.md +3 -2
  56. data/docs/ValidationsRedeemableSkipped.md +3 -2
  57. data/docs/ValidationsValidateResponseBodyRedeemablesItem.md +3 -2
  58. data/docs/VoucherBalance.md +14 -0
  59. data/docs/VoucherBalanceRelatedObject.md +9 -0
  60. data/docs/VoucherTransaction.md +2 -2
  61. data/docs/VoucherTransactionDetailsBalance.md +5 -4
  62. data/docs/VoucherTransactionDetailsBalanceRelatedObject.md +1 -1
  63. data/docs/VouchersApi.md +6 -6
  64. data/docs/VouchersBalanceUpdateResponseBody.md +1 -1
  65. data/lib/VoucherifySdk/api/campaigns_api.rb +4 -4
  66. data/lib/VoucherifySdk/api/vouchers_api.rb +10 -10
  67. data/lib/VoucherifySdk/models/access_settings_campaign_assignments_list.rb +1 -1
  68. data/lib/VoucherifySdk/models/campaign.rb +3 -3
  69. data/lib/VoucherifySdk/models/campaign_base.rb +3 -3
  70. data/lib/VoucherifySdk/models/campaigns_create_request_body.rb +1 -1
  71. data/lib/VoucherifySdk/models/campaigns_create_response_body.rb +3 -3
  72. data/lib/VoucherifySdk/models/campaigns_get_response_body.rb +3 -3
  73. data/lib/VoucherifySdk/models/campaigns_update_request_body.rb +2 -2
  74. data/lib/VoucherifySdk/models/campaigns_update_response_body.rb +3 -3
  75. data/lib/VoucherifySdk/models/client_validations_validate_response_body_redeemables_item.rb +18 -7
  76. data/lib/VoucherifySdk/models/error.rb +15 -5
  77. data/lib/VoucherifySdk/models/error_error.rb +210 -0
  78. data/lib/VoucherifySdk/models/loyalties_create_campaign_request_body.rb +1 -1
  79. data/lib/VoucherifySdk/models/loyalties_members_balance_update_response_body.rb +1 -0
  80. data/lib/VoucherifySdk/models/loyalties_members_points_expiration_list_response_body_data_item.rb +27 -77
  81. data/lib/VoucherifySdk/models/loyalties_members_points_expiration_list_response_body_data_item_bucket.rb +3 -9
  82. data/lib/VoucherifySdk/models/loyalties_update_campaign_request_body.rb +2 -2
  83. data/lib/VoucherifySdk/models/loyalty_card_transaction.rb +24 -31
  84. data/lib/VoucherifySdk/models/loyalty_card_transaction_details.rb +0 -1
  85. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_balance.rb +18 -19
  86. data/lib/VoucherifySdk/models/loyalty_card_transaction_details_balance_related_object.rb +1 -7
  87. data/lib/VoucherifySdk/models/loyalty_points_bucket.rb +323 -0
  88. data/lib/VoucherifySdk/models/loyalty_points_bucket_bucket.rb +210 -0
  89. data/lib/VoucherifySdk/models/order.rb +1 -1
  90. data/lib/VoucherifySdk/models/order_calculated.rb +1 -1
  91. data/lib/VoucherifySdk/models/order_calculated_item.rb +1 -1
  92. data/lib/VoucherifySdk/models/order_calculated_item_product.rb +1 -1
  93. data/lib/VoucherifySdk/models/order_calculated_item_sku.rb +16 -5
  94. data/lib/VoucherifySdk/models/order_item.rb +1 -1
  95. data/lib/VoucherifySdk/models/order_item_product.rb +1 -1
  96. data/lib/VoucherifySdk/models/order_item_sku.rb +16 -5
  97. data/lib/VoucherifySdk/models/orders_create_request_body.rb +1 -1
  98. data/lib/VoucherifySdk/models/orders_create_response_body.rb +1 -1
  99. data/lib/VoucherifySdk/models/orders_get_response_body.rb +1 -1
  100. data/lib/VoucherifySdk/models/orders_import_create_request_body_item.rb +1 -1
  101. data/lib/VoucherifySdk/models/orders_update_request_body.rb +1 -1
  102. data/lib/VoucherifySdk/models/orders_update_response_body.rb +1 -1
  103. data/lib/VoucherifySdk/models/parameter_expand_list_campaigns.rb +2 -1
  104. data/lib/VoucherifySdk/models/product.rb +1 -1
  105. data/lib/VoucherifySdk/models/product_collections_products_list_response_body_data_item.rb +1 -1
  106. data/lib/VoucherifySdk/models/product_without_skus.rb +1 -1
  107. data/lib/VoucherifySdk/models/products_create_response_body.rb +1 -1
  108. data/lib/VoucherifySdk/models/products_get_response_body.rb +1 -1
  109. data/lib/VoucherifySdk/models/products_skus_create_response_body.rb +1 -1
  110. data/lib/VoucherifySdk/models/products_skus_update_response_body.rb +1 -1
  111. data/lib/VoucherifySdk/models/products_update_response_body.rb +1 -1
  112. data/lib/VoucherifySdk/models/redemption_entry_order.rb +1 -1
  113. data/lib/VoucherifySdk/models/redemptions_get_response_body_order.rb +1 -1
  114. data/lib/VoucherifySdk/models/redemptions_list_response_body_redemptions_item_order.rb +1 -1
  115. data/lib/VoucherifySdk/models/sku.rb +1 -1
  116. data/lib/VoucherifySdk/models/skus_get_response_body.rb +1 -1
  117. data/lib/VoucherifySdk/models/templates_campaigns_campaign_setup_create_request_body.rb +1 -1
  118. data/lib/VoucherifySdk/models/validations_redeemable_inapplicable.rb +18 -7
  119. data/lib/VoucherifySdk/models/validations_redeemable_skipped.rb +18 -7
  120. data/lib/VoucherifySdk/models/validations_validate_response_body_redeemables_item.rb +18 -7
  121. data/lib/VoucherifySdk/models/voucher_balance.rb +305 -0
  122. data/lib/VoucherifySdk/models/voucher_balance_related_object.rb +247 -0
  123. data/lib/VoucherifySdk/models/voucher_transaction.rb +27 -31
  124. data/lib/VoucherifySdk/models/voucher_transaction_details.rb +0 -1
  125. data/lib/VoucherifySdk/models/voucher_transaction_details_balance.rb +18 -19
  126. data/lib/VoucherifySdk/models/voucher_transaction_details_balance_related_object.rb +1 -7
  127. data/lib/VoucherifySdk/models/vouchers_balance_update_response_body.rb +1 -0
  128. data/lib/VoucherifySdk/version.rb +1 -1
  129. data/lib/VoucherifySdk.rb +5 -0
  130. metadata +12 -2
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #Voucherify API
3
+
4
+ #Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.
5
+
6
+ The version of the OpenAPI document: v2018-08-01
7
+ Contact: support@voucherify.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 7.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module VoucherifySdk
17
+ # Includes additional information about the error.
18
+ class ErrorError
19
+ # The message configured by the user in a validation rule.
20
+ attr_accessor :message
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'message' => :'message'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'message' => :'String'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ :'message'
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'message')
57
+ self.message = attributes[:'message']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ warn '[DEPRECATED] the `valid?` method is obsolete'
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ message == o.message
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [message].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+ attributes = attributes.transform_keys(&:to_sym)
102
+ transformed_hash = {}
103
+ openapi_types.each_pair do |key, type|
104
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
105
+ transformed_hash["#{key}"] = nil
106
+ elsif type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[attribute_map[key]].is_a?(Array)
110
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
111
+ end
112
+ elsif !attributes[attribute_map[key]].nil?
113
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
114
+ end
115
+ end
116
+ new(transformed_hash)
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def self._deserialize(type, value)
124
+ case type.to_sym
125
+ when :Time
126
+ Time.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :Boolean
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ # models (e.g. Pet) or oneOf
157
+ klass = VoucherifySdk.const_get(type)
158
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+
208
+ end
209
+
210
+ end
@@ -22,7 +22,7 @@ module VoucherifySdk
22
22
  # An optional field to keep any extra textual information about the campaign such as a campaign description and details.
23
23
  attr_accessor :description
24
24
 
25
- # Defines whether the campaign can be updated with new vouchers after campaign creation. - `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). - `STATIC`: vouchers need to be manually published.
25
+ # Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of standalone vouchers. - `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria - `STATIC`: vouchers need to be manually published
26
26
  attr_accessor :type
27
27
 
28
28
  # If this value is set to `true`, customers will be able to join the campaign only once.
@@ -33,6 +33,7 @@ module VoucherifySdk
33
33
 
34
34
  attr_accessor :related_object
35
35
 
36
+ # The type of operation being performed.
36
37
  attr_accessor :operation_type
37
38
 
38
39
  class EnumAttributeValidator
@@ -14,31 +14,32 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module VoucherifySdk
17
+ # Contains the details about expiring loyalty points.
17
18
  class LoyaltiesMembersPointsExpirationListResponseBodyDataItem
18
- # Unique loyalty points bucket ID.
19
+ # Unique identifier of the loyalty points bucket.
19
20
  attr_accessor :id
20
21
 
21
- # Unique parent loyalty card ID.
22
+ # Unique identifier of the parent loyalty card.
22
23
  attr_accessor :voucher_id
23
24
 
24
- # Unique parent campaign ID.
25
+ # Unique identifier of the parent campaign.
25
26
  attr_accessor :campaign_id
26
27
 
27
28
  attr_accessor :bucket
28
29
 
29
- # Timestamp representing the date and time when the loyalty points bucket object was created. The value is shown in the ISO 8601 format.
30
- attr_accessor :created_at
31
-
32
- # Loyalty points bucket point status.
30
+ # Loyalty point point bucket status.
33
31
  attr_accessor :status
34
32
 
35
33
  # Date when the number of points defined in the bucket object are due to expire.
36
34
  attr_accessor :expires_at
37
35
 
38
- # Timestamp representing the date and time when the loyalty points bucket object was updated. The value is shown in the ISO 8601 format.
36
+ # Timestamp representing the date and time when the loyalty point bucket object was created in ISO 8601 format.
37
+ attr_accessor :created_at
38
+
39
+ # Timestamp representing the date and time when the loyalty point bucket object was updated in ISO 8601 format.
39
40
  attr_accessor :updated_at
40
41
 
41
- # The type of the object represented by JSON. This object stores information about the loyalty points bucket.
42
+ # The type of the object represented by JSON. This object stores information about the loyalty point bucket.
42
43
  attr_accessor :object
43
44
 
44
45
  class EnumAttributeValidator
@@ -70,9 +71,9 @@ module VoucherifySdk
70
71
  :'voucher_id' => :'voucher_id',
71
72
  :'campaign_id' => :'campaign_id',
72
73
  :'bucket' => :'bucket',
73
- :'created_at' => :'created_at',
74
74
  :'status' => :'status',
75
75
  :'expires_at' => :'expires_at',
76
+ :'created_at' => :'created_at',
76
77
  :'updated_at' => :'updated_at',
77
78
  :'object' => :'object'
78
79
  }
@@ -90,9 +91,9 @@ module VoucherifySdk
90
91
  :'voucher_id' => :'String',
91
92
  :'campaign_id' => :'String',
92
93
  :'bucket' => :'LoyaltiesMembersPointsExpirationListResponseBodyDataItemBucket',
93
- :'created_at' => :'Time',
94
94
  :'status' => :'String',
95
95
  :'expires_at' => :'Time',
96
+ :'created_at' => :'Time',
96
97
  :'updated_at' => :'Time',
97
98
  :'object' => :'String'
98
99
  }
@@ -101,6 +102,15 @@ module VoucherifySdk
101
102
  # List of attributes with nullable: true
102
103
  def self.openapi_nullable
103
104
  Set.new([
105
+ :'id',
106
+ :'voucher_id',
107
+ :'campaign_id',
108
+ :'bucket',
109
+ :'status',
110
+ :'expires_at',
111
+ :'created_at',
112
+ :'updated_at',
113
+ :'object'
104
114
  ])
105
115
  end
106
116
 
@@ -114,44 +124,30 @@ module VoucherifySdk
114
124
 
115
125
  if attributes.key?(:'id')
116
126
  self.id = attributes[:'id']
117
- else
118
- self.id = nil
119
127
  end
120
128
 
121
129
  if attributes.key?(:'voucher_id')
122
130
  self.voucher_id = attributes[:'voucher_id']
123
- else
124
- self.voucher_id = nil
125
131
  end
126
132
 
127
133
  if attributes.key?(:'campaign_id')
128
134
  self.campaign_id = attributes[:'campaign_id']
129
- else
130
- self.campaign_id = nil
131
135
  end
132
136
 
133
137
  if attributes.key?(:'bucket')
134
138
  self.bucket = attributes[:'bucket']
135
- else
136
- self.bucket = nil
137
- end
138
-
139
- if attributes.key?(:'created_at')
140
- self.created_at = attributes[:'created_at']
141
- else
142
- self.created_at = nil
143
139
  end
144
140
 
145
141
  if attributes.key?(:'status')
146
142
  self.status = attributes[:'status']
147
- else
148
- self.status = nil
149
143
  end
150
144
 
151
145
  if attributes.key?(:'expires_at')
152
146
  self.expires_at = attributes[:'expires_at']
153
- else
154
- self.expires_at = nil
147
+ end
148
+
149
+ if attributes.key?(:'created_at')
150
+ self.created_at = attributes[:'created_at']
155
151
  end
156
152
 
157
153
  if attributes.key?(:'updated_at')
@@ -170,43 +166,6 @@ module VoucherifySdk
170
166
  def list_invalid_properties
171
167
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
172
168
  invalid_properties = Array.new
173
- if @id.nil?
174
- invalid_properties.push('invalid value for "id", id cannot be nil.')
175
- end
176
-
177
- if @voucher_id.nil?
178
- invalid_properties.push('invalid value for "voucher_id", voucher_id cannot be nil.')
179
- end
180
-
181
- if @campaign_id.nil?
182
- invalid_properties.push('invalid value for "campaign_id", campaign_id cannot be nil.')
183
- end
184
-
185
- if @bucket.nil?
186
- invalid_properties.push('invalid value for "bucket", bucket cannot be nil.')
187
- end
188
-
189
- if @created_at.nil?
190
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
191
- end
192
-
193
- if @status.nil?
194
- invalid_properties.push('invalid value for "status", status cannot be nil.')
195
- end
196
-
197
- if @expires_at.nil?
198
- invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
199
- end
200
-
201
- if @object.nil?
202
- invalid_properties.push('invalid value for "object", object cannot be nil.')
203
- end
204
-
205
- pattern = Regexp.new(/loyalty_points_bucket/)
206
- if @object !~ pattern
207
- invalid_properties.push("invalid value for \"object\", must conform to the pattern #{pattern}.")
208
- end
209
-
210
169
  invalid_properties
211
170
  end
212
171
 
@@ -214,17 +173,8 @@ module VoucherifySdk
214
173
  # @return true if the model is valid
215
174
  def valid?
216
175
  warn '[DEPRECATED] the `valid?` method is obsolete'
217
- return false if @id.nil?
218
- return false if @voucher_id.nil?
219
- return false if @campaign_id.nil?
220
- return false if @bucket.nil?
221
- return false if @created_at.nil?
222
- return false if @status.nil?
223
- return false if @expires_at.nil?
224
- return false if @object.nil?
225
176
  object_validator = EnumAttributeValidator.new('String', ["loyalty_points_bucket"])
226
177
  return false unless object_validator.valid?(@object)
227
- return false if @object !~ Regexp.new(/loyalty_points_bucket/)
228
178
  true
229
179
  end
230
180
 
@@ -237,9 +187,9 @@ module VoucherifySdk
237
187
  voucher_id == o.voucher_id &&
238
188
  campaign_id == o.campaign_id &&
239
189
  bucket == o.bucket &&
240
- created_at == o.created_at &&
241
190
  status == o.status &&
242
191
  expires_at == o.expires_at &&
192
+ created_at == o.created_at &&
243
193
  updated_at == o.updated_at &&
244
194
  object == o.object
245
195
  end
@@ -253,7 +203,7 @@ module VoucherifySdk
253
203
  # Calculates hash code according to all attributes.
254
204
  # @return [Integer] Hash code
255
205
  def hash
256
- [id, voucher_id, campaign_id, bucket, created_at, status, expires_at, updated_at, object].hash
206
+ [id, voucher_id, campaign_id, bucket, status, expires_at, created_at, updated_at, object].hash
257
207
  end
258
208
 
259
209
  # Builds the object from hash
@@ -14,9 +14,9 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module VoucherifySdk
17
- # Defines the number of points stored in the given loyalty points bucket.
17
+ # Defines the number of points stored in this loyalty point bucket.
18
18
  class LoyaltiesMembersPointsExpirationListResponseBodyDataItemBucket
19
- # Total number of points in the loyalty points bucket.
19
+ # Total number of points in the loyalty point bucket.
20
20
  attr_accessor :total_points
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -41,6 +41,7 @@ module VoucherifySdk
41
41
  # List of attributes with nullable: true
42
42
  def self.openapi_nullable
43
43
  Set.new([
44
+ :'total_points'
44
45
  ])
45
46
  end
46
47
 
@@ -54,8 +55,6 @@ module VoucherifySdk
54
55
 
55
56
  if attributes.key?(:'total_points')
56
57
  self.total_points = attributes[:'total_points']
57
- else
58
- self.total_points = nil
59
58
  end
60
59
  end
61
60
 
@@ -64,10 +63,6 @@ module VoucherifySdk
64
63
  def list_invalid_properties
65
64
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
66
65
  invalid_properties = Array.new
67
- if @total_points.nil?
68
- invalid_properties.push('invalid value for "total_points", total_points cannot be nil.')
69
- end
70
-
71
66
  invalid_properties
72
67
  end
73
68
 
@@ -75,7 +70,6 @@ module VoucherifySdk
75
70
  # @return true if the model is valid
76
71
  def valid?
77
72
  warn '[DEPRECATED] the `valid?` method is obsolete'
78
- return false if @total_points.nil?
79
73
  true
80
74
  end
81
75
 
@@ -47,13 +47,13 @@ module VoucherifySdk
47
47
  # Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days.
48
48
  attr_accessor :activity_duration_after_publishing
49
49
 
50
- # If this value is set to `true`, customers will be able to join the campaign only once.
50
+ # If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for standalone voucher campaigns and it cannot be changed in them.
51
51
  attr_accessor :join_once
52
52
 
53
53
  # Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.
54
54
  attr_accessor :auto_join
55
55
 
56
- # Defines whether the campaign can be updated with new vouchers after campaign creation. - `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). - `STATIC`: vouchers need to be manually published.
56
+ # Defines whether the campaign can be updated with new vouchers after campaign creation. - `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). - `STATIC`: vouchers need to be manually published. If the `type` of the campaign is `STANDALONE`, the type cannot be changed. Also, the `type` cannot be changed to `STANDALONE`.
57
57
  attr_accessor :type
58
58
 
59
59
  attr_accessor :loyalty_tiers_expiration
@@ -33,16 +33,16 @@ module VoucherifySdk
33
33
  # Reason why the transaction occurred. In case of a redemption, this value is null.
34
34
  attr_accessor :reason
35
35
 
36
- attr_accessor :type
37
-
38
- attr_accessor :details
39
-
40
36
  # The related transaction ID on the receiving card.
41
37
  attr_accessor :related_transaction_id
42
38
 
43
39
  # Timestamp representing the date and time when the transaction was created. The value is shown in the ISO 8601 format.
44
40
  attr_accessor :created_at
45
41
 
42
+ attr_accessor :details
43
+
44
+ attr_accessor :type
45
+
46
46
  class EnumAttributeValidator
47
47
  attr_reader :datatype
48
48
  attr_reader :allowable_values
@@ -74,10 +74,10 @@ module VoucherifySdk
74
74
  :'campaign_id' => :'campaign_id',
75
75
  :'source' => :'source',
76
76
  :'reason' => :'reason',
77
- :'type' => :'type',
78
- :'details' => :'details',
79
77
  :'related_transaction_id' => :'related_transaction_id',
80
- :'created_at' => :'created_at'
78
+ :'created_at' => :'created_at',
79
+ :'details' => :'details',
80
+ :'type' => :'type'
81
81
  }
82
82
  end
83
83
 
@@ -95,10 +95,10 @@ module VoucherifySdk
95
95
  :'campaign_id' => :'String',
96
96
  :'source' => :'String',
97
97
  :'reason' => :'String',
98
- :'type' => :'LoyaltyCardTransactionsType',
99
- :'details' => :'LoyaltyCardTransactionDetails',
100
98
  :'related_transaction_id' => :'String',
101
- :'created_at' => :'Time'
99
+ :'created_at' => :'Time',
100
+ :'details' => :'LoyaltyCardTransactionDetails',
101
+ :'type' => :'LoyaltyCardTransactionsType'
102
102
  }
103
103
  end
104
104
 
@@ -111,9 +111,9 @@ module VoucherifySdk
111
111
  :'campaign_id',
112
112
  :'source',
113
113
  :'reason',
114
- :'details',
115
114
  :'related_transaction_id',
116
- :'created_at'
115
+ :'created_at',
116
+ :'details',
117
117
  ])
118
118
  end
119
119
 
@@ -149,16 +149,6 @@ module VoucherifySdk
149
149
  self.reason = attributes[:'reason']
150
150
  end
151
151
 
152
- if attributes.key?(:'type')
153
- self.type = attributes[:'type']
154
- else
155
- self.type = nil
156
- end
157
-
158
- if attributes.key?(:'details')
159
- self.details = attributes[:'details']
160
- end
161
-
162
152
  if attributes.key?(:'related_transaction_id')
163
153
  self.related_transaction_id = attributes[:'related_transaction_id']
164
154
  end
@@ -166,6 +156,14 @@ module VoucherifySdk
166
156
  if attributes.key?(:'created_at')
167
157
  self.created_at = attributes[:'created_at']
168
158
  end
159
+
160
+ if attributes.key?(:'details')
161
+ self.details = attributes[:'details']
162
+ end
163
+
164
+ if attributes.key?(:'type')
165
+ self.type = attributes[:'type']
166
+ end
169
167
  end
170
168
 
171
169
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -173,10 +171,6 @@ module VoucherifySdk
173
171
  def list_invalid_properties
174
172
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
175
173
  invalid_properties = Array.new
176
- if @type.nil?
177
- invalid_properties.push('invalid value for "type", type cannot be nil.')
178
- end
179
-
180
174
  invalid_properties
181
175
  end
182
176
 
@@ -184,7 +178,6 @@ module VoucherifySdk
184
178
  # @return true if the model is valid
185
179
  def valid?
186
180
  warn '[DEPRECATED] the `valid?` method is obsolete'
187
- return false if @type.nil?
188
181
  true
189
182
  end
190
183
 
@@ -199,10 +192,10 @@ module VoucherifySdk
199
192
  campaign_id == o.campaign_id &&
200
193
  source == o.source &&
201
194
  reason == o.reason &&
202
- type == o.type &&
203
- details == o.details &&
204
195
  related_transaction_id == o.related_transaction_id &&
205
- created_at == o.created_at
196
+ created_at == o.created_at &&
197
+ details == o.details &&
198
+ type == o.type
206
199
  end
207
200
 
208
201
  # @see the `==` method
@@ -214,7 +207,7 @@ module VoucherifySdk
214
207
  # Calculates hash code according to all attributes.
215
208
  # @return [Integer] Hash code
216
209
  def hash
217
- [id, source_id, voucher_id, campaign_id, source, reason, type, details, related_transaction_id, created_at].hash
210
+ [id, source_id, voucher_id, campaign_id, source, reason, related_transaction_id, created_at, details, type].hash
218
211
  end
219
212
 
220
213
  # Builds the object from hash
@@ -88,7 +88,6 @@ module VoucherifySdk
88
88
  # List of attributes with nullable: true
89
89
  def self.openapi_nullable
90
90
  Set.new([
91
- :'balance',
92
91
  :'order',
93
92
  :'event',
94
93
  :'earning_rule',