phrase 2.14.0 → 2.15.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a84d4b1908bfbb105768607982ae6df42c5d29769a83703e9cf4776022cb14dd
4
- data.tar.gz: eaef85f36598f65cd86d4cbdadba04d736023835dee31ce9d014c33420c94d7d
3
+ metadata.gz: a56234942a6166c1299cd75286a0ec37a654a98bfc998f806c8635b5cca69ef0
4
+ data.tar.gz: 3b8a5a7f7a6e782bce174f65697f6eaddbad169e912001a545ef2f3db119b632
5
5
  SHA512:
6
- metadata.gz: 44cad7e58e9a1da63e70197af4b725ba8c287edf61eb3a7d7925caea72f5788c4f0eff38098411ca28279705700cef0ee17ecb600fc0ee4cdbe8b29c1f7b372b
7
- data.tar.gz: 800dbacc70321c8e8f3d5c93e48aa7df6f402cb110a0880575b0f77b323f17832a00778cd43c929c52b02ffcf35a89fb6c5d86a5e25ca8c90b35cdad7bef255e
6
+ metadata.gz: 7537a76db6d34e63d666874a35ba8963823b0935af89555a957e02242bdd8e9ab175aff193018b8082339abbda7e71a5e60d58895310129e4409664167f7a5d4
7
+ data.tar.gz: 44f4dcae88b39e894ed424bd2e8816a2fe8ce0cd114e138b4a9653585f9af121535f7809aa918ad590e27642fe90d3c695762706348c65f9c6cbe81a541af55e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.15.0](https://github.com/phrase/openapi/compare/ruby-v2.14.0...ruby-v2.15.0) (2023-08-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **API:** Document new query parameters ([#393](https://github.com/phrase/openapi/issues/393)) ([770515a](https://github.com/phrase/openapi/commit/770515a9628122955bb3919405babf9392684eb9))
9
+
3
10
  ## [2.14.0](https://github.com/phrase/openapi/compare/ruby-v2.13.0...ruby-v2.14.0) (2023-08-24)
4
11
 
5
12
 
data/README.md CHANGED
@@ -7,7 +7,7 @@ Phrase Strings is a translation management platform for software projects. You c
7
7
  ## This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 2.14.0
10
+ - Package version: 2.15.0
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [https://developers.phrase.com/api/](https://developers.phrase.com/api/)
13
13
 
@@ -56,10 +56,10 @@ gem build phrase.gemspec
56
56
  Then install the gem locally:
57
57
 
58
58
  ```shell
59
- gem install ./phrase-2.14.0.gem
59
+ gem install ./phrase-2.15.0.gem
60
60
  ```
61
61
 
62
- (for development, run `gem install --dev ./phrase-2.14.0.gem` to install the development dependencies)
62
+ (for development, run `gem install --dev ./phrase-2.15.0.gem` to install the development dependencies)
63
63
 
64
64
  ## Getting Started
65
65
 
@@ -407,6 +407,7 @@ Class | Method | HTTP request | Description
407
407
  - [Phrase::CommentMarkReadParameters](docs/CommentMarkReadParameters.md)
408
408
  - [Phrase::CommentReaction](docs/CommentReaction.md)
409
409
  - [Phrase::CommentUpdateParameters](docs/CommentUpdateParameters.md)
410
+ - [Phrase::CommentsListParameters](docs/CommentsListParameters.md)
410
411
  - [Phrase::CurrentUser](docs/CurrentUser.md)
411
412
  - [Phrase::Distribution](docs/Distribution.md)
412
413
  - [Phrase::DistributionCreateParameters](docs/DistributionCreateParameters.md)
@@ -515,6 +516,7 @@ Class | Method | HTTP request | Description
515
516
  - [Phrase::ReleaseCreateParameters](docs/ReleaseCreateParameters.md)
516
517
  - [Phrase::ReleasePreview](docs/ReleasePreview.md)
517
518
  - [Phrase::ReleaseUpdateParameters](docs/ReleaseUpdateParameters.md)
519
+ - [Phrase::RepliesListParameters](docs/RepliesListParameters.md)
518
520
  - [Phrase::Screenshot](docs/Screenshot.md)
519
521
  - [Phrase::ScreenshotCreateParameters](docs/ScreenshotCreateParameters.md)
520
522
  - [Phrase::ScreenshotMarker](docs/ScreenshotMarker.md)
@@ -15,7 +15,7 @@ Method | HTTP request | Description
15
15
 
16
16
  ## replies_list
17
17
 
18
- > Array<Comment> replies_list(project_id, key_id, comment_id, opts)
18
+ > Array<Comment> replies_list(project_id, key_id, comment_id, replies_list_parameters, opts)
19
19
 
20
20
  List replies
21
21
 
@@ -41,16 +41,19 @@ api_instance = Phrase::CommentRepliesApi.new
41
41
  project_id = 'project_id_example' # String | Project ID
42
42
  key_id = 'key_id_example' # String | Translation Key ID
43
43
  comment_id = 'comment_id_example' # String | Comment ID
44
+ replies_list_parameters = Phrase::RepliesListParameters.new # RepliesListParameters |
44
45
  opts = {
45
46
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
46
47
  page: 1, # Integer | Page number
47
48
  per_page: 25, # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
48
- branch: 'my-feature-branch' # String | specify the branch to use
49
+ branch: 'my-feature-branch', # String | specify the branch to use
50
+ query: 'Some comment content', # String | Search query for comment messages
51
+ filters: ['[\"read\",\"unread\"]'] # Array<String> | Specify the filter for the comments
49
52
  }
50
53
 
51
54
  begin
52
55
  #List replies
53
- result = api_instance.replies_list(project_id, key_id, comment_id, opts)
56
+ result = api_instance.replies_list(project_id, key_id, comment_id, replies_list_parameters, opts)
54
57
  pp result
55
58
  rescue Phrase::ApiError => e
56
59
  puts "Exception when calling CommentRepliesApi->replies_list: #{e}"
@@ -65,10 +68,13 @@ Name | Type | Description | Notes
65
68
  **project_id** | **String**| Project ID |
66
69
  **key_id** | **String**| Translation Key ID |
67
70
  **comment_id** | **String**| Comment ID |
71
+ **replies_list_parameters** | [**RepliesListParameters**](RepliesListParameters.md)| |
68
72
  **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
69
73
  **page** | **Integer**| Page number | [optional]
70
74
  **per_page** | **Integer**| Limit on the number of objects to be returned, between 1 and 100. 25 by default | [optional]
71
75
  **branch** | **String**| specify the branch to use | [optional]
76
+ **query** | **String**| Search query for comment messages | [optional]
77
+ **filters** | [**Array&lt;String&gt;**](String.md)| Specify the filter for the comments | [optional]
72
78
 
73
79
  ### Return type
74
80
 
@@ -80,7 +86,7 @@ Response<([**Array&lt;Comment&gt;**](Comment.md))>
80
86
 
81
87
  ### HTTP request headers
82
88
 
83
- - **Content-Type**: Not defined
89
+ - **Content-Type**: application/json
84
90
  - **Accept**: application/json
85
91
 
86
92
 
data/docs/CommentsApi.md CHANGED
@@ -484,7 +484,7 @@ Response<([**Comment**](Comment.md))>
484
484
 
485
485
  ## comments_list
486
486
 
487
- > Array&lt;Comment&gt; comments_list(project_id, key_id, opts)
487
+ > Array&lt;Comment&gt; comments_list(project_id, key_id, comments_list_parameters, opts)
488
488
 
489
489
  List comments
490
490
 
@@ -509,16 +509,20 @@ end
509
509
  api_instance = Phrase::CommentsApi.new
510
510
  project_id = 'project_id_example' # String | Project ID
511
511
  key_id = 'key_id_example' # String | Translation Key ID
512
+ comments_list_parameters = Phrase::CommentsListParameters.new # CommentsListParameters |
512
513
  opts = {
513
514
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
514
515
  page: 1, # Integer | Page number
515
516
  per_page: 25, # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
516
- branch: 'my-feature-branch' # String | specify the branch to use
517
+ branch: 'my-feature-branch', # String | specify the branch to use
518
+ query: 'Some comment content', # String | Search query for comment messages
519
+ locale_ids: ['[\"someId\"]'], # Array<String> | Search comments by their assigned locales
520
+ filters: ['[\"read\",\"unread\"]'] # Array<String> | Specify the filter for the comments
517
521
  }
518
522
 
519
523
  begin
520
524
  #List comments
521
- result = api_instance.comments_list(project_id, key_id, opts)
525
+ result = api_instance.comments_list(project_id, key_id, comments_list_parameters, opts)
522
526
  pp result
523
527
  rescue Phrase::ApiError => e
524
528
  puts "Exception when calling CommentsApi->comments_list: #{e}"
@@ -532,10 +536,14 @@ Name | Type | Description | Notes
532
536
  ------------- | ------------- | ------------- | -------------
533
537
  **project_id** | **String**| Project ID |
534
538
  **key_id** | **String**| Translation Key ID |
539
+ **comments_list_parameters** | [**CommentsListParameters**](CommentsListParameters.md)| |
535
540
  **x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
536
541
  **page** | **Integer**| Page number | [optional]
537
542
  **per_page** | **Integer**| Limit on the number of objects to be returned, between 1 and 100. 25 by default | [optional]
538
543
  **branch** | **String**| specify the branch to use | [optional]
544
+ **query** | **String**| Search query for comment messages | [optional]
545
+ **locale_ids** | [**Array&lt;String&gt;**](String.md)| Search comments by their assigned locales | [optional]
546
+ **filters** | [**Array&lt;String&gt;**](String.md)| Specify the filter for the comments | [optional]
539
547
 
540
548
  ### Return type
541
549
 
@@ -547,6 +555,6 @@ Response<([**Array&lt;Comment&gt;**](Comment.md))>
547
555
 
548
556
  ### HTTP request headers
549
557
 
550
- - **Content-Type**: Not defined
558
+ - **Content-Type**: application/json
551
559
  - **Accept**: application/json
552
560
 
@@ -0,0 +1,23 @@
1
+ # Phrase::CommentsListParameters
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **branch** | **String** | Specify the branch to use | [optional]
8
+ **query** | **String** | Search query for comment messages | [optional]
9
+ **locale_ids** | **Array&lt;String&gt;** | Search comments by their assigned locales | [optional]
10
+ **filters** | **Array&lt;String&gt;** | Specify filters to find comments by | [optional]
11
+
12
+ ## Code Sample
13
+
14
+ ```ruby
15
+ require 'Phrase'
16
+
17
+ instance = Phrase::CommentsListParameters.new(branch: my-feature-branch,
18
+ query: Some comment content,
19
+ locale_ids: [&quot;someId&quot;,&quot;otherId&quot;],
20
+ filters: [&quot;read&quot;,&quot;unread&quot;])
21
+ ```
22
+
23
+
@@ -0,0 +1,21 @@
1
+ # Phrase::RepliesListParameters
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **branch** | **String** | Specify the branch to use | [optional]
8
+ **query** | **String** | Search query for comment messages | [optional]
9
+ **filters** | **Array&lt;String&gt;** | Specify filters to find comments by | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'Phrase'
15
+
16
+ instance = Phrase::RepliesListParameters.new(branch: my-feature-branch,
17
+ query: Some comment content,
18
+ filters: [&quot;read&quot;,&quot;unread&quot;])
19
+ ```
20
+
21
+
@@ -12,14 +12,17 @@ module Phrase
12
12
  # @param project_id [String] Project ID
13
13
  # @param key_id [String] Translation Key ID
14
14
  # @param comment_id [String] Comment ID
15
+ # @param replies_list_parameters [RepliesListParameters]
15
16
  # @param [Hash] opts the optional parameters
16
17
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
17
18
  # @option opts [Integer] :page Page number
18
19
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
19
20
  # @option opts [String] :branch specify the branch to use
21
+ # @option opts [String] :query Search query for comment messages
22
+ # @option opts [Array<String>] :filters Specify the filter for the comments
20
23
  # @return [Array<Comment>]
21
- def replies_list(project_id, key_id, comment_id, opts = {})
22
- data, _status_code, _headers = replies_list_with_http_info(project_id, key_id, comment_id, opts)
24
+ def replies_list(project_id, key_id, comment_id, replies_list_parameters, opts = {})
25
+ data, _status_code, _headers = replies_list_with_http_info(project_id, key_id, comment_id, replies_list_parameters, opts)
23
26
  data
24
27
  end
25
28
 
@@ -28,13 +31,16 @@ module Phrase
28
31
  # @param project_id [String] Project ID
29
32
  # @param key_id [String] Translation Key ID
30
33
  # @param comment_id [String] Comment ID
34
+ # @param replies_list_parameters [RepliesListParameters]
31
35
  # @param [Hash] opts the optional parameters
32
36
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
33
37
  # @option opts [Integer] :page Page number
34
38
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
35
39
  # @option opts [String] :branch specify the branch to use
40
+ # @option opts [String] :query Search query for comment messages
41
+ # @option opts [Array<String>] :filters Specify the filter for the comments
36
42
  # @return [Array<(Response<(Array<Comment>)>, Integer, Hash)>] Response<(Array<Comment>)> data, response status code and response headers
37
- def replies_list_with_http_info(project_id, key_id, comment_id, opts = {})
43
+ def replies_list_with_http_info(project_id, key_id, comment_id, replies_list_parameters, opts = {})
38
44
  if @api_client.config.debugging
39
45
  @api_client.config.logger.debug 'Calling API: CommentRepliesApi.replies_list ...'
40
46
  end
@@ -50,6 +56,10 @@ module Phrase
50
56
  if @api_client.config.client_side_validation && comment_id.nil?
51
57
  fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.replies_list"
52
58
  end
59
+ # verify the required parameter 'replies_list_parameters' is set
60
+ if @api_client.config.client_side_validation && replies_list_parameters.nil?
61
+ fail ArgumentError, "Missing the required parameter 'replies_list_parameters' when calling CommentRepliesApi.replies_list"
62
+ end
53
63
  # resource path
54
64
  local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s)).sub('{' + 'comment_id' + '}', CGI.escape(comment_id.to_s))
55
65
 
@@ -58,18 +68,22 @@ module Phrase
58
68
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
59
69
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
60
70
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
71
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
72
+ query_params[:'filters'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
61
73
 
62
74
  # header parameters
63
75
  header_params = opts[:header_params] || {}
64
76
  # HTTP header 'Accept' (if needed)
65
77
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
78
+ # HTTP header 'Content-Type'
79
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
66
80
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
67
81
 
68
82
  # form parameters
69
83
  form_params = opts[:form_params] || {}
70
84
 
71
85
  # http body (model)
72
- post_body = opts[:body]
86
+ post_body = opts[:body] || @api_client.object_to_http_body(replies_list_parameters)
73
87
 
74
88
  # return_type
75
89
  return_type = opts[:return_type] || 'Array<Comment>'
@@ -585,14 +585,18 @@ module Phrase
585
585
  # List all comments for a key.
586
586
  # @param project_id [String] Project ID
587
587
  # @param key_id [String] Translation Key ID
588
+ # @param comments_list_parameters [CommentsListParameters]
588
589
  # @param [Hash] opts the optional parameters
589
590
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
590
591
  # @option opts [Integer] :page Page number
591
592
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
592
593
  # @option opts [String] :branch specify the branch to use
594
+ # @option opts [String] :query Search query for comment messages
595
+ # @option opts [Array<String>] :locale_ids Search comments by their assigned locales
596
+ # @option opts [Array<String>] :filters Specify the filter for the comments
593
597
  # @return [Array<Comment>]
594
- def comments_list(project_id, key_id, opts = {})
595
- data, _status_code, _headers = comments_list_with_http_info(project_id, key_id, opts)
598
+ def comments_list(project_id, key_id, comments_list_parameters, opts = {})
599
+ data, _status_code, _headers = comments_list_with_http_info(project_id, key_id, comments_list_parameters, opts)
596
600
  data
597
601
  end
598
602
 
@@ -600,13 +604,17 @@ module Phrase
600
604
  # List all comments for a key.
601
605
  # @param project_id [String] Project ID
602
606
  # @param key_id [String] Translation Key ID
607
+ # @param comments_list_parameters [CommentsListParameters]
603
608
  # @param [Hash] opts the optional parameters
604
609
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
605
610
  # @option opts [Integer] :page Page number
606
611
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
607
612
  # @option opts [String] :branch specify the branch to use
613
+ # @option opts [String] :query Search query for comment messages
614
+ # @option opts [Array<String>] :locale_ids Search comments by their assigned locales
615
+ # @option opts [Array<String>] :filters Specify the filter for the comments
608
616
  # @return [Array<(Response<(Array<Comment>)>, Integer, Hash)>] Response<(Array<Comment>)> data, response status code and response headers
609
- def comments_list_with_http_info(project_id, key_id, opts = {})
617
+ def comments_list_with_http_info(project_id, key_id, comments_list_parameters, opts = {})
610
618
  if @api_client.config.debugging
611
619
  @api_client.config.logger.debug 'Calling API: CommentsApi.comments_list ...'
612
620
  end
@@ -618,6 +626,10 @@ module Phrase
618
626
  if @api_client.config.client_side_validation && key_id.nil?
619
627
  fail ArgumentError, "Missing the required parameter 'key_id' when calling CommentsApi.comments_list"
620
628
  end
629
+ # verify the required parameter 'comments_list_parameters' is set
630
+ if @api_client.config.client_side_validation && comments_list_parameters.nil?
631
+ fail ArgumentError, "Missing the required parameter 'comments_list_parameters' when calling CommentsApi.comments_list"
632
+ end
621
633
  # resource path
622
634
  local_var_path = '/projects/{project_id}/keys/{key_id}/comments'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s))
623
635
 
@@ -626,18 +638,23 @@ module Phrase
626
638
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
627
639
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
628
640
  query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
641
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
642
+ query_params[:'locale_ids'] = @api_client.build_collection_param(opts[:'locale_ids'], :multi) if !opts[:'locale_ids'].nil?
643
+ query_params[:'filters'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
629
644
 
630
645
  # header parameters
631
646
  header_params = opts[:header_params] || {}
632
647
  # HTTP header 'Accept' (if needed)
633
648
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
649
+ # HTTP header 'Content-Type'
650
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
634
651
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
635
652
 
636
653
  # form parameters
637
654
  form_params = opts[:form_params] || {}
638
655
 
639
656
  # http body (model)
640
- post_body = opts[:body]
657
+ post_body = opts[:body] || @api_client.object_to_http_body(comments_list_parameters)
641
658
 
642
659
  # return_type
643
660
  return_type = opts[:return_type] || 'Array<Comment>'
@@ -0,0 +1,229 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class CommentsListParameters
5
+ # Specify the branch to use
6
+ attr_accessor :branch
7
+
8
+ # Search query for comment messages
9
+ attr_accessor :query
10
+
11
+ # Search comments by their assigned locales
12
+ attr_accessor :locale_ids
13
+
14
+ # Specify filters to find comments by
15
+ attr_accessor :filters
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'branch' => :'branch',
21
+ :'query' => :'query',
22
+ :'locale_ids' => :'locale_ids',
23
+ :'filters' => :'filters'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'branch' => :'String',
31
+ :'query' => :'String',
32
+ :'locale_ids' => :'Array<String>',
33
+ :'filters' => :'Array<String>'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::CommentsListParameters` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::CommentsListParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'branch')
59
+ self.branch = attributes[:'branch']
60
+ end
61
+
62
+ if attributes.key?(:'query')
63
+ self.query = attributes[:'query']
64
+ end
65
+
66
+ if attributes.key?(:'locale_ids')
67
+ if (value = attributes[:'locale_ids']).is_a?(Array)
68
+ self.locale_ids = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'filters')
73
+ if (value = attributes[:'filters']).is_a?(Array)
74
+ self.filters = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ branch == o.branch &&
98
+ query == o.query &&
99
+ locale_ids == o.locale_ids &&
100
+ filters == o.filters
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [branch, query, locale_ids, filters].hash
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 self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.openapi_types.each_pair do |key, type|
128
+ if type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :DateTime
149
+ DateTime.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ Phrase.const_get(type).build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,217 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class RepliesListParameters
5
+ # Specify the branch to use
6
+ attr_accessor :branch
7
+
8
+ # Search query for comment messages
9
+ attr_accessor :query
10
+
11
+ # Specify filters to find comments by
12
+ attr_accessor :filters
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :'branch' => :'branch',
18
+ :'query' => :'query',
19
+ :'filters' => :'filters'
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.openapi_types
25
+ {
26
+ :'branch' => :'String',
27
+ :'query' => :'String',
28
+ :'filters' => :'Array<String>'
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new([
35
+ ])
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ if (!attributes.is_a?(Hash))
42
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::RepliesListParameters` initialize method"
43
+ end
44
+
45
+ # check to see if the attribute exists and convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h|
47
+ if (!self.class.attribute_map.key?(k.to_sym))
48
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::RepliesListParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
49
+ end
50
+ h[k.to_sym] = v
51
+ }
52
+
53
+ if attributes.key?(:'branch')
54
+ self.branch = attributes[:'branch']
55
+ end
56
+
57
+ if attributes.key?(:'query')
58
+ self.query = attributes[:'query']
59
+ end
60
+
61
+ if attributes.key?(:'filters')
62
+ if (value = attributes[:'filters']).is_a?(Array)
63
+ self.filters = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ branch == o.branch &&
87
+ query == o.query &&
88
+ filters == o.filters
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [branch, query, filters].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def self.build_from_hash(attributes)
107
+ new.build_from_hash(attributes)
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.openapi_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ Phrase.const_get(type).build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+ end
217
+ end
@@ -1,3 +1,3 @@
1
1
  module Phrase
2
- VERSION = '2.14.0'
2
+ VERSION = '2.15.0'
3
3
  end
data/lib/phrase.rb CHANGED
@@ -36,6 +36,7 @@ require 'phrase/models/comment_create_parameters'
36
36
  require 'phrase/models/comment_mark_read_parameters'
37
37
  require 'phrase/models/comment_reaction'
38
38
  require 'phrase/models/comment_update_parameters'
39
+ require 'phrase/models/comments_list_parameters'
39
40
  require 'phrase/models/current_user'
40
41
  require 'phrase/models/distribution'
41
42
  require 'phrase/models/distribution_create_parameters'
@@ -144,6 +145,7 @@ require 'phrase/models/release'
144
145
  require 'phrase/models/release_create_parameters'
145
146
  require 'phrase/models/release_preview'
146
147
  require 'phrase/models/release_update_parameters'
148
+ require 'phrase/models/replies_list_parameters'
147
149
  require 'phrase/models/screenshot'
148
150
  require 'phrase/models/screenshot_create_parameters'
149
151
  require 'phrase/models/screenshot_marker'
@@ -26,11 +26,14 @@ describe 'CommentRepliesApi' do
26
26
  # @param project_id Project ID
27
27
  # @param key_id Translation Key ID
28
28
  # @param comment_id Comment ID
29
+ # @param replies_list_parameters
29
30
  # @param [Hash] opts the optional parameters
30
31
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
31
32
  # @option opts [Integer] :page Page number
32
33
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
33
34
  # @option opts [String] :branch specify the branch to use
35
+ # @option opts [String] :query Search query for comment messages
36
+ # @option opts [Array<String>] :filters Specify the filter for the comments
34
37
  # @return [Array<Comment>]
35
38
  describe 'replies_list test' do
36
39
  it 'should work' do
@@ -138,11 +138,15 @@ describe 'CommentsApi' do
138
138
  # List all comments for a key.
139
139
  # @param project_id Project ID
140
140
  # @param key_id Translation Key ID
141
+ # @param comments_list_parameters
141
142
  # @param [Hash] opts the optional parameters
142
143
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
143
144
  # @option opts [Integer] :page Page number
144
145
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
145
146
  # @option opts [String] :branch specify the branch to use
147
+ # @option opts [String] :query Search query for comment messages
148
+ # @option opts [Array<String>] :locale_ids Search comments by their assigned locales
149
+ # @option opts [Array<String>] :filters Specify the filter for the comments
146
150
  # @return [Array<Comment>]
147
151
  describe 'comments_list test' do
148
152
  it 'should work' do
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::CommentsListParameters
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'CommentsListParameters' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::CommentsListParameters.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of CommentsListParameters' do
19
+ it 'should create an instance of CommentsListParameters' do
20
+ expect(@instance).to be_instance_of(Phrase::CommentsListParameters)
21
+ end
22
+ end
23
+ describe 'test attribute "branch"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "query"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ describe 'test attribute "locale_ids"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "filters"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::RepliesListParameters
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'RepliesListParameters' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::RepliesListParameters.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of RepliesListParameters' do
19
+ it 'should create an instance of RepliesListParameters' do
20
+ expect(@instance).to be_instance_of(Phrase::RepliesListParameters)
21
+ end
22
+ end
23
+ describe 'test attribute "branch"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "query"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ describe 'test attribute "filters"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phrase
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phrase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2023-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -132,6 +132,7 @@ files:
132
132
  - docs/CommentRepliesApi.md
133
133
  - docs/CommentUpdateParameters.md
134
134
  - docs/CommentsApi.md
135
+ - docs/CommentsListParameters.md
135
136
  - docs/CurrentUser.md
136
137
  - docs/Distribution.md
137
138
  - docs/DistributionCreateParameters.md
@@ -265,6 +266,7 @@ files:
265
266
  - docs/ReleasePreview.md
266
267
  - docs/ReleaseUpdateParameters.md
267
268
  - docs/ReleasesApi.md
269
+ - docs/RepliesListParameters.md
268
270
  - docs/Screenshot.md
269
271
  - docs/ScreenshotCreateParameters.md
270
272
  - docs/ScreenshotMarker.md
@@ -427,6 +429,7 @@ files:
427
429
  - lib/phrase/models/comment_mark_read_parameters.rb
428
430
  - lib/phrase/models/comment_reaction.rb
429
431
  - lib/phrase/models/comment_update_parameters.rb
432
+ - lib/phrase/models/comments_list_parameters.rb
430
433
  - lib/phrase/models/current_user.rb
431
434
  - lib/phrase/models/distribution.rb
432
435
  - lib/phrase/models/distribution_create_parameters.rb
@@ -535,6 +538,7 @@ files:
535
538
  - lib/phrase/models/release_create_parameters.rb
536
539
  - lib/phrase/models/release_preview.rb
537
540
  - lib/phrase/models/release_update_parameters.rb
541
+ - lib/phrase/models/replies_list_parameters.rb
538
542
  - lib/phrase/models/screenshot.rb
539
543
  - lib/phrase/models/screenshot_create_parameters.rb
540
544
  - lib/phrase/models/screenshot_marker.rb
@@ -683,6 +687,7 @@ files:
683
687
  - spec/models/comment_reaction_spec.rb
684
688
  - spec/models/comment_spec.rb
685
689
  - spec/models/comment_update_parameters_spec.rb
690
+ - spec/models/comments_list_parameters_spec.rb
686
691
  - spec/models/current_user_spec.rb
687
692
  - spec/models/distribution_create_parameters_spec.rb
688
693
  - spec/models/distribution_preview_spec.rb
@@ -791,6 +796,7 @@ files:
791
796
  - spec/models/release_preview_spec.rb
792
797
  - spec/models/release_spec.rb
793
798
  - spec/models/release_update_parameters_spec.rb
799
+ - spec/models/replies_list_parameters_spec.rb
794
800
  - spec/models/screenshot_create_parameters_spec.rb
795
801
  - spec/models/screenshot_marker_create_parameters_spec.rb
796
802
  - spec/models/screenshot_marker_spec.rb
@@ -974,6 +980,7 @@ test_files:
974
980
  - spec/models/subscription_spec.rb
975
981
  - spec/models/teams_projects_create_parameters_spec.rb
976
982
  - spec/models/gitlab_sync_history_spec.rb
983
+ - spec/models/replies_list_parameters_spec.rb
977
984
  - spec/models/team_detail_spec.rb
978
985
  - spec/models/screenshot_update_parameters_spec.rb
979
986
  - spec/models/release_spec.rb
@@ -1028,6 +1035,7 @@ test_files:
1028
1035
  - spec/models/locale_team_preview_spec.rb
1029
1036
  - spec/models/blacklisted_key_spec.rb
1030
1037
  - spec/models/comment_spec.rb
1038
+ - spec/models/comments_list_parameters_spec.rb
1031
1039
  - spec/models/space_spec.rb
1032
1040
  - spec/models/account_spec.rb
1033
1041
  - spec/models/webhook_update_parameters_spec.rb