templatefox 1.7.0 → 1.8.1

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -6
  3. data/lib/templatefox/api/account_api.rb +1 -1
  4. data/lib/templatefox/api/integrations_api.rb +1 -1
  5. data/lib/templatefox/api/pdf_api.rb +1 -1
  6. data/lib/templatefox/api/pdf_async_api.rb +9 -9
  7. data/lib/templatefox/api/templates_api.rb +426 -3
  8. data/lib/templatefox/api_client.rb +1 -1
  9. data/lib/templatefox/api_error.rb +1 -1
  10. data/lib/templatefox/api_model_base.rb +1 -1
  11. data/lib/templatefox/configuration.rb +3 -3
  12. data/lib/templatefox/models/account_info_response.rb +1 -1
  13. data/lib/templatefox/models/app_routers_v1_pdf_async_export_type.rb +1 -1
  14. data/lib/templatefox/models/app_routers_v1_pdf_export_type.rb +1 -1
  15. data/lib/templatefox/models/create_async_pdf_request.rb +33 -8
  16. data/lib/templatefox/models/create_async_pdf_response.rb +1 -1
  17. data/lib/templatefox/models/create_pdf_request.rb +33 -8
  18. data/lib/templatefox/models/create_pdf_response.rb +1 -1
  19. data/lib/templatefox/models/create_version_request.rb +200 -0
  20. data/lib/templatefox/models/http_validation_error.rb +1 -1
  21. data/lib/templatefox/models/job_list_response.rb +1 -1
  22. data/lib/templatefox/models/job_status.rb +1 -1
  23. data/lib/templatefox/models/job_status_response.rb +1 -1
  24. data/lib/templatefox/models/location_inner.rb +1 -1
  25. data/lib/templatefox/models/pdf_variant.rb +1 -1
  26. data/lib/templatefox/models/s3_config_request.rb +1 -1
  27. data/lib/templatefox/models/s3_config_response.rb +1 -1
  28. data/lib/templatefox/models/s3_success_response.rb +1 -1
  29. data/lib/templatefox/models/s3_test_response.rb +1 -1
  30. data/lib/templatefox/models/set_default_version_request.rb +166 -0
  31. data/lib/templatefox/models/template_field.rb +1 -1
  32. data/lib/templatefox/models/template_field_spec.rb +1 -1
  33. data/lib/templatefox/models/template_list_item.rb +1 -1
  34. data/lib/templatefox/models/templates_list_response.rb +1 -1
  35. data/lib/templatefox/models/transaction.rb +1 -1
  36. data/lib/templatefox/models/transactions_response.rb +1 -1
  37. data/lib/templatefox/models/update_version_request.rb +200 -0
  38. data/lib/templatefox/models/validation_error.rb +1 -1
  39. data/lib/templatefox/models/version_item.rb +225 -0
  40. data/lib/templatefox/models/versions_list_response.rb +167 -0
  41. data/lib/templatefox/version.rb +2 -2
  42. data/lib/templatefox.rb +6 -1
  43. data/spec/api/account_api_spec.rb +1 -1
  44. data/spec/api/integrations_api_spec.rb +1 -1
  45. data/spec/api/pdf_api_spec.rb +1 -1
  46. data/spec/api/pdf_async_api_spec.rb +5 -5
  47. data/spec/api/templates_api_spec.rb +79 -2
  48. data/spec/models/account_info_response_spec.rb +1 -1
  49. data/spec/models/app_routers_v1_pdf_async_export_type_spec.rb +1 -1
  50. data/spec/models/app_routers_v1_pdf_export_type_spec.rb +1 -1
  51. data/spec/models/create_async_pdf_request_spec.rb +7 -1
  52. data/spec/models/create_async_pdf_response_spec.rb +1 -1
  53. data/spec/models/create_pdf_request_spec.rb +7 -1
  54. data/spec/models/create_pdf_response_spec.rb +1 -1
  55. data/spec/models/create_version_request_spec.rb +42 -0
  56. data/spec/models/http_validation_error_spec.rb +1 -1
  57. data/spec/models/job_list_response_spec.rb +1 -1
  58. data/spec/models/job_status_response_spec.rb +1 -1
  59. data/spec/models/job_status_spec.rb +1 -1
  60. data/spec/models/location_inner_spec.rb +1 -1
  61. data/spec/models/pdf_variant_spec.rb +1 -1
  62. data/spec/models/s3_config_request_spec.rb +1 -1
  63. data/spec/models/s3_config_response_spec.rb +1 -1
  64. data/spec/models/s3_success_response_spec.rb +1 -1
  65. data/spec/models/s3_test_response_spec.rb +1 -1
  66. data/spec/models/set_default_version_request_spec.rb +36 -0
  67. data/spec/models/template_field_spec.rb +1 -1
  68. data/spec/models/template_field_spec_spec.rb +1 -1
  69. data/spec/models/template_list_item_spec.rb +1 -1
  70. data/spec/models/templates_list_response_spec.rb +1 -1
  71. data/spec/models/transaction_spec.rb +1 -1
  72. data/spec/models/transactions_response_spec.rb +1 -1
  73. data/spec/models/update_version_request_spec.rb +42 -0
  74. data/spec/models/validation_error_spec.rb +1 -1
  75. data/spec/models/version_item_spec.rb +60 -0
  76. data/spec/models/versions_list_response_spec.rb +36 -0
  77. data/spec/spec_helper.rb +1 -1
  78. data/templatefox.gemspec +5 -5
  79. metadata +38 -23
