phrase 4.22.0 → 4.23.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 (204) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +8 -6
  4. data/docs/AccountDetails.md +1 -1
  5. data/docs/AuthorizationsApi.md +1 -1
  6. data/docs/Automation.md +6 -0
  7. data/docs/AutomationsApi.md +1 -1
  8. data/docs/AutomationsCreateParameters.md +5 -1
  9. data/docs/AutomationsCreateParameters1.md +5 -1
  10. data/docs/BlacklistedKeysApi.md +1 -1
  11. data/docs/Branch.md +2 -0
  12. data/docs/BranchCreateParameters.md +3 -1
  13. data/docs/BranchMergeParameters.md +1 -1
  14. data/docs/BranchSyncParameters.md +1 -1
  15. data/docs/BranchesApi.md +10 -10
  16. data/docs/CommentsApi.md +7 -7
  17. data/docs/Distribution.md +4 -4
  18. data/docs/{DistributionPreview.md → DistributionDetails.md} +9 -3
  19. data/docs/DistributionsApi.md +9 -9
  20. data/docs/DocumentDelete422Response.md +19 -0
  21. data/docs/{CustomMetadataPropertyCreate422ResponseErrorsInner.md → DocumentDelete422ResponseErrorsInner.md} +2 -2
  22. data/docs/DocumentsApi.md +4 -2
  23. data/docs/FigmaAttachmentsApi.md +1 -1
  24. data/docs/GlossariesApi.md +1 -1
  25. data/docs/Glossary.md +2 -0
  26. data/docs/GlossaryTerm.md +2 -0
  27. data/docs/GlossaryTermGlossary.md +19 -0
  28. data/docs/GlossaryTermTranslationsApi.md +1 -1
  29. data/docs/GlossaryTermsApi.md +1 -1
  30. data/docs/IcuSkeletonParameters.md +3 -1
  31. data/docs/Invitation.md +2 -2
  32. data/docs/InvitationsApi.md +1 -1
  33. data/docs/Job.md +5 -1
  34. data/docs/JobDetails.md +8 -2
  35. data/docs/JobTemplate.md +2 -0
  36. data/docs/JobTemplateDetails.md +2 -0
  37. data/docs/JobTemplatesApi.md +1 -1
  38. data/docs/JobsApi.md +15 -9
  39. data/docs/KeyCreateParameters.md +6 -2
  40. data/docs/KeyUpdateParameters.md +6 -2
  41. data/docs/KeysApi.md +1 -1
  42. data/docs/LocalesApi.md +6 -2
  43. data/docs/MembersApi.md +1 -1
  44. data/docs/NotificationsApi.md +3 -1
  45. data/docs/OrdersApi.md +4 -2
  46. data/docs/OrganizationJobTemplate.md +4 -0
  47. data/docs/OrganizationJobTemplateDetails.md +4 -0
  48. data/docs/OrganizationJobTemplatesApi.md +1 -1
  49. data/docs/ProjectCreateParameters.md +17 -1
  50. data/docs/ProjectDetails.md +7 -1
  51. data/docs/ProjectUpdateParameters.md +17 -3
  52. data/docs/ProjectsApi.md +10 -8
  53. data/docs/Release.md +2 -0
  54. data/docs/ReleasesApi.md +1 -1
  55. data/docs/RepoSync.md +2 -0
  56. data/docs/ScreenshotMarker.md +2 -2
  57. data/docs/ScreenshotMarkerPresentation.md +23 -0
  58. data/docs/ScreenshotMarkersApi.md +1 -1
  59. data/docs/ScreenshotUpdateParameters.md +1 -1
  60. data/docs/ScreenshotsApi.md +1 -1
  61. data/docs/SearchInAccountParameters.md +3 -1
  62. data/docs/StyleGuidesApi.md +1 -1
  63. data/docs/StyleguideCreateParameters.md +3 -3
  64. data/docs/StyleguideUpdateParameters.md +3 -3
  65. data/docs/Tag.md +2 -0
  66. data/docs/TagWithStats.md +2 -0
  67. data/docs/TagsApi.md +5 -3
  68. data/docs/TranslationCreateParameters.md +5 -1
  69. data/docs/TranslationOrder.md +2 -2
  70. data/docs/TranslationUpdateParameters.md +3 -1
  71. data/docs/TranslationsApi.md +4 -0
  72. data/docs/UploadBatch.md +4 -2
  73. data/docs/UploadsApi.md +3 -1
  74. data/docs/VariablesApi.md +1 -1
  75. data/docs/WebhooksApi.md +7 -6
  76. data/lib/phrase/api/authorizations_api.rb +2 -0
  77. data/lib/phrase/api/automations_api.rb +2 -0
  78. data/lib/phrase/api/blacklisted_keys_api.rb +2 -0
  79. data/lib/phrase/api/branches_api.rb +20 -14
  80. data/lib/phrase/api/comments_api.rb +18 -4
  81. data/lib/phrase/api/distributions_api.rb +14 -12
  82. data/lib/phrase/api/documents_api.rb +5 -0
  83. data/lib/phrase/api/figma_attachments_api.rb +2 -0
  84. data/lib/phrase/api/glossaries_api.rb +2 -0
  85. data/lib/phrase/api/glossary_term_translations_api.rb +2 -0
  86. data/lib/phrase/api/glossary_terms_api.rb +2 -0
  87. data/lib/phrase/api/invitations_api.rb +2 -0
  88. data/lib/phrase/api/job_templates_api.rb +2 -0
  89. data/lib/phrase/api/jobs_api.rb +18 -6
  90. data/lib/phrase/api/keys_api.rb +2 -0
  91. data/lib/phrase/api/locales_api.rb +8 -0
  92. data/lib/phrase/api/members_api.rb +2 -0
  93. data/lib/phrase/api/notifications_api.rb +3 -0
  94. data/lib/phrase/api/orders_api.rb +5 -0
  95. data/lib/phrase/api/organization_job_templates_api.rb +2 -0
  96. data/lib/phrase/api/projects_api.rb +23 -10
  97. data/lib/phrase/api/releases_api.rb +2 -0
  98. data/lib/phrase/api/screenshot_markers_api.rb +2 -0
  99. data/lib/phrase/api/screenshots_api.rb +2 -0
  100. data/lib/phrase/api/style_guides_api.rb +2 -0
  101. data/lib/phrase/api/tags_api.rb +7 -2
  102. data/lib/phrase/api/translations_api.rb +6 -0
  103. data/lib/phrase/api/uploads_api.rb +3 -0
  104. data/lib/phrase/api/variables_api.rb +2 -0
  105. data/lib/phrase/api/webhooks_api.rb +9 -5
  106. data/lib/phrase/models/account_details.rb +1 -0
  107. data/lib/phrase/models/authorization_create_parameters.rb +22 -0
  108. data/lib/phrase/models/authorization_update_parameters.rb +22 -0
  109. data/lib/phrase/models/automation.rb +34 -1
  110. data/lib/phrase/models/automations_create_parameters.rb +24 -4
  111. data/lib/phrase/models/automations_create_parameters1.rb +24 -4
  112. data/lib/phrase/models/branch.rb +46 -1
  113. data/lib/phrase/models/branch_create_parameters.rb +14 -4
  114. data/lib/phrase/models/branch_merge_parameters.rb +35 -1
  115. data/lib/phrase/models/branch_sync_parameters.rb +35 -1
  116. data/lib/phrase/models/distribution.rb +17 -20
  117. data/lib/phrase/models/{distribution_preview.rb → distribution_details.rb} +46 -7
  118. data/lib/phrase/models/{custom_metadata_property_create422_response.rb → document_delete422_response.rb} +4 -4
  119. data/lib/phrase/models/{custom_metadata_property_create422_response_errors_inner.rb → document_delete422_response_errors_inner.rb} +3 -3
  120. data/lib/phrase/models/glossary.rb +12 -1
  121. data/lib/phrase/models/glossary_term.rb +10 -1
  122. data/lib/phrase/models/glossary_term_glossary.rb +206 -0
  123. data/lib/phrase/models/icu_skeleton_parameters.rb +12 -2
  124. data/lib/phrase/models/invitation.rb +9 -8
  125. data/lib/phrase/models/job.rb +26 -4
  126. data/lib/phrase/models/job_details.rb +37 -4
  127. data/lib/phrase/models/job_template.rb +11 -1
  128. data/lib/phrase/models/job_template_details.rb +11 -1
  129. data/lib/phrase/models/key_create_parameters.rb +26 -4
  130. data/lib/phrase/models/key_update_parameters.rb +26 -4
  131. data/lib/phrase/models/organization_job_template.rb +22 -1
  132. data/lib/phrase/models/organization_job_template_details.rb +22 -1
  133. data/lib/phrase/models/project_create_parameters.rb +115 -1
  134. data/lib/phrase/models/project_details.rb +31 -4
  135. data/lib/phrase/models/project_update_parameters.rb +75 -5
  136. data/lib/phrase/models/release.rb +10 -1
  137. data/lib/phrase/models/repo_sync.rb +12 -1
  138. data/lib/phrase/models/screenshot_marker.rb +2 -1
  139. data/lib/phrase/models/screenshot_marker_presentation.rb +224 -0
  140. data/lib/phrase/models/search_in_account_parameters.rb +16 -4
  141. data/lib/phrase/models/styleguide_create_parameters.rb +61 -3
  142. data/lib/phrase/models/styleguide_update_parameters.rb +61 -3
  143. data/lib/phrase/models/tag.rb +11 -1
  144. data/lib/phrase/models/tag_with_stats.rb +11 -1
  145. data/lib/phrase/models/translation_create_parameters.rb +24 -4
  146. data/lib/phrase/models/translation_order.rb +8 -7
  147. data/lib/phrase/models/translation_update_parameters.rb +14 -4
  148. data/lib/phrase/models/upload_batch.rb +24 -14
  149. data/lib/phrase/version.rb +1 -1
  150. data/lib/phrase.rb +5 -3
  151. data/spec/api/branches_api_spec.rb +7 -7
  152. data/spec/api/comments_api_spec.rb +2 -2
  153. data/spec/api/distributions_api_spec.rb +4 -4
  154. data/spec/api/documents_api_spec.rb +1 -0
  155. data/spec/api/jobs_api_spec.rb +4 -2
  156. data/spec/api/notifications_api_spec.rb +1 -0
  157. data/spec/api/orders_api_spec.rb +1 -0
  158. data/spec/api/projects_api_spec.rb +6 -5
  159. data/spec/api/tags_api_spec.rb +2 -1
  160. data/spec/api/translations_api_spec.rb +2 -0
  161. data/spec/api/webhooks_api_spec.rb +2 -2
  162. data/spec/models/authorization_create_parameters_spec.rb +4 -0
  163. data/spec/models/authorization_update_parameters_spec.rb +4 -0
  164. data/spec/models/automation_spec.rb +18 -0
  165. data/spec/models/automations_create_parameters1_spec.rb +12 -0
  166. data/spec/models/automations_create_parameters_spec.rb +12 -0
  167. data/spec/models/branch_create_parameters_spec.rb +6 -0
  168. data/spec/models/branch_merge_parameters_spec.rb +4 -0
  169. data/spec/models/branch_spec.rb +10 -0
  170. data/spec/models/branch_sync_parameters_spec.rb +4 -0
  171. data/spec/models/{distribution_preview_spec.rb → distribution_details_spec.rb} +24 -6
  172. data/spec/models/distribution_spec.rb +3 -3
  173. data/spec/models/{custom_metadata_property_create422_response_errors_inner_spec.rb → document_delete422_response_errors_inner_spec.rb} +6 -6
  174. data/spec/models/{custom_metadata_property_create422_response_spec.rb → document_delete422_response_spec.rb} +6 -6
  175. data/spec/models/glossary_spec.rb +6 -0
  176. data/spec/models/glossary_term_glossary_spec.rb +35 -0
  177. data/spec/models/glossary_term_spec.rb +6 -0
  178. data/spec/models/icu_skeleton_parameters_spec.rb +6 -0
  179. data/spec/models/invitation_spec.rb +1 -1
  180. data/spec/models/job_details_spec.rb +18 -0
  181. data/spec/models/job_spec.rb +12 -0
  182. data/spec/models/job_template_details_spec.rb +6 -0
  183. data/spec/models/job_template_spec.rb +6 -0
  184. data/spec/models/key_create_parameters_spec.rb +12 -0
  185. data/spec/models/key_update_parameters_spec.rb +12 -0
  186. data/spec/models/organization_job_template_details_spec.rb +12 -0
  187. data/spec/models/organization_job_template_spec.rb +12 -0
  188. data/spec/models/project_create_parameters_spec.rb +52 -0
  189. data/spec/models/project_details_spec.rb +18 -0
  190. data/spec/models/project_update_parameters_spec.rb +42 -0
  191. data/spec/models/release_spec.rb +6 -0
  192. data/spec/models/repo_sync_spec.rb +6 -0
  193. data/spec/models/screenshot_marker_presentation_spec.rb +47 -0
  194. data/spec/models/search_in_account_parameters_spec.rb +6 -0
  195. data/spec/models/styleguide_create_parameters_spec.rb +12 -0
  196. data/spec/models/styleguide_update_parameters_spec.rb +12 -0
  197. data/spec/models/tag_spec.rb +6 -0
  198. data/spec/models/tag_with_stats_spec.rb +6 -0
  199. data/spec/models/translation_create_parameters_spec.rb +12 -0
  200. data/spec/models/translation_order_spec.rb +1 -1
  201. data/spec/models/translation_update_parameters_spec.rb +6 -0
  202. data/spec/models/upload_batch_spec.rb +8 -2
  203. metadata +267 -259
  204. data/docs/CustomMetadataPropertyCreate422Response.md +0 -19
