phrase 2.15.0 → 2.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/Gemfile +1 -0
  4. data/README.md +13 -3
  5. data/docs/FigmaAttachment.md +23 -0
  6. data/docs/FigmaAttachmentCreateParameters.md +19 -0
  7. data/docs/FigmaAttachmentUpdateParameters.md +19 -0
  8. data/docs/FigmaAttachmentsApi.md +341 -0
  9. data/docs/KeysFigmaAttachmentsApi.md +142 -0
  10. data/docs/LocalesApi.md +8 -8
  11. data/docs/TranslationsApi.md +2 -2
  12. data/docs/UploadCreateParameters.md +3 -1
  13. data/docs/UploadsApi.md +3 -1
  14. data/lib/phrase/api/figma_attachments_api.rb +393 -0
  15. data/lib/phrase/api/keys_figma_attachments_api.rb +168 -0
  16. data/lib/phrase/api/locales_api.rb +8 -8
  17. data/lib/phrase/api/translations_api.rb +2 -2
  18. data/lib/phrase/api/uploads_api.rb +3 -0
  19. data/lib/phrase/models/figma_attachment.rb +221 -0
  20. data/lib/phrase/models/figma_attachment_create_parameters.rb +205 -0
  21. data/lib/phrase/models/figma_attachment_update_parameters.rb +205 -0
  22. data/lib/phrase/models/upload_create_parameters.rb +16 -4
  23. data/lib/phrase/version.rb +1 -1
  24. data/lib/phrase.rb +5 -0
  25. data/spec/api/figma_attachments_api_spec.rb +100 -0
  26. data/spec/api/keys_figma_attachments_api_spec.rb +55 -0
  27. data/spec/api/locales_api_spec.rb +112 -8
  28. data/spec/api/translations_api_spec.rb +1 -1
  29. data/spec/api/uploads_api_spec.rb +16 -1
  30. data/spec/models/figma_attachment_create_parameters_spec.rb +35 -0
  31. data/spec/models/figma_attachment_spec.rb +47 -0
  32. data/spec/models/figma_attachment_update_parameters_spec.rb +35 -0
  33. data/spec/models/upload_create_parameters_spec.rb +6 -0
  34. data/spec/spec_helper.rb +1 -0
  35. metadata +239 -219
data/docs/LocalesApi.md CHANGED
@@ -168,7 +168,7 @@ end
168
168
 
169
169
  api_instance = Phrase::LocalesApi.new
170
170
  project_id = 'project_id_example' # String | Project ID
