templatefox 1.11.0 → 1.13.0

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 (118) hide show
  1. checksums.yaml +4 -4
  2. data/lib/templatefox/api/account_api.rb +1 -1
  3. data/lib/templatefox/api/agent_api.rb +227 -0
  4. data/lib/templatefox/api/image_api.rb +1 -1
  5. data/lib/templatefox/api/integrations_api.rb +1 -1
  6. data/lib/templatefox/api/pdf_api.rb +1 -1
  7. data/lib/templatefox/api/pdf_async_api.rb +3 -3
  8. data/lib/templatefox/api/pdf_tools_api.rb +1 -1
  9. data/lib/templatefox/api/templates_api.rb +64 -1
  10. data/lib/templatefox/api_client.rb +1 -1
  11. data/lib/templatefox/api_error.rb +1 -1
  12. data/lib/templatefox/api_model_base.rb +1 -1
  13. data/lib/templatefox/configuration.rb +1 -1
  14. data/lib/templatefox/models/account_info_response.rb +1 -1
  15. data/lib/templatefox/models/agent_job_created_response.rb +266 -0
  16. data/lib/templatefox/models/agent_job_status_response.rb +388 -0
  17. data/lib/templatefox/models/{job_status.rb → app_routers_v1_agent_job_status.rb} +4 -4
  18. data/lib/templatefox/models/app_routers_v1_delivery_export_type.rb +1 -1
  19. data/lib/templatefox/models/app_routers_v1_pdf_async_export_type.rb +1 -1
  20. data/lib/templatefox/models/app_routers_v1_pdf_async_job_status.rb +42 -0
  21. data/lib/templatefox/models/app_routers_v1_pdf_tools_export_type.rb +1 -1
  22. data/lib/templatefox/models/brand_inputs.rb +232 -0
  23. data/lib/templatefox/models/create_agent_template_request.rb +350 -0
  24. data/lib/templatefox/models/create_async_pdf_request.rb +1 -1
  25. data/lib/templatefox/models/create_async_pdf_response.rb +2 -2
  26. data/lib/templatefox/models/create_image_request.rb +1 -1
  27. data/lib/templatefox/models/create_image_response.rb +1 -1
  28. data/lib/templatefox/models/create_pdf_request.rb +1 -1
  29. data/lib/templatefox/models/create_pdf_response.rb +1 -1
  30. data/lib/templatefox/models/create_version_request.rb +1 -1
  31. data/lib/templatefox/models/extract_pdf_pages_request.rb +1 -1
  32. data/lib/templatefox/models/http_validation_error.rb +1 -1
  33. data/lib/templatefox/models/image_format.rb +1 -1
  34. data/lib/templatefox/models/job_list_response.rb +1 -1
  35. data/lib/templatefox/models/job_status_response.rb +2 -2
  36. data/lib/templatefox/models/location_inner.rb +1 -1
  37. data/lib/templatefox/models/merge_pdf_request.rb +1 -1
  38. data/lib/templatefox/models/modification.rb +1 -1
  39. data/lib/templatefox/models/pdf_input.rb +1 -1
  40. data/lib/templatefox/models/pdf_tools_response.rb +1 -1
  41. data/lib/templatefox/models/pdf_variant.rb +1 -1
  42. data/lib/templatefox/models/revise_agent_template_request.rb +193 -0
  43. data/lib/templatefox/models/rotate_pdf_request.rb +1 -1
  44. data/lib/templatefox/models/s3_config_request.rb +1 -1
  45. data/lib/templatefox/models/s3_config_response.rb +1 -1
  46. data/lib/templatefox/models/s3_success_response.rb +1 -1
  47. data/lib/templatefox/models/s3_test_response.rb +1 -1
  48. data/lib/templatefox/models/template_field.rb +1 -1
  49. data/lib/templatefox/models/template_field_spec.rb +1 -1
  50. data/lib/templatefox/models/template_layer.rb +259 -0
  51. data/lib/templatefox/models/template_layers_response.rb +179 -0
  52. data/lib/templatefox/models/template_list_item.rb +1 -1
  53. data/lib/templatefox/models/templates_list_response.rb +1 -1
  54. data/lib/templatefox/models/transaction.rb +1 -1
  55. data/lib/templatefox/models/transactions_response.rb +1 -1
  56. data/lib/templatefox/models/update_version_request.rb +1 -1
  57. data/lib/templatefox/models/validation_error.rb +1 -1
  58. data/lib/templatefox/models/version_item.rb +1 -1
  59. data/lib/templatefox/models/versions_list_response.rb +1 -1
  60. data/lib/templatefox/version.rb +2 -2
  61. data/lib/templatefox.rb +11 -2
  62. data/spec/api/account_api_spec.rb +1 -1
  63. data/spec/api/agent_api_spec.rb +72 -0
  64. data/spec/api/image_api_spec.rb +1 -1
  65. data/spec/api/integrations_api_spec.rb +1 -1
  66. data/spec/api/pdf_api_spec.rb +1 -1
  67. data/spec/api/pdf_async_api_spec.rb +2 -2
  68. data/spec/api/pdf_tools_api_spec.rb +1 -1
  69. data/spec/api/templates_api_spec.rb +13 -1
  70. data/spec/models/account_info_response_spec.rb +1 -1
  71. data/spec/models/agent_job_created_response_spec.rb +58 -0
  72. data/spec/models/agent_job_status_response_spec.rb +112 -0
  73. data/spec/models/{job_status_spec.rb → app_routers_v1_agent_job_status_spec.rb} +7 -7
  74. data/spec/models/app_routers_v1_delivery_export_type_spec.rb +1 -1
  75. data/spec/models/app_routers_v1_pdf_async_export_type_spec.rb +1 -1
  76. data/spec/models/app_routers_v1_pdf_async_job_status_spec.rb +30 -0
  77. data/spec/models/app_routers_v1_pdf_tools_export_type_spec.rb +1 -1
  78. data/spec/models/brand_inputs_spec.rb +48 -0
  79. data/spec/models/create_agent_template_request_spec.rb +70 -0
  80. data/spec/models/create_async_pdf_request_spec.rb +1 -1
  81. data/spec/models/create_async_pdf_response_spec.rb +1 -1
  82. data/spec/models/create_image_request_spec.rb +1 -1
  83. data/spec/models/create_image_response_spec.rb +1 -1
  84. data/spec/models/create_pdf_request_spec.rb +1 -1
  85. data/spec/models/create_pdf_response_spec.rb +1 -1
  86. data/spec/models/create_version_request_spec.rb +1 -1
  87. data/spec/models/extract_pdf_pages_request_spec.rb +1 -1
  88. data/spec/models/http_validation_error_spec.rb +1 -1
  89. data/spec/models/image_format_spec.rb +1 -1
  90. data/spec/models/job_list_response_spec.rb +1 -1
  91. data/spec/models/job_status_response_spec.rb +1 -1
  92. data/spec/models/location_inner_spec.rb +1 -1
  93. data/spec/models/merge_pdf_request_spec.rb +1 -1
  94. data/spec/models/modification_spec.rb +1 -1
  95. data/spec/models/pdf_input_spec.rb +1 -1
  96. data/spec/models/pdf_tools_response_spec.rb +1 -1
  97. data/spec/models/pdf_variant_spec.rb +1 -1
  98. data/spec/models/revise_agent_template_request_spec.rb +42 -0
  99. data/spec/models/rotate_pdf_request_spec.rb +1 -1
  100. data/spec/models/s3_config_request_spec.rb +1 -1
  101. data/spec/models/s3_config_response_spec.rb +1 -1
  102. data/spec/models/s3_success_response_spec.rb +1 -1
  103. data/spec/models/s3_test_response_spec.rb +1 -1
  104. data/spec/models/template_field_spec.rb +1 -1
  105. data/spec/models/template_field_spec_spec.rb +1 -1
  106. data/spec/models/template_layer_spec.rb +60 -0
  107. data/spec/models/template_layers_response_spec.rb +42 -0
  108. data/spec/models/template_list_item_spec.rb +1 -1
  109. data/spec/models/templates_list_response_spec.rb +1 -1
  110. data/spec/models/transaction_spec.rb +1 -1
  111. data/spec/models/transactions_response_spec.rb +1 -1
  112. data/spec/models/update_version_request_spec.rb +1 -1
  113. data/spec/models/validation_error_spec.rb +1 -1
  114. data/spec/models/version_item_spec.rb +1 -1
  115. data/spec/models/versions_list_response_spec.rb +1 -1
  116. data/spec/spec_helper.rb +1 -1
  117. data/templatefox.gemspec +1 -1
  118. metadata +61 -34