@@ -14,6 +14,9 @@ module Phrase
14
14
 
15
15
  attr_accessor :repo_name
16
16
 
17
+ # Branch used as the source of exports/PRs. May be `null` when the sync is configured to push directly to `base_branch`.
18
+ attr_accessor :pr_branch
19
+
17
20
  attr_accessor :created_at
18
21
 
19
22
  attr_accessor :last_import_at
@@ -29,6 +32,7 @@ module Phrase
29
32
  :'enabled' => :'enabled',
30
33
  :'auto_import' => :'auto_import',
31
34
  :'repo_name' => :'repo_name',
35
+ :'pr_branch' => :'pr_branch',
32
36
  :'created_at' => :'created_at',
33
37
  :'last_import_at' => :'last_import_at',
34
38
  :'last_export_at' => :'last_export_at'
@@ -44,6 +48,7 @@ module Phrase
44
48
  :'enabled' => :'Boolean',
45
49
  :'auto_import' => :'Boolean',
46
50
  :'repo_name' => :'String',
51
+ :'pr_branch' => :'String',
47
52
  :'created_at' => :'DateTime',
48
53
  :'last_import_at' => :'DateTime',
49
54
  :'last_export_at' => :'DateTime'
@@ -53,6 +58,7 @@ module Phrase
53
58
  # List of attributes with nullable: true