@@ -0,0 +1,166 @@
1
+ =begin
2
+ #TemplateFox API
3
+
4
+ #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
+
6
+ The version of the OpenAPI document: 1.8.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TemplateFox
17
+ # Request to set the default version
18
+ class SetDefaultVersionRequest < ApiModelBase
19
+ # Version number to set as default
20
+ attr_accessor :version_number
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'version_number' => :'version_number'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'version_number' => :'Integer'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::SetDefaultVersionRequest` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::SetDefaultVersionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'version_number')
69
+ self.version_number = attributes[:'version_number']
70
+ else
71
+ self.version_number = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @version_number.nil?
81
+ invalid_properties.push('invalid value for "version_number", version_number cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if @version_number.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] version_number Value to be assigned
97
+ def version_number=(version_number)
98
+ if version_number.nil?
99
+ fail ArgumentError, 'version_number cannot be nil'
100
+ end
101
+
102
+ @version_number = version_number
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
+ version_number == o.version_number
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [version_number].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -0,0 +1,200 @@
1
+ =begin
2
+ #TemplateFox API
3
+
4
+ #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
+
6
+ The version of the OpenAPI document: 1.8.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TemplateFox
17
+ # Request to update a version's tag or description. Send null to clear a field.
18
+ class UpdateVersionRequest < ApiModelBase
19
+ attr_accessor :tag
20
+
21
+ attr_accessor :description
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'tag' => :'tag',
27
+ :'description' => :'description'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'tag' => :'String',
45
+ :'description' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'tag',
53
+ :'description'
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::UpdateVersionRequest` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::UpdateVersionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'tag')
74
+ self.tag = attributes[:'tag']
75
+ end
76
+
77
+ if attributes.key?(:'description')
78
+ self.description = attributes[:'description']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ if !@tag.nil? && @tag.to_s.length > 50
88
+ invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 50.')
89
+ end
90
+
91
+ pattern = Regexp.new(/^[a-z0-9][a-z0-9_-]{0,48}[a-z0-9]$/)
92
+ if !@tag.nil? && @tag !~ pattern
93
+ invalid_properties.push("invalid value for \"tag\", must conform to the pattern #{pattern}.")
94
+ end
95
+
96
+ if !@description.nil? && @description.to_s.length > 500
97
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 500.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ return false if !@tag.nil? && @tag.to_s.length > 50
108
+ return false if !@tag.nil? && @tag !~ Regexp.new(/^[a-z0-9][a-z0-9_-]{0,48}[a-z0-9]$/)
109
+ return false if !@description.nil? && @description.to_s.length > 500
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] tag Value to be assigned
115
+ def tag=(tag)
116
+ if !tag.nil? && tag.to_s.length > 50
117
+ fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 50.'
118
+ end
119
+
120
+ pattern = Regexp.new(/^[a-z0-9][a-z0-9_-]{0,48}[a-z0-9]$/)
121
+ if !tag.nil? && tag !~ pattern
122
+ fail ArgumentError, "invalid value for \"tag\", must conform to the pattern #{pattern}."
123
+ end
124
+
125
+ @tag = tag
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] description Value to be assigned
130
+ def description=(description)
131
+ if !description.nil? && description.to_s.length > 500
132
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 500.'
133
+ end
134
+
135
+ @description = description
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ tag == o.tag &&
144
+ description == o.description
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [tag, description].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ return nil unless attributes.is_a?(Hash)
164
+ attributes = attributes.transform_keys(&:to_sym)
165
+ transformed_hash = {}
166
+ openapi_types.each_pair do |key, type|
167
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{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[attribute_map[key]].is_a?(Array)
173
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
174
+ end
175
+ elsif !attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
177
+ end
178
+ end
179
+ new(transformed_hash)
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ end
199
+
200
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -0,0 +1,225 @@
1
+ =begin
2
+ #TemplateFox API
3
+
4
+ #Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
5
+
6
+ The version of the OpenAPI document: 1.8.1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TemplateFox
17
+ # Version item in list response
18
+ class VersionItem < ApiModelBase
19
+ # Version number
20
+ attr_accessor :version_number
21
+
22
+ attr_accessor :tag
23
+
24
+ attr_accessor :description
25
+
26
+ # Whether this is the default version used by the API
27
+ attr_accessor :is_default
28
+
29
+ # ISO 8601 timestamp
30
+ attr_accessor :created_at
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'version_number' => :'version_number',
36
+ :'tag' => :'tag',
37
+ :'description' => :'description',
38
+ :'is_default' => :'is_default',
39
+ :'created_at' => :'created_at'
40
+ }
41
+ end
42
+
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ acceptable_attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'version_number' => :'Integer',
57
+ :'tag' => :'String',
58
+ :'description' => :'String',
59
+ :'is_default' => :'Boolean',
60
+ :'created_at' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'tag',
68
+ :'description',
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::VersionItem` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::VersionItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'version_number')
89
+ self.version_number = attributes[:'version_number']
90
+ else
91
+ self.version_number = nil
92
+ end
93
+
94
+ if attributes.key?(:'tag')
95
+ self.tag = attributes[:'tag']
96
+ end
97
+
98
+ if attributes.key?(:'description')
99
+ self.description = attributes[:'description']
100
+ end
101
+
102
+ if attributes.key?(:'is_default')
103
+ self.is_default = attributes[:'is_default']
104
+ else
105
+ self.is_default = false
106
+ end
107
+
108
+ if attributes.key?(:'created_at')
109
+ self.created_at = attributes[:'created_at']
110
+ else
111
+ self.created_at = nil
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @version_number.nil?
121
+ invalid_properties.push('invalid value for "version_number", version_number cannot be nil.')
122
+ end
123
+
124
+ if @created_at.nil?
125
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @version_number.nil?
136
+ return false if @created_at.nil?
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] version_number Value to be assigned
142
+ def version_number=(version_number)
143
+ if version_number.nil?
144
+ fail ArgumentError, 'version_number cannot be nil'
145
+ end
146
+
147
+ @version_number = version_number
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] created_at Value to be assigned
152
+ def created_at=(created_at)
153
+ if created_at.nil?
154
+ fail ArgumentError, 'created_at cannot be nil'
155
+ end
156
+
157
+ @created_at = created_at
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ version_number == o.version_number &&
166
+ tag == o.tag &&
167
+ description == o.description &&
168
+ is_default == o.is_default &&
169
+ created_at == o.created_at
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ def hash
181
+ [version_number, tag, description, is_default, created_at].hash
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def self.build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+ transformed_hash = {}
191
+ openapi_types.each_pair do |key, type|
192
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = nil
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[attribute_map[key]].is_a?(Array)
198
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
199
+ end
200
+ elsif !attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
202
+ end
203
+ end
204
+ new(transformed_hash)
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ end
224
+
225
+ end