171
- id = 'id_example' # String | ID
171
+ id = 'id_example' # String | Locale ID or locale name
172
172
  opts = {
173
173
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
174
174
  branch: 'my-feature-branch' # String | specify the branch to use
@@ -188,7 +188,7 @@ end
188
188
  Name | Type | Description | Notes
189
189
  ------------- | ------------- | ------------- | -------------
190
190
  **project_id** | **String**| Project ID |
191
- **id** | **String**| ID |
191
+ **id** | **String**| Locale ID or locale name |
192
192
  **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
193
193
  **branch** | **String**| specify the branch to use | [optional]
194
194
 
@@ -232,7 +232,7 @@ end
232
232
 
233
233
  api_instance = Phrase::LocalesApi.new
234
234
  project_id = 'project_id_example' # String | Project ID
235
- id = 'id_example' # String | ID
235
+ id = 'id_example' # String | Locale ID or locale name
236
236
  opts = {
237
237
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
238
238
  if_modified_since: 'if_modified_since_example', # String | Last modified condition, see <a href=\"#overview--conditional-get-requests--http-caching\">Conditional GET requests / HTTP Caching</a> (optional)
@@ -270,7 +270,7 @@ end
270
270
  Name | Type | Description | Notes
271
271
  ------------- | ------------- | ------------- | -------------
272
272
  **project_id** | **String**| Project ID |
273
- **id** | **String**| ID |
273
+ **id** | **String**| Locale ID or locale name |
274
274
  **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
275
275
  **if_modified_since** | **String**| Last modified condition, see &lt;a href&#x3D;\&quot;#overview--conditional-get-requests--http-caching\&quot;&gt;Conditional GET requests / HTTP Caching&lt;/a&gt; (optional) | [optional]
276
276
  **if_none_match** | **String**| ETag condition, see &lt;a href&#x3D;\&quot;#overview--conditional-get-requests--http-caching\&quot;&gt;Conditional GET requests / HTTP Caching&lt;/a&gt; (optional) | [optional]
@@ -331,7 +331,7 @@ end
331
331
 
332
332
  api_instance = Phrase::LocalesApi.new
333
333
  project_id = 'project_id_example' # String | Project ID
334
- id = 'id_example' # String | ID
334
+ id = 'id_example' # String | Locale ID or locale name
335
335
  opts = {
336
336
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
337
337
  branch: 'my-feature-branch' # String | specify the branch to use
@@ -352,7 +352,7 @@ end
352
352
  Name | Type | Description | Notes
353
353
  ------------- | ------------- | ------------- | -------------
354
354
  **project_id** | **String**| Project ID |
355
- **id** | **String**| ID |
355
+ **id** | **String**| Locale ID or locale name |
356
356
  **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
357
357
  **branch** | **String**| specify the branch to use | [optional]
358
358
 
@@ -396,7 +396,7 @@ end
396
396
 
397
397
  api_instance = Phrase::LocalesApi.new
398
398
  project_id = 'project_id_example' # String | Project ID
399
- id = 'id_example' # String | ID
399
+ id = 'id_example' # String | Locale ID or locale name
400
400
  locale_update_parameters = Phrase::LocaleUpdateParameters.new # LocaleUpdateParameters |
401
401
  opts = {
402
402
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
@@ -417,7 +417,7 @@ end
417
417
  Name | Type | Description | Notes
418
418
  ------------- | ------------- | ------------- | -------------
419
419
  **project_id** | **String**| Project ID |
420
- **id** | **String**| ID |
420
+ **id** | **String**| Locale ID or locale name |
421
421
  **locale_update_parameters** | [**LocaleUpdateParameters**](LocaleUpdateParameters.md)| |
422
422
  **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
423
423
 
@@ -853,7 +853,7 @@ opts = {
853
853
  branch: 'my-feature-branch', # String | specify the branch to use
854
854
  sort: 'updated_at', # String | Sort criteria. Can be one of: key_name, created_at, updated_at.
855
855
  order: 'desc', # String | Order direction. Can be one of: asc, desc.
856
- q: 'PhraseApp*%20unverified:true%20excluded:true%20tags:feature,center' # String | Specify a query to find translations by content (including wildcards).<br><br> <i>Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).</i><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
856
+ q: 'PhraseApp*%20unverified:true%20excluded:true%20tags:feature,center' # String | Specify a query to find translations by content (including wildcards).<br><br> <i>Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).</i><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>reviewed_after:2013-02-21T00:00:00Z</code> for fetching translations that were reviewed after the given timestamp</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
857
857
  }
858
858
 
859
859
  begin
@@ -879,7 +879,7 @@ Name | Type | Description | Notes
879
879
  **branch** | **String**| specify the branch to use | [optional]
880
880
  **sort** | **String**| Sort criteria. Can be one of: key_name, created_at, updated_at. | [optional]
881
881
  **order** | **String**| Order direction. Can be one of: asc, desc. | [optional]
882
- **q** | **String**| Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; &lt;i&gt;Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).&lt;/i&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;. | [optional]
882
+ **q** | **String**| Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; &lt;i&gt;Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).&lt;/i&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;li&gt;&lt;code&gt;reviewed_after:2013-02-21T00:00:00Z&lt;/code&gt; for fetching translations that were reviewed after the given timestamp&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;. | [optional]
883
883
 
884
884
  ### Return type
885
885
 
@@ -19,6 +19,7 @@ Name | Type | Description | Notes
19
19
  **format_options** | [**Object**](.md) | Additional options available for specific formats. See our format guide for complete list. | [optional]
20
20
  **autotranslate** | **Boolean** | If set, translations for the uploaded language will be fetched automatically. | [optional]
21
21
  **mark_reviewed** | **Boolean** | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. | [optional]
22
+ **tag_only_affected_keys** | **Boolean** | Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is &#x60;false&#x60; | [optional] [default to false]
22
23
 
23
24
  ## Code Sample
24
25
 
@@ -39,7 +40,8 @@ instance = Phrase::UploadCreateParameters.new(branch: my-feature-branch,
39
40
  locale_mapping: {&quot;en&quot;: &quot;2&quot;},
40
41
  format_options: {&quot;foo&quot;: &quot;bar&quot;},
41
42
  autotranslate: null,
42
- mark_reviewed: null)
43
+ mark_reviewed: null,
44
+ tag_only_affected_keys: null)
43
45
  ```
44
46
 
45
47
 
data/docs/UploadsApi.md CHANGED
@@ -52,7 +52,8 @@ opts = {
52
52
  locale_mapping: nil, # Object | Optional, format specific mapping between locale names and the columns the translations to those locales are contained in.
53
53
  format_options: nil, # Object | Additional options available for specific formats. See our format guide for complete list.
54
54
  autotranslate: true, # Boolean | If set, translations for the uploaded language will be fetched automatically.
55
- mark_reviewed: true # Boolean | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project.
55
+ mark_reviewed: true, # Boolean | Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project.
56
+ tag_only_affected_keys: false # Boolean | Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is `false`
56
57
  }
57
58
 
58
59
  begin
@@ -86,6 +87,7 @@ Name | Type | Description | Notes
86
87
  **format_options** | [**Object**](Object.md)| Additional options available for specific formats. See our format guide for complete list. | [optional]
87
88
  **autotranslate** | **Boolean**| If set, translations for the uploaded language will be fetched automatically. | [optional]
88
89
  **mark_reviewed** | **Boolean**| Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow is enabled for the project. | [optional]
90
+ **tag_only_affected_keys** | **Boolean**| Indicates whether only keys affected (created or updated) by the upload should be tagged. The default is &#x60;false&#x60; | [optional] [default to false]
89
91
 
90
92
  ### Return type
91
93
 
@@ -0,0 +1,393 @@
1
+ require 'cgi'
2
+
3
+ module Phrase
4
+ class FigmaAttachmentsApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+ # Create a Figma attachment
11
+ # Create a new Figma attachment.
12
+ # @param project_id [String] Project ID
13
+ # @param figma_attachment_create_parameters [FigmaAttachmentCreateParameters]
14
+ # @param [Hash] opts the optional parameters
15
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
16
+ # @option opts [String] :branch specify the branch to use
17
+ # @return [FigmaAttachment]
18
+ def figma_attachment_create(project_id, figma_attachment_create_parameters, opts = {})
19
+ data, _status_code, _headers = figma_attachment_create_with_http_info(project_id, figma_attachment_create_parameters, opts)
20
+ data
21
+ end
22
+
23
+ # Create a Figma attachment
24
+ # Create a new Figma attachment.
25
+ # @param project_id [String] Project ID
26
+ # @param figma_attachment_create_parameters [FigmaAttachmentCreateParameters]
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
29
+ # @option opts [String] :branch specify the branch to use
30
+ # @return [Array<(Response<(FigmaAttachment)>, Integer, Hash)>] Response<(FigmaAttachment)> data, response status code and response headers
31
+ def figma_attachment_create_with_http_info(project_id, figma_attachment_create_parameters, opts = {})
32
+ if @api_client.config.debugging
33
+ @api_client.config.logger.debug 'Calling API: FigmaAttachmentsApi.figma_attachment_create ...'
34
+ end
35
+ # verify the required parameter 'project_id' is set
36
+ if @api_client.config.client_side_validation && project_id.nil?
37
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling FigmaAttachmentsApi.figma_attachment_create"
38
+ end
39
+ # verify the required parameter 'figma_attachment_create_parameters' is set
40
+ if @api_client.config.client_side_validation && figma_attachment_create_parameters.nil?
41
+ fail ArgumentError, "Missing the required parameter 'figma_attachment_create_parameters' when calling FigmaAttachmentsApi.figma_attachment_create"
42
+ end
43
+ # resource path
44
+ local_var_path = '/projects/{project_id}/figma_attachments'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
49
+
50
+ # header parameters
51
+ header_params = opts[:header_params] || {}
52
+ # HTTP header 'Accept' (if needed)
53
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
54
+ # HTTP header 'Content-Type'
55
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
56
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(figma_attachment_create_parameters)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'FigmaAttachment'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: FigmaAttachmentsApi#figma_attachment_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ response = ::Phrase::Response.new(data, headers)
84
+ return response, status_code, headers
85
+ end
86
+
87
+ # Delete a Figma attachment
88
+ # Delete an existing Figma attachment.
89
+ # @param project_id [String] Project ID
90
+ # @param id [String] ID
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
93
+ # @option opts [String] :branch specify the branch to use
94
+ # @return [nil]
95
+ def figma_attachment_delete(project_id, id, opts = {})
96
+ data, _status_code, _headers = figma_attachment_delete_with_http_info(project_id, id, opts)
97
+ data
98
+ end
99
+
100
+ # Delete a Figma attachment
101
+ # Delete an existing Figma attachment.
102
+ # @param project_id [String] Project ID
103
+ # @param id [String] ID
104
+ # @param [Hash] opts the optional parameters
105
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
106
+ # @option opts [String] :branch specify the branch to use
107
+ # @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
108
+ def figma_attachment_delete_with_http_info(project_id, id, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: FigmaAttachmentsApi.figma_attachment_delete ...'
111
+ end
112
+ # verify the required parameter 'project_id' is set
113
+ if @api_client.config.client_side_validation && project_id.nil?
114
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling FigmaAttachmentsApi.figma_attachment_delete"
115
+ end
116
+ # verify the required parameter 'id' is set
117
+ if @api_client.config.client_side_validation && id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'id' when calling FigmaAttachmentsApi.figma_attachment_delete"
119
+ end
120
+ # resource path
121
+ local_var_path = '/projects/{project_id}/figma_attachments/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
122
+
123
+ # query parameters
124
+ query_params = opts[:query_params] || {}
125
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
126
+
127
+ # header parameters
128
+ header_params = opts[:header_params] || {}
129
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
130
+
131
+ # form parameters
132
+ form_params = opts[:form_params] || {}
133
+
134
+ # http body (model)
135
+ post_body = opts[:body]
136
+
137
+ # return_type
138
+ return_type = opts[:return_type]
139
+
140
+ # auth_names
141
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
142
+
143
+ new_options = opts.merge(
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type
150
+ )
151
+
152
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: FigmaAttachmentsApi#figma_attachment_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ response = ::Phrase::Response.new(data, headers)
157
+ return response, status_code, headers
158
+ end
159
+
160
+ # Get a single Figma attachment
161
+ # Get details on a single Figma attachment for a given project.
162
+ # @param project_id [String] Project ID
163
+ # @param id [String] ID
164
+ # @param [Hash] opts the optional parameters
165
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
166
+ # @option opts [String] :branch specify the branch to use
167
+ # @return [FigmaAttachment]
168
+ def figma_attachment_show(project_id, id, opts = {})
169
+ data, _status_code, _headers = figma_attachment_show_with_http_info(project_id, id, opts)
170
+ data
171
+ end
172
+
173
+ # Get a single Figma attachment
174
+ # Get details on a single Figma attachment for a given project.
175
+ # @param project_id [String] Project ID
176
+ # @param id [String] ID
177
+ # @param [Hash] opts the optional parameters
178
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
179
+ # @option opts [String] :branch specify the branch to use
180
+ # @return [Array<(Response<(FigmaAttachment)>, Integer, Hash)>] Response<(FigmaAttachment)> data, response status code and response headers
181
+ def figma_attachment_show_with_http_info(project_id, id, opts = {})
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug 'Calling API: FigmaAttachmentsApi.figma_attachment_show ...'
184
+ end
185
+ # verify the required parameter 'project_id' is set
186
+ if @api_client.config.client_side_validation && project_id.nil?
187
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling FigmaAttachmentsApi.figma_attachment_show"
188
+ end
189
+ # verify the required parameter 'id' is set
190
+ if @api_client.config.client_side_validation && id.nil?
191
+ fail ArgumentError, "Missing the required parameter 'id' when calling FigmaAttachmentsApi.figma_attachment_show"
192
+ end
193
+ # resource path
194
+ local_var_path = '/projects/{project_id}/figma_attachments/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
195
+
196
+ # query parameters
197
+ query_params = opts[:query_params] || {}
198
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
199
+
200
+ # header parameters
201
+ header_params = opts[:header_params] || {}
202
+ # HTTP header 'Accept' (if needed)
203
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
204
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
205
+
206
+ # form parameters
207
+ form_params = opts[:form_params] || {}
208
+
209
+ # http body (model)
210
+ post_body = opts[:body]
211
+
212
+ # return_type
213
+ return_type = opts[:return_type] || 'FigmaAttachment'
214
+
215
+ # auth_names
216
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
217
+
218
+ new_options = opts.merge(
219
+ :header_params => header_params,
220
+ :query_params => query_params,
221
+ :form_params => form_params,
222
+ :body => post_body,
223
+ :auth_names => auth_names,
224
+ :return_type => return_type
225
+ )
226
+
227
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug "API called: FigmaAttachmentsApi#figma_attachment_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
230
+ end
231
+ response = ::Phrase::Response.new(data, headers)
232
+ return response, status_code, headers
233
+ end
234
+
235
+ # Update a Figma attachment
236
+ # Update an existing Figma attachment.
237
+ # @param project_id [String] Project ID
238
+ # @param id [String] ID
239
+ # @param figma_attachment_update_parameters [FigmaAttachmentUpdateParameters]
240
+ # @param [Hash] opts the optional parameters
241
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
242
+ # @option opts [String] :branch specify the branch to use
243
+ # @return [FigmaAttachment]
244
+ def figma_attachment_update(project_id, id, figma_attachment_update_parameters, opts = {})
245
+ data, _status_code, _headers = figma_attachment_update_with_http_info(project_id, id, figma_attachment_update_parameters, opts)
246
+ data
247
+ end
248
+
249
+ # Update a Figma attachment
250
+ # Update an existing Figma attachment.
251
+ # @param project_id [String] Project ID
252
+ # @param id [String] ID
253
+ # @param figma_attachment_update_parameters [FigmaAttachmentUpdateParameters]
254
+ # @param [Hash] opts the optional parameters
255
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
256
+ # @option opts [String] :branch specify the branch to use
257
+ # @return [Array<(Response<(FigmaAttachment)>, Integer, Hash)>] Response<(FigmaAttachment)> data, response status code and response headers
258
+ def figma_attachment_update_with_http_info(project_id, id, figma_attachment_update_parameters, opts = {})
259
+ if @api_client.config.debugging
260
+ @api_client.config.logger.debug 'Calling API: FigmaAttachmentsApi.figma_attachment_update ...'
261
+ end
262
+ # verify the required parameter 'project_id' is set
263
+ if @api_client.config.client_side_validation && project_id.nil?
264
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling FigmaAttachmentsApi.figma_attachment_update"
265
+ end
266
+ # verify the required parameter 'id' is set
267
+ if @api_client.config.client_side_validation && id.nil?
268
+ fail ArgumentError, "Missing the required parameter 'id' when calling FigmaAttachmentsApi.figma_attachment_update"
269
+ end
270
+ # verify the required parameter 'figma_attachment_update_parameters' is set
271
+ if @api_client.config.client_side_validation && figma_attachment_update_parameters.nil?
272
+ fail ArgumentError, "Missing the required parameter 'figma_attachment_update_parameters' when calling FigmaAttachmentsApi.figma_attachment_update"
273
+ end
274
+ # resource path
275
+ local_var_path = '/projects/{project_id}/figma_attachments/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
276
+
277
+ # query parameters
278
+ query_params = opts[:query_params] || {}
279
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
280
+
281
+ # header parameters
282
+ header_params = opts[:header_params] || {}
283
+ # HTTP header 'Accept' (if needed)
284
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
285
+ # HTTP header 'Content-Type'
286
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
287
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
288
+
289
+ # form parameters
290
+ form_params = opts[:form_params] || {}
291
+
292
+ # http body (model)
293
+ post_body = opts[:body] || @api_client.object_to_http_body(figma_attachment_update_parameters)
294
+
295
+ # return_type
296
+ return_type = opts[:return_type] || 'FigmaAttachment'
297
+
298
+ # auth_names
299
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
300
+
301
+ new_options = opts.merge(
302
+ :header_params => header_params,
303
+ :query_params => query_params,
304
+ :form_params => form_params,
305
+ :body => post_body,
306
+ :auth_names => auth_names,
307
+ :return_type => return_type
308
+ )
309
+
310
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
311
+ if @api_client.config.debugging
312
+ @api_client.config.logger.debug "API called: FigmaAttachmentsApi#figma_attachment_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
313
+ end
314
+ response = ::Phrase::Response.new(data, headers)
315
+ return response, status_code, headers
316
+ end
317
+
318
+ # List Figma attachments
319
+ # List all Figma attachments for the given project
320
+ # @param project_id [String] Project ID
321
+ # @param [Hash] opts the optional parameters
322
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
323
+ # @option opts [Integer] :page Page number
324
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
325
+ # @option opts [String] :branch specify the branch to use
326
+ # @return [Array<FigmaAttachment>]
327
+ def figma_attachments_list(project_id, opts = {})
328
+ data, _status_code, _headers = figma_attachments_list_with_http_info(project_id, opts)
329
+ data
330
+ end
331
+
332
+ # List Figma attachments
333
+ # List all Figma attachments for the given project
334
+ # @param project_id [String] Project ID
335
+ # @param [Hash] opts the optional parameters
336
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
337
+ # @option opts [Integer] :page Page number
338
+ # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
339
+ # @option opts [String] :branch specify the branch to use
340
+ # @return [Array<(Response<(Array<FigmaAttachment>)>, Integer, Hash)>] Response<(Array<FigmaAttachment>)> data, response status code and response headers
341
+ def figma_attachments_list_with_http_info(project_id, opts = {})
342
+ if @api_client.config.debugging
343
+ @api_client.config.logger.debug 'Calling API: FigmaAttachmentsApi.figma_attachments_list ...'
344
+ end
345
+ # verify the required parameter 'project_id' is set
346
+ if @api_client.config.client_side_validation && project_id.nil?
347
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling FigmaAttachmentsApi.figma_attachments_list"
348
+ end
349
+ # resource path
350
+ local_var_path = '/projects/{project_id}/figma_attachments'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
351
+
352
+ # query parameters
353
+ query_params = opts[:query_params] || {}
354
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
355
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
356
+ query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
357
+
358
+ # header parameters
359
+ header_params = opts[:header_params] || {}
360
+ # HTTP header 'Accept' (if needed)
361
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
362
+ header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
363
+
364
+ # form parameters
365
+ form_params = opts[:form_params] || {}
366
+
367
+ # http body (model)
368
+ post_body = opts[:body]
369
+
370
+ # return_type
371
+ return_type = opts[:return_type] || 'Array<FigmaAttachment>'
372
+
373
+ # auth_names
374
+ auth_names = opts[:auth_names] || ['Basic', 'Token']
375
+
376
+ new_options = opts.merge(
377
+ :header_params => header_params,
378
+ :query_params => query_params,
379
+ :form_params => form_params,
380
+ :body => post_body,
381
+ :auth_names => auth_names,
382
+ :return_type => return_type
383
+ )
384
+
385
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
386
+ if @api_client.config.debugging
387
+ @api_client.config.logger.debug "API called: FigmaAttachmentsApi#figma_attachments_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
388
+ end
389
+ response = ::Phrase::Response.new(data, headers)
390
+ return response, status_code, headers
391
+ end
392
+ end
393
+ end