54
59
  def self.openapi_nullable
55
60
  Set.new([
61
+ :'pr_branch',
56
62
  ])
57
63
  end
58
64
 
@@ -95,6 +101,10 @@ module Phrase
95
101
  self.repo_name = attributes[:'repo_name']
96
102
  end
97
103
 
104
+ if attributes.key?(:'pr_branch')
105
+ self.pr_branch = attributes[:'pr_branch']
106
+ end
107
+
98
108
  if attributes.key?(:'created_at')
99
109
  self.created_at = attributes[:'created_at']
100
110
  end
@@ -132,6 +142,7 @@ module Phrase
132
142
  enabled == o.enabled &&
133
143
  auto_import == o.auto_import &&
134
144
  repo_name == o.repo_name &&
145
+ pr_branch == o.pr_branch &&
135
146
  created_at == o.created_at &&
136
147
  last_import_at == o.last_import_at &&
137
148
  last_export_at == o.last_export_at
@@ -146,7 +157,7 @@ module Phrase
146
157
  # Calculates hash code according to all attributes.
147
158
  # @return [Integer] Hash code
148
159
  def hash
149
- [id, project, provider, enabled, auto_import, repo_name, created_at, last_import_at, last_export_at].hash
160
+ [id, project, provider, enabled, auto_import, repo_name, pr_branch, created_at, last_import_at, last_export_at].hash
150
161
  end
