ultracart_api 4.1.151 → 4.1.152

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.
@@ -0,0 +1,274 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbThemeFontFamily
18
+ # Family name, for example Montserrat.
19
+ attr_accessor :family
20
+
21
+ # Typekit kit identifier. Only meaningful when type is typekit.
22
+ attr_accessor :kit_id
23
+
24
+ # Where the font comes from. native means a font installed on the shopper's machine, generic means a CSS keyword such as serif or sans-serif and belongs last in the stack.
25
+ attr_accessor :type
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'family' => :'family',
53
+ :'kit_id' => :'kit_id',
54
+ :'type' => :'type'
55
+ }
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'family' => :'String',
67
+ :'kit_id' => :'String',
68
+ :'type' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbThemeFontFamily` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbThemeFontFamily`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'family')
94
+ self.family = attributes[:'family']
95
+ end
96
+
97
+ if attributes.key?(:'kit_id')
98
+ self.kit_id = attributes[:'kit_id']
99
+ end
100
+
101
+ if attributes.key?(:'type')
102
+ self.type = attributes[:'type']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ type_validator = EnumAttributeValidator.new('String', ["google", "typekit", "native", "generic"])
117
+ return false unless type_validator.valid?(@type)
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method checking allowed values (enum).
122
+ # @param [Object] type Object to be assigned
123
+ def type=(type)
124
+ validator = EnumAttributeValidator.new('String', ["google", "typekit", "native", "generic"])
125
+ unless validator.valid?(type)
126
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
127
+ end
128
+ @type = type
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ family == o.family &&
137
+ kit_id == o.kit_id &&
138
+ type == o.type
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [family, kit_id, type].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ new.build_from_hash(attributes)
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ self.class.openapi_types.each_pair do |key, type|
167
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
168
+ self.send("#{key}=", nil)
169
+ elsif type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ end
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :Time
190
+ Time.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ # models (e.g. Pet) or oneOf
221
+ klass = UltracartClient.const_get(type)
222
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+
272
+ end
273
+
274
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.1.151'
14
+ VERSION = '4.1.152'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -1012,7 +1012,13 @@ require 'ultracart_api/models/sfvb_render_response'
1012
1012
  require 'ultracart_api/models/sfvb_storefront'
1013
1013
  require 'ultracart_api/models/sfvb_storefronts_response'
1014
1014
  require 'ultracart_api/models/sfvb_theme'
1015
+ require 'ultracart_api/models/sfvb_theme_attribute'
1016
+ require 'ultracart_api/models/sfvb_theme_attribute_update'
1017
+ require 'ultracart_api/models/sfvb_theme_attribute_update_request'
1018
+ require 'ultracart_api/models/sfvb_theme_attributes_response'
1015
1019
  require 'ultracart_api/models/sfvb_theme_duplicate_request'
1020
+ require 'ultracart_api/models/sfvb_theme_font'
1021
+ require 'ultracart_api/models/sfvb_theme_font_family'
1016
1022
  require 'ultracart_api/models/sfvb_theme_job_response'
1017
1023
  require 'ultracart_api/models/sfvb_themes_response'
1018
1024
  require 'ultracart_api/models/sfvb_upsell_offer'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.151
4
+ version: 4.1.152
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-04 00:00:00.000000000 Z
11
+ date: 2026-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -1074,7 +1074,13 @@ files:
1074
1074
  - docs/SfvbStorefront.md
1075
1075
  - docs/SfvbStorefrontsResponse.md
1076
1076
  - docs/SfvbTheme.md
1077
+ - docs/SfvbThemeAttribute.md
1078
+ - docs/SfvbThemeAttributeUpdate.md
1079
+ - docs/SfvbThemeAttributeUpdateRequest.md
1080
+ - docs/SfvbThemeAttributesResponse.md
1077
1081
  - docs/SfvbThemeDuplicateRequest.md
1082
+ - docs/SfvbThemeFont.md
1083
+ - docs/SfvbThemeFontFamily.md
1078
1084
  - docs/SfvbThemeJobResponse.md
1079
1085
  - docs/SfvbThemesResponse.md
1080
1086
  - docs/SfvbUpsellOffer.md
@@ -2203,7 +2209,13 @@ files:
2203
2209
  - lib/ultracart_api/models/sfvb_storefront.rb
2204
2210
  - lib/ultracart_api/models/sfvb_storefronts_response.rb
2205
2211
  - lib/ultracart_api/models/sfvb_theme.rb
2212
+ - lib/ultracart_api/models/sfvb_theme_attribute.rb
2213
+ - lib/ultracart_api/models/sfvb_theme_attribute_update.rb
2214
+ - lib/ultracart_api/models/sfvb_theme_attribute_update_request.rb
2215
+ - lib/ultracart_api/models/sfvb_theme_attributes_response.rb
2206
2216
  - lib/ultracart_api/models/sfvb_theme_duplicate_request.rb
2217
+ - lib/ultracart_api/models/sfvb_theme_font.rb
2218
+ - lib/ultracart_api/models/sfvb_theme_font_family.rb
2207
2219
  - lib/ultracart_api/models/sfvb_theme_job_response.rb
2208
2220
  - lib/ultracart_api/models/sfvb_themes_response.rb
2209
2221
  - lib/ultracart_api/models/sfvb_upsell_offer.rb