@@ -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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -113,7 +113,7 @@ module TemplateFox
113
113
  def self.openapi_types
114
114
  {
115
115
  :'id' => :'String',
116
- :'status' => :'JobStatus',
116
+ :'status' => :'AppRoutersV1PdfAsyncJobStatus',
117
117
  :'template_id' => :'String',
118
118
  :'export_type' => :'String',
119
119
  :'filename' => :'String',
@@ -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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -0,0 +1,193 @@
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.13.0
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
+ class ReviseAgentTemplateRequest < ApiModelBase
18
+ # Natural-language feedback on the current template.
19
+ attr_accessor :feedback
20
+
21
+ attr_accessor :brand
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'feedback' => :'feedback',
27
+ :'brand' => :'brand'
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
+ :'feedback' => :'String',
45
+ :'brand' => :'BrandInputs'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'brand'
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::ReviseAgentTemplateRequest` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::ReviseAgentTemplateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'feedback')
73
+ self.feedback = attributes[:'feedback']
74
+ else
75
+ self.feedback = nil
76
+ end
77
+
78
+ if attributes.key?(:'brand')
79
+ self.brand = attributes[:'brand']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @feedback.nil?
89
+ invalid_properties.push('invalid value for "feedback", feedback cannot be nil.')
90
+ end
91
+
92
+ if @feedback.to_s.length > 4000
93
+ invalid_properties.push('invalid value for "feedback", the character length must be smaller than or equal to 4000.')
94
+ end
95
+
96
+ if @feedback.to_s.length < 5
97
+ invalid_properties.push('invalid value for "feedback", the character length must be greater than or equal to 5.')
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 @feedback.nil?
108
+ return false if @feedback.to_s.length > 4000
109
+ return false if @feedback.to_s.length < 5
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] feedback Value to be assigned
115
+ def feedback=(feedback)
116
+ if feedback.nil?
117
+ fail ArgumentError, 'feedback cannot be nil'
118
+ end
119
+
120
+ if feedback.to_s.length > 4000
121
+ fail ArgumentError, 'invalid value for "feedback", the character length must be smaller than or equal to 4000.'
122
+ end
123
+
124
+ if feedback.to_s.length < 5
125
+ fail ArgumentError, 'invalid value for "feedback", the character length must be greater than or equal to 5.'
126
+ end
127
+
128
+ @feedback = feedback
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
+ feedback == o.feedback &&
137
+ brand == o.brand
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [feedback, brand].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ 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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
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.11.0
6
+ The version of the OpenAPI document: 1.13.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -0,0 +1,259 @@
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.13.0
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
+ # An addressable layer of a template (modifications API)
18
+ class TemplateLayer < ApiModelBase
19
+ # Layer name — the value to use in `modifications[].name`
20
+ attr_accessor :name
21
+
22
+ # HTML tag of the element
23
+ attr_accessor :tag
24
+
25
+ # Layer type: `background`, `image`, `text` or `shape`
26
+ attr_accessor :type
27
+
28
+ attr_accessor :current_text
29
+
30
+ # Modification fields that apply to this layer
31
+ attr_accessor :modifiable
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'name' => :'name',
37
+ :'tag' => :'tag',
38
+ :'type' => :'type',
39
+ :'current_text' => :'current_text',
40
+ :'modifiable' => :'modifiable'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'name' => :'String',
58
+ :'tag' => :'String',
59
+ :'type' => :'String',
60
+ :'current_text' => :'String',
61
+ :'modifiable' => :'Array<String>'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'current_text',
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::TemplateLayer` 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::TemplateLayer`. 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?(:'name')
89
+ self.name = attributes[:'name']
90
+ else
91
+ self.name = nil
92
+ end
93
+
94
+ if attributes.key?(:'tag')
95
+ self.tag = attributes[:'tag']
96
+ else
97
+ self.tag = nil
98
+ end
99
+
100
+ if attributes.key?(:'type')
101
+ self.type = attributes[:'type']
102
+ else
103
+ self.type = nil
104
+ end
105
+
106
+ if attributes.key?(:'current_text')
107
+ self.current_text = attributes[:'current_text']
108
+ end
109
+
110
+ if attributes.key?(:'modifiable')
111
+ if (value = attributes[:'modifiable']).is_a?(Array)
112
+ self.modifiable = value
113
+ end
114
+ else
115
+ self.modifiable = nil
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
+ invalid_properties = Array.new
124
+ if @name.nil?
125
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
126
+ end
127
+
128
+ if @tag.nil?
129
+ invalid_properties.push('invalid value for "tag", tag cannot be nil.')
130
+ end
131
+
132
+ if @type.nil?
133
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
134
+ end
135
+
136
+ if @modifiable.nil?
137
+ invalid_properties.push('invalid value for "modifiable", modifiable cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @name.nil?
148
+ return false if @tag.nil?
149
+ return false if @type.nil?
150
+ return false if @modifiable.nil?
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] name Value to be assigned
156
+ def name=(name)
157
+ if name.nil?
158
+ fail ArgumentError, 'name cannot be nil'
159
+ end
160
+
161
+ @name = name
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] tag Value to be assigned
166
+ def tag=(tag)
167
+ if tag.nil?
168
+ fail ArgumentError, 'tag cannot be nil'
169
+ end
170
+
171
+ @tag = tag
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] type Value to be assigned
176
+ def type=(type)
177
+ if type.nil?
178
+ fail ArgumentError, 'type cannot be nil'
179
+ end
180
+
181
+ @type = type
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] modifiable Value to be assigned
186
+ def modifiable=(modifiable)
187
+ if modifiable.nil?
188
+ fail ArgumentError, 'modifiable cannot be nil'
189
+ end
190
+
191
+ @modifiable = modifiable
192
+ end
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] Object to be compared
196
+ def ==(o)
197
+ return true if self.equal?(o)
198
+ self.class == o.class &&
199
+ name == o.name &&
200
+ tag == o.tag &&
201
+ type == o.type &&
202
+ current_text == o.current_text &&
203
+ modifiable == o.modifiable
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [name, tag, type, current_text, modifiable].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ transformed_hash = {}
225
+ openapi_types.each_pair do |key, type|
226
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = nil
228
+ elsif type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[attribute_map[key]].is_a?(Array)
232
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
+ end
234
+ elsif !attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
+ end
237
+ end
238
+ new(transformed_hash)
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ end
258
+
259
+ end