151
162
 
152
163
  # Builds the object from hash
@@ -6,6 +6,7 @@ module Phrase
6
6
 
7
7
  attr_accessor :presentation
8
8
 
9
+ # Marker presentation style. The default value is `default`.
9
10
  attr_accessor :presentation_type
10
11
 
11
12
  attr_accessor :created_at
@@ -30,7 +31,7 @@ module Phrase
30
31
  def self.openapi_types
31
32
  {
32
33
  :'id' => :'String',
33
- :'presentation' => :'String',
34
+ :'presentation' => :'ScreenshotMarkerPresentation',
34
35
  :'presentation_type' => :'String',
35
36
  :'created_at' => :'DateTime',
36
37
  :'updated_at' => :'DateTime',
@@ -0,0 +1,224 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ # Coordinates and size of the marker on the screenshot, in pixels.
5
+ class ScreenshotMarkerPresentation
6
+ attr_accessor :x
7
+
8
+ attr_accessor :y
9
+
10
+ attr_accessor :w
11
+
12
+ attr_accessor :h
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :'x' => :'x',
18
+ :'y' => :'y',
19
+ :'w' => :'w',
20
+ :'h' => :'h'
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.openapi_types
26
+ {
27
+ :'x' => :'Integer',
28
+ :'y' => :'Integer',
29
+ :'w' => :'Integer',
30
+ :'h' => :'Integer'
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ScreenshotMarkerPresentation` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ScreenshotMarkerPresentation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'x')
56
+ self.x = attributes[:'x']
57
+ end
58
+
59
+ if attributes.key?(:'y')
60
+ self.y = attributes[:'y']
61
+ end
62
+
63
+ if attributes.key?(:'w')
64
+ self.w = attributes[:'w']
65
+ end
66
+
67
+ if attributes.key?(:'h')
68
+ self.h = attributes[:'h']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ x == o.x &&
91
+ y == o.y &&
92
+ w == o.w &&
93
+ h == o.h
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [x, y, w, h].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :Time
146
+ Time.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ Phrase.const_get(type).build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end
@@ -14,13 +14,17 @@ module Phrase
14
14
  # Number of results per page
15
15
  attr_accessor :per_page
16
16
 
17
+ # Limit the search to the given project codes. When omitted, the search spans every project the user can access in this account.
18
+ attr_accessor :project_ids
19
+
17
20
  # Attribute mapping from ruby-style variable name to JSON key.
18
21
  def self.attribute_map
19
22
  {
20
23
  :'query' => :'query',
21
24
  :'locale_code' => :'locale_code',
22
25
  :'page' => :'page',
23
- :'per_page' => :'per_page'
26
+ :'per_page' => :'per_page',
27
+ :'project_ids' => :'project_ids'
24
28
  }
25
29
  end
26
30
 
@@ -30,7 +34,8 @@ module Phrase
30
34
  :'query' => :'String',
31
35
  :'locale_code' => :'String',
32
36
  :'page' => :'Integer',
33
- :'per_page' => :'Integer'
37
+ :'per_page' => :'Integer',
38
+ :'project_ids' => :'Array<String>'
34
39
  }
35
40
  end
36
41
 
@@ -70,6 +75,12 @@ module Phrase
70
75
  if attributes.key?(:'per_page')
71
76
  self.per_page = attributes[:'per_page']
72
77
  end
78
+
79
+ if attributes.key?(:'project_ids')
80
+ if (value = attributes[:'project_ids']).is_a?(Array)
81
+ self.project_ids = value
82
+ end
83
+ end
73
84
  end
74
85
 
75
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -93,7 +104,8 @@ module Phrase
93
104
  query == o.query &&
94
105
  locale_code == o.locale_code &&
95
106
  page == o.page &&
96
- per_page == o.per_page
107
+ per_page == o.per_page &&
108
+ project_ids == o.project_ids
97
109
  end
98
110
 
99
111
  # @see the `==` method
@@ -105,7 +117,7 @@ module Phrase
105
117
  # Calculates hash code according to all attributes.
106
118
  # @return [Integer] Hash code
107
119
  def hash
108
- [query, locale_code, page, per_page].hash
120
+ [query, locale_code, page, per_page, project_ids].hash
109
121
  end
110
122
 
111
123
  # Builds the object from hash
@@ -8,13 +8,13 @@ module Phrase
8
8
  # Audience description
9
9
  attr_accessor :audience
10
10
 
11
- # Can be one of: not_specified, children, teenager, young_adults, adults, old_adults.
11
+ # Target audience for the translations.
12
12
  attr_accessor :target_audience
13
13
 
14
- # Can be one of: not_specified, first_person_singular, second_person_singular, third_person_singular_masculine, third_person_singular_feminine, third_person_singular_neuter, first_person_plural, second_person_plural, third_person_plural.
14
+ # Preferred grammatical person.
15
15
  attr_accessor :grammatical_person
16
16
 
17
- # Can be one of: not_specified, popular, technical, fictional.
17
+ # Vocabulary register the translations should use.
18
18
  attr_accessor :vocabulary_type
19
19
 
20
20
  # Description of the business
@@ -41,6 +41,28 @@ module Phrase
41
41
  # Provide links to sample product pages, FAQ pages, etc. to give the translator a point of reference. You can also provide past translations. Even snippets or short paragraphs are helpful for maintaining consistency.
42
42
  attr_accessor :samples
43
43
 
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
44
66
  # Attribute mapping from ruby-style variable name to JSON key.
45
67
  def self.attribute_map
46
68
  {
@@ -168,9 +190,45 @@ module Phrase
168
190
  # @return true if the model is valid
169
191
  def valid?
170
192
  return false if @title.nil?
193
+ target_audience_validator = EnumAttributeValidator.new('String', ["not_specified", "children", "teenager", "young_adults", "adults", "old_adults"])
194
+ return false unless target_audience_validator.valid?(@target_audience)
195
+ grammatical_person_validator = EnumAttributeValidator.new('String', ["not_specified", "first_person_singular", "second_person_singular", "third_person_singular_masculine", "third_person_singular_feminine", "third_person_singular_neuter", "first_person_plural", "second_person_plural", "third_person_plural"])
196
+ return false unless grammatical_person_validator.valid?(@grammatical_person)
197
+ vocabulary_type_validator = EnumAttributeValidator.new('String', ["not_specified", "popular", "technical", "fictional"])
198
+ return false unless vocabulary_type_validator.valid?(@vocabulary_type)
171
199
  true
172
200
  end
173
201
 
202
+ # Custom attribute writer method checking allowed values (enum).
203
+ # @param [Object] target_audience Object to be assigned
204
+ def target_audience=(target_audience)
205
+ validator = EnumAttributeValidator.new('String', ["not_specified", "children", "teenager", "young_adults", "adults", "old_adults"])
206
+ unless validator.valid?(target_audience)
207
+ fail ArgumentError, "invalid value for \"target_audience\", must be one of #{validator.allowable_values}."
208
+ end
209
+ @target_audience = target_audience
210
+ end
211
+
212
+ # Custom attribute writer method checking allowed values (enum).
213
+ # @param [Object] grammatical_person Object to be assigned
214
+ def grammatical_person=(grammatical_person)
215
+ validator = EnumAttributeValidator.new('String', ["not_specified", "first_person_singular", "second_person_singular", "third_person_singular_masculine", "third_person_singular_feminine", "third_person_singular_neuter", "first_person_plural", "second_person_plural", "third_person_plural"])
216
+ unless validator.valid?(grammatical_person)
217
+ fail ArgumentError, "invalid value for \"grammatical_person\", must be one of #{validator.allowable_values}."
218
+ end
219
+ @grammatical_person = grammatical_person
220
+ end
221
+
222
+ # Custom attribute writer method checking allowed values (enum).
223
+ # @param [Object] vocabulary_type Object to be assigned
224
+ def vocabulary_type=(vocabulary_type)
225
+ validator = EnumAttributeValidator.new('String', ["not_specified", "popular", "technical", "fictional"])
226
+ unless validator.valid?(vocabulary_type)
227
+ fail ArgumentError, "invalid value for \"vocabulary_type\", must be one of #{validator.allowable_values}."
228
+ end
229
+ @vocabulary_type = vocabulary_type
230
+ end
231
+
174
232
  # Checks equality by comparing each attribute.
175
233
  # @param [Object] Object to be compared
176
234
  def ==(o)
@@ -8,13 +8,13 @@ module Phrase
8
8
  # Audience description
9
9
  attr_accessor :audience
10
10
 
11
- # Can be one of: not_specified, children, teenager, young_adults, adults, old_adults.
11
+ # Target audience for the translations.
12
12
  attr_accessor :target_audience
13
13
 
14
- # Can be one of: not_specified, first_person_singular, second_person_singular, third_person_singular_masculine, third_person_singular_feminine, third_person_singular_neuter, first_person_plural, second_person_plural, third_person_plural.
14
+ # Preferred grammatical person.
15
15
  attr_accessor :grammatical_person
16
16
 
17
- # Can be one of: not_specified, popular, technical, fictional.
17
+ # Vocabulary register the translations should use.
18
18
  attr_accessor :vocabulary_type
19
19
 
20
20
  # Description of the business
@@ -41,6 +41,28 @@ module Phrase
41
41
  # Provide links to sample product pages, FAQ pages, etc. to give the translator a point of reference. You can also provide past translations. Even snippets or short paragraphs are helpful for maintaining consistency.
42
42
  attr_accessor :samples
43
43
 
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
44
66
  # Attribute mapping from ruby-style variable name to JSON key.
45
67
  def self.attribute_map
46
68
  {
@@ -163,9 +185,45 @@ module Phrase
163
185
  # Check to see if the all the properties in the model are valid
164
186
  # @return true if the model is valid
165
187
  def valid?
188
+ target_audience_validator = EnumAttributeValidator.new('String', ["not_specified", "children", "teenager", "young_adults", "adults", "old_adults"])
189
+ return false unless target_audience_validator.valid?(@target_audience)
190
+ grammatical_person_validator = EnumAttributeValidator.new('String', ["not_specified", "first_person_singular", "second_person_singular", "third_person_singular_masculine", "third_person_singular_feminine", "third_person_singular_neuter", "first_person_plural", "second_person_plural", "third_person_plural"])
191
+ return false unless grammatical_person_validator.valid?(@grammatical_person)
192
+ vocabulary_type_validator = EnumAttributeValidator.new('String', ["not_specified", "popular", "technical", "fictional"])
193
+ return false unless vocabulary_type_validator.valid?(@vocabulary_type)
166
194
  true
167
195
  end
168
196
 
197
+ # Custom attribute writer method checking allowed values (enum).
198
+ # @param [Object] target_audience Object to be assigned
199
+ def target_audience=(target_audience)
200
+ validator = EnumAttributeValidator.new('String', ["not_specified", "children", "teenager", "young_adults", "adults", "old_adults"])
201
+ unless validator.valid?(target_audience)
202
+ fail ArgumentError, "invalid value for \"target_audience\", must be one of #{validator.allowable_values}."
203
+ end
204
+ @target_audience = target_audience
205
+ end
206
+
207
+ # Custom attribute writer method checking allowed values (enum).
208
+ # @param [Object] grammatical_person Object to be assigned
209
+ def grammatical_person=(grammatical_person)
210
+ validator = EnumAttributeValidator.new('String', ["not_specified", "first_person_singular", "second_person_singular", "third_person_singular_masculine", "third_person_singular_feminine", "third_person_singular_neuter", "first_person_plural", "second_person_plural", "third_person_plural"])
211
+ unless validator.valid?(grammatical_person)
212
+ fail ArgumentError, "invalid value for \"grammatical_person\", must be one of #{validator.allowable_values}."
213
+ end
214
+ @grammatical_person = grammatical_person
215
+ end
216
+
217
+ # Custom attribute writer method checking allowed values (enum).
218
+ # @param [Object] vocabulary_type Object to be assigned
219
+ def vocabulary_type=(vocabulary_type)
220
+ validator = EnumAttributeValidator.new('String', ["not_specified", "popular", "technical", "fictional"])
221
+ unless validator.valid?(vocabulary_type)
222
+ fail ArgumentError, "invalid value for \"vocabulary_type\", must be one of #{validator.allowable_values}."
223
+ end
224
+ @vocabulary_type = vocabulary_type
225
+ end
226
+
169
227
  # Checks equality by comparing each attribute.
170
228
  # @param [Object] Object to be compared
171
229
  def ==(o)
@@ -6,6 +6,9 @@ module Phrase
6
6
 
7
7
  attr_accessor :keys_count
8
8
 
9
+ # `true` when the tag was created automatically by the system (e.g. for jobs, uploads, or Figma attachments) rather than by a user.
10
+ attr_accessor :system_tag
11
+
9
12
  attr_accessor :created_at
10
13
 
11
14
  attr_accessor :updated_at
@@ -15,6 +18,7 @@ module Phrase
15
18
  {
16
19
  :'name' => :'name',
17
20
  :'keys_count' => :'keys_count',
21
+ :'system_tag' => :'system_tag',
18
22
  :'created_at' => :'created_at',
19
23
  :'updated_at' => :'updated_at'
20
24
  }
@@ -25,6 +29,7 @@ module Phrase
25
29
  {
26
30
  :'name' => :'String',
27
31
  :'keys_count' => :'Integer',
32
+ :'system_tag' => :'Boolean',
28
33
  :'created_at' => :'DateTime',
29
34
  :'updated_at' => :'DateTime'
30
35
  }
@@ -59,6 +64,10 @@ module Phrase
59
64
  self.keys_count = attributes[:'keys_count']
60
65
  end
61
66
 
67
+ if attributes.key?(:'system_tag')
68
+ self.system_tag = attributes[:'system_tag']
69
+ end
70
+
62
71
  if attributes.key?(:'created_at')
63
72
  self.created_at = attributes[:'created_at']
64
73
  end
@@ -88,6 +97,7 @@ module Phrase
88
97
  self.class == o.class &&
89
98
  name == o.name &&
90
99
  keys_count == o.keys_count &&
100
+ system_tag == o.system_tag &&
91
101
  created_at == o.created_at &&
92
102
  updated_at == o.updated_at
93
103
  end
@@ -101,7 +111,7 @@ module Phrase
101
111
  # Calculates hash code according to all attributes.
102
112
  # @return [Integer] Hash code
103
113
  def hash
104
- [name, keys_count, created_at, updated_at].hash
114
+ [name, keys_count, system_tag, created_at, updated_at].hash
105
115
  end
106
116
 
107
117
  # Builds the object from hash
@@ -6,6 +6,9 @@ module Phrase
6
6
 
7
7
  attr_accessor :keys_count
8
8
 
9
+ # `true` when the tag was created automatically by the system (e.g. for jobs, uploads, or Figma attachments) rather than by a user.
10
+ attr_accessor :system_tag
11
+
9
12
  attr_accessor :created_at
10
13
 
11
14
  attr_accessor :updated_at
@@ -17,6 +20,7 @@ module Phrase
17
20
  {
18
21
  :'name' => :'name',
19
22
  :'keys_count' => :'keys_count',
23
+ :'system_tag' => :'system_tag',
20
24
  :'created_at' => :'created_at',
21
25
  :'updated_at' => :'updated_at',
22
26
  :'statistics' => :'statistics'
@@ -28,6 +32,7 @@ module Phrase
28
32
  {
29
33
  :'name' => :'String',
30
34
  :'keys_count' => :'Integer',
35
+ :'system_tag' => :'Boolean',
31
36
  :'created_at' => :'DateTime',
32
37
  :'updated_at' => :'DateTime',
33
38
  :'statistics' => :'Array<TagWithStats1Statistics1>'
@@ -70,6 +75,10 @@ module Phrase
70
75
  self.keys_count = attributes[:'keys_count']
71
76
  end
72
77
 
78
+ if attributes.key?(:'system_tag')
79
+ self.system_tag = attributes[:'system_tag']
80
+ end
81
+
73
82
  if attributes.key?(:'created_at')
74
83
  self.created_at = attributes[:'created_at']
75
84
  end
@@ -105,6 +114,7 @@ module Phrase
105
114
  self.class == o.class &&
106
115
  name == o.name &&
107
116
  keys_count == o.keys_count &&
117
+ system_tag == o.system_tag &&
108
118
  created_at == o.created_at &&
109
119
  updated_at == o.updated_at &&
110
120
  statistics == o.statistics
@@ -119,7 +129,7 @@ module Phrase
119
129
  # Calculates hash code according to all attributes.
120
130
  # @return [Integer] Hash code
121
131
  def hash
122
- [name, keys_count, created_at, updated_at, statistics].hash
132
+ [name, keys_count, system_tag, created_at, updated_at, statistics].hash
123
133
  end
124
134
 
125
135
  # Builds the object from hash