phrase 3.7.1 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +56 -0
  3. data/README.md +13 -37
  4. data/docs/JobDetails.md +2 -0
  5. data/docs/JobKeysDeleteParameters.md +19 -0
  6. data/docs/JobsApi.md +16 -14
  7. data/docs/KeyCreateParameters.md +1 -1
  8. data/docs/KeyUpdateParameters.md +1 -1
  9. data/docs/KeysApi.md +4 -4
  10. data/docs/KeysExcludeParameters.md +1 -1
  11. data/docs/KeysIncludeParameters.md +1 -1
  12. data/docs/KeysSearchParameters.md +1 -1
  13. data/docs/KeysTagParameters.md +1 -1
  14. data/docs/KeysUntagParameters.md +1 -1
  15. data/docs/LocalesApi.md +3 -1
  16. data/docs/ProjectCreateParameters.md +1 -1
  17. data/docs/ProjectUpdateParameters.md +4 -2
  18. data/docs/QualityPerformanceScoreApi.md +8 -8
  19. data/docs/QualityPerformanceScoreList200Response.md +21 -0
  20. data/docs/QualityPerformanceScoreList200ResponseAnyOf.md +19 -0
  21. data/docs/QualityPerformanceScoreList200ResponseAnyOfData.md +17 -0
  22. data/docs/{ProjectsQualityPerformanceScore200ResponseAnyOfDataTranslationsInner.md → QualityPerformanceScoreList200ResponseAnyOfDataTranslationsInner.md} +2 -2
  23. data/docs/{ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner.md → QualityPerformanceScoreList200ResponseAnyOfErrorsInner.md} +2 -2
  24. data/docs/{ProjectsQualityPerformanceScoreRequest.md → QualityPerformanceScoreListRequest.md} +2 -2
  25. data/docs/RepoSyncEvent.md +3 -3
  26. data/docs/RepoSyncEventsApi.md +138 -0
  27. data/docs/RepoSyncsApi.md +2 -132
  28. data/docs/ScreenshotUpdateParameters.md +1 -1
  29. data/docs/Upload.md +3 -1
  30. data/lib/phrase/api/jobs_api.rb +24 -16
  31. data/lib/phrase/api/keys_api.rb +4 -4
  32. data/lib/phrase/api/locales_api.rb +3 -0
  33. data/lib/phrase/api/quality_performance_score_api.rb +15 -15
  34. data/lib/phrase/api/repo_sync_events_api.rb +160 -0
  35. data/lib/phrase/api/repo_syncs_api.rb +4 -154
  36. data/lib/phrase/models/job_details.rb +10 -1
  37. data/lib/phrase/models/job_keys_delete_parameters.rb +214 -0
  38. data/lib/phrase/models/keys_exclude_parameters.rb +1 -1
  39. data/lib/phrase/models/keys_include_parameters.rb +1 -1
  40. data/lib/phrase/models/keys_search_parameters.rb +1 -1
  41. data/lib/phrase/models/keys_tag_parameters.rb +1 -1
  42. data/lib/phrase/models/keys_untag_parameters.rb +1 -1
  43. data/lib/phrase/models/project_update_parameters.rb +48 -4
  44. data/lib/phrase/models/{projects_quality_performance_score200_response.rb → quality_performance_score_list200_response.rb} +6 -6
  45. data/lib/phrase/models/{projects_quality_performance_score200_response_any_of.rb → quality_performance_score_list200_response_any_of.rb} +5 -5
  46. data/lib/phrase/models/{projects_quality_performance_score200_response_any_of_data.rb → quality_performance_score_list200_response_any_of_data.rb} +4 -4
  47. data/lib/phrase/models/{projects_quality_performance_score200_response_any_of_data_translations_inner.rb → quality_performance_score_list200_response_any_of_data_translations_inner.rb} +3 -3
  48. data/lib/phrase/models/{projects_quality_performance_score200_response_any_of_errors_inner.rb → quality_performance_score_list200_response_any_of_errors_inner.rb} +3 -3
  49. data/lib/phrase/models/{projects_quality_performance_score_request.rb → quality_performance_score_list_request.rb} +3 -3
  50. data/lib/phrase/models/repo_sync_event.rb +15 -15
  51. data/lib/phrase/models/upload.rb +14 -1
  52. data/lib/phrase/version.rb +1 -1
  53. data/lib/phrase.rb +8 -22
  54. data/spec/api/jobs_api_spec.rb +6 -5
  55. data/spec/api/keys_api_spec.rb +2 -2
  56. data/spec/api/quality_performance_score_api_spec.rb +4 -4
  57. data/spec/api/repo_sync_events_api_spec.rb +52 -0
  58. data/spec/api/repo_syncs_api_spec.rb +2 -31
  59. data/spec/models/job_details_spec.rb +6 -0
  60. data/spec/models/{gitlab_sync_export_spec.rb → job_keys_delete_parameters_spec.rb} +8 -8
  61. data/spec/models/project_update_parameters_spec.rb +10 -0
  62. data/spec/models/quality_performance_score_list200_response_any_of_data_spec.rb +29 -0
  63. data/spec/models/{projects_quality_performance_score200_response_any_of_data_translations_inner_spec.rb → quality_performance_score_list200_response_any_of_data_translations_inner_spec.rb} +6 -6
  64. data/spec/models/{projects_quality_performance_score200_response_any_of_errors_inner_spec.rb → quality_performance_score_list200_response_any_of_errors_inner_spec.rb} +6 -6
  65. data/spec/models/{projects_quality_performance_score200_response_any_of_spec.rb → quality_performance_score_list200_response_any_of_spec.rb} +6 -6
  66. data/spec/models/{projects_quality_performance_score200_response_spec.rb → quality_performance_score_list200_response_spec.rb} +6 -6
  67. data/spec/models/{projects_quality_performance_score_request_spec.rb → quality_performance_score_list_request_spec.rb} +6 -6
  68. data/spec/models/repo_sync_event_spec.rb +2 -2
  69. data/spec/models/upload_spec.rb +6 -0
  70. metadata +265 -321
  71. data/docs/BitbucketSync.md +0 -27
  72. data/docs/BitbucketSyncApi.md +0 -197
  73. data/docs/BitbucketSyncExportParameters.md +0 -17
  74. data/docs/BitbucketSyncExportResponse.md +0 -17
  75. data/docs/BitbucketSyncImportParameters.md +0 -17
  76. data/docs/GitHubSyncApi.md +0 -130
  77. data/docs/GitLabSyncApi.md +0 -463
  78. data/docs/GithubSyncExportParameters.md +0 -17
  79. data/docs/GithubSyncImportParameters.md +0 -17
  80. data/docs/GitlabSync.md +0 -37
  81. data/docs/GitlabSyncExport.md +0 -19
  82. data/docs/GitlabSyncExportParameters.md +0 -17
  83. data/docs/GitlabSyncHistory.md +0 -25
  84. data/docs/GitlabSyncHistoryErrorsInner.md +0 -19
  85. data/docs/GitlabSyncImportParameters.md +0 -17
  86. data/docs/ProjectsQualityPerformanceScore200Response.md +0 -21
  87. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOf.md +0 -19
  88. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOfData.md +0 -17
  89. data/docs/RepoSyncEventErrorsInner.md +0 -16
  90. data/lib/phrase/api/bitbucket_sync_api.rb +0 -219
  91. data/lib/phrase/api/git_hub_sync_api.rb +0 -146
  92. data/lib/phrase/api/git_lab_sync_api.rb +0 -510
  93. data/lib/phrase/models/bitbucket_sync.rb +0 -243
  94. data/lib/phrase/models/bitbucket_sync_export_parameters.rb +0 -197
  95. data/lib/phrase/models/bitbucket_sync_export_response.rb +0 -196
  96. data/lib/phrase/models/bitbucket_sync_import_parameters.rb +0 -197
  97. data/lib/phrase/models/github_sync_export_parameters.rb +0 -197
  98. data/lib/phrase/models/github_sync_import_parameters.rb +0 -197
  99. data/lib/phrase/models/gitlab_sync.rb +0 -286
  100. data/lib/phrase/models/gitlab_sync_export.rb +0 -205
  101. data/lib/phrase/models/gitlab_sync_export_parameters.rb +0 -197
  102. data/lib/phrase/models/gitlab_sync_history.rb +0 -234
  103. data/lib/phrase/models/gitlab_sync_history_errors_inner.rb +0 -205
  104. data/lib/phrase/models/gitlab_sync_import_parameters.rb +0 -197
  105. data/lib/phrase/models/repo_sync_event_errors_inner.rb +0 -207
  106. data/spec/api/bitbucket_sync_api_spec.rb +0 -64
  107. data/spec/api/git_hub_sync_api_spec.rb +0 -49
  108. data/spec/api/git_lab_sync_api_spec.rb +0 -125
  109. data/spec/models/bitbucket_sync_export_parameters_spec.rb +0 -29
  110. data/spec/models/bitbucket_sync_export_response_spec.rb +0 -29
  111. data/spec/models/bitbucket_sync_import_parameters_spec.rb +0 -29
  112. data/spec/models/bitbucket_sync_spec.rb +0 -59
  113. data/spec/models/github_sync_export_parameters_spec.rb +0 -29
  114. data/spec/models/github_sync_import_parameters_spec.rb +0 -29
  115. data/spec/models/gitlab_sync_export_parameters_spec.rb +0 -29
  116. data/spec/models/gitlab_sync_history_errors_inner_spec.rb +0 -35
  117. data/spec/models/gitlab_sync_history_spec.rb +0 -53
  118. data/spec/models/gitlab_sync_import_parameters_spec.rb +0 -29
  119. data/spec/models/gitlab_sync_spec.rb +0 -89
  120. data/spec/models/projects_quality_performance_score200_response_any_of_data_spec.rb +0 -29
  121. data/spec/models/repo_sync_event_errors_inner_spec.rb +0 -23
@@ -0,0 +1,214 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class JobKeysDeleteParameters
5
+ # specify the branch to use
6
+ attr_accessor :branch
7
+
8
+ # ids of keys that should be deleted from the job
9
+ attr_accessor :translation_key_ids
10
+
11
+ # Attribute mapping from ruby-style variable name to JSON key.
12
+ def self.attribute_map
13
+ {
14
+ :'branch' => :'branch',
15
+ :'translation_key_ids' => :'translation_key_ids'
16
+ }
17
+ end
18
+
19
+ # Attribute type mapping.
20
+ def self.openapi_types
21
+ {
22
+ :'branch' => :'String',
23
+ :'translation_key_ids' => :'Array<String>'
24
+ }
25
+ end
26
+
27
+ # List of attributes with nullable: true
28
+ def self.openapi_nullable
29
+ Set.new([
30
+ ])
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ if (!attributes.is_a?(Hash))
37
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::JobKeysDeleteParameters` initialize method"
38
+ end
39
+
40
+ # check to see if the attribute exists and convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h|
42
+ if (!self.class.attribute_map.key?(k.to_sym))
43
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::JobKeysDeleteParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
44
+ end
45
+ h[k.to_sym] = v
46
+ }
47
+
48
+ if attributes.key?(:'branch')
49
+ self.branch = attributes[:'branch']
50
+ end
51
+
52
+ if attributes.key?(:'translation_key_ids')
53
+ if (value = attributes[:'translation_key_ids']).is_a?(Array)
54
+ self.translation_key_ids = value
55
+ end
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ if @translation_key_ids.nil?
64
+ invalid_properties.push('invalid value for "translation_key_ids", translation_key_ids cannot be nil.')
65
+ end
66
+
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ return false if @translation_key_ids.nil?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ branch == o.branch &&
83
+ translation_key_ids == o.translation_key_ids
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [branch, translation_key_ids].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :Time
136
+ Time.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ Phrase.const_get(type).build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+ end
214
+ end
@@ -5,7 +5,7 @@ module Phrase
5
5
  # specify the branch to use
6
6
  attr_accessor :branch
7
7
 
8
- # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
8
+ # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id,...</code> to filter keys unmentioned within upload. When multiple upload IDs provided, matches only keys not mentioned in <strong>all</strong> uploads</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
9
9
  attr_accessor :q
10
10
 
11
11
  # Locale used to exlcude or include keys.
@@ -5,7 +5,7 @@ module Phrase
5
5
  # specify the branch to use
6
6
  attr_accessor :branch
7
7
 
8
- # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
8
+ # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id,...</code> to filter keys unmentioned within upload. When multiple upload IDs provided, matches only keys not mentioned in <strong>all</strong> uploads</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
9
9
  attr_accessor :q
10
10
 
11
11
  # Locale used to exlcude or include keys.
@@ -11,7 +11,7 @@ module Phrase
11
11
  # Order direction. Can be one of: asc, desc.
12
12
  attr_accessor :order
13
13
 
14
- # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name,...</code> for text queries on a comma-seperated list of exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name,...</code> to filter for keys with certain comma-seperated list of tags</li> <li><code>uploads:upload_id,...</code> to filter for keys with certain comma-seperated list of uploads</li> <li><code>job:{true|false}</code> to filter for keys mentioned in an active job</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{&gt;=|&lt;=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>. Please note: If <code>tags</code> are added to filter the search, the search will be limited to a maximum of 65,536 tagged keys.
14
+ # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name,...</code> for text queries on a comma-seperated list of exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name,...</code> to filter for keys with certain comma-seperated list of tags</li> <li><code>uploads:upload_id,...</code> to filter for keys with certain comma-seperated list of uploads</li> <li><code>job:{true|false}</code> to filter for keys mentioned in an active job</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{&gt;=|&lt;=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id,...</code> to filter keys unmentioned within upload. When multiple upload IDs provided, matches only keys not mentioned in <strong>all</strong> uploads</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>. Please note: If <code>tags</code> are added to filter the search, the search will be limited to a maximum of 65,536 tagged keys.
15
15
  attr_accessor :q
16
16
 
17
17
  # Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
@@ -5,7 +5,7 @@ module Phrase
5
5
  # specify the branch to use
6
6
  attr_accessor :branch
7
7
 
8
- # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
8
+ # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id,...</code> to filter keys unmentioned within upload. When multiple upload IDs provided, matches only keys not mentioned in <strong>all</strong> uploads</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
9
9
  attr_accessor :q
10
10
 
11
11
  # Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
@@ -5,7 +5,7 @@ module Phrase
5
5
  # specify the branch to use
6
6
  attr_accessor :branch
7
7
 
8
- # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
8
+ # Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id,...</code> to filter keys unmentioned within upload. When multiple upload IDs provided, matches only keys not mentioned in <strong>all</strong> uploads</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
9
9
  attr_accessor :q
10
10
 
11
11
  # Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
@@ -68,6 +68,31 @@ module Phrase
68
68
  # (Optional) Requires autotranslate_enabled to be true
69
69
  attr_accessor :autotranslate_use_translation_memory
70
70
 
71
+ # (Optional) Sets the default encoding for Uploads. If you leave it empty, we will try to guess it automatically for you when you Upload a file. You can still override this value by setting the <a href='#post-/projects/-project_id-/uploads'>`file_encoding`</a> parameter for Uploads.
72
+ attr_accessor :default_encoding
73
+
74
+ class EnumAttributeValidator
75
+ attr_reader :datatype
76
+ attr_reader :allowable_values
77
+
78
+ def initialize(datatype, allowable_values)
79
+ @allowable_values = allowable_values.map do |value|
80
+ case datatype.to_s
81
+ when /Integer/i
82
+ value.to_i
83
+ when /Float/i
84
+ value.to_f
85
+ else
86
+ value
87
+ end
88
+ end
89
+ end
90
+
91
+ def valid?(value)
92
+ !value || allowable_values.include?(value)
93
+ end
94
+ end
95
+
71
96
  # Attribute mapping from ruby-style variable name to JSON key.
72
97
  def self.attribute_map
73
98
  {
@@ -92,7 +117,8 @@ module Phrase
92
117
  :'autotranslate_check_new_locales' => :'autotranslate_check_new_locales',
93
118
  :'autotranslate_mark_as_unverified' => :'autotranslate_mark_as_unverified',
94
119
  :'autotranslate_use_machine_translation' => :'autotranslate_use_machine_translation',
95
- :'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory'
120
+ :'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory',
121
+ :'default_encoding' => :'default_encoding'
96
122
  }
97
123
  end
98
124
 
@@ -120,7 +146,8 @@ module Phrase
120
146
  :'autotranslate_check_new_locales' => :'Boolean',
121
147
  :'autotranslate_mark_as_unverified' => :'Boolean',
122
148
  :'autotranslate_use_machine_translation' => :'Boolean',
123
- :'autotranslate_use_translation_memory' => :'Boolean'
149
+ :'autotranslate_use_translation_memory' => :'Boolean',
150
+ :'default_encoding' => :'String'
124
151
  }
125
152
  end
126
153
 
@@ -232,6 +259,10 @@ module Phrase
232
259
  if attributes.key?(:'autotranslate_use_translation_memory')
233
260
  self.autotranslate_use_translation_memory = attributes[:'autotranslate_use_translation_memory']
234
261
  end
262
+
263
+ if attributes.key?(:'default_encoding')
264
+ self.default_encoding = attributes[:'default_encoding']
265
+ end
235
266
  end
236
267
 
237
268
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -244,9 +275,21 @@ module Phrase
244
275
  # Check to see if the all the properties in the model are valid
245
276
  # @return true if the model is valid
246
277
  def valid?
278
+ default_encoding_validator = EnumAttributeValidator.new('String', ["UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "ISO-8859-1"])
279
+ return false unless default_encoding_validator.valid?(@default_encoding)
247
280
  true
248
281
  end
249
282
 
283
+ # Custom attribute writer method checking allowed values (enum).
284
+ # @param [Object] default_encoding Object to be assigned
285
+ def default_encoding=(default_encoding)
286
+ validator = EnumAttributeValidator.new('String', ["UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "ISO-8859-1"])
287
+ unless validator.valid?(default_encoding)
288
+ fail ArgumentError, "invalid value for \"default_encoding\", must be one of #{validator.allowable_values}."
289
+ end
290
+ @default_encoding = default_encoding
291
+ end
292
+
250
293
  # Checks equality by comparing each attribute.
251
294
  # @param [Object] Object to be compared
252
295
  def ==(o)
@@ -273,7 +316,8 @@ module Phrase
273
316
  autotranslate_check_new_locales == o.autotranslate_check_new_locales &&
274
317
  autotranslate_mark_as_unverified == o.autotranslate_mark_as_unverified &&
275
318
  autotranslate_use_machine_translation == o.autotranslate_use_machine_translation &&
276
- autotranslate_use_translation_memory == o.autotranslate_use_translation_memory
319
+ autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
320
+ default_encoding == o.default_encoding
277
321
  end
278
322
 
279
323
  # @see the `==` method
@@ -285,7 +329,7 @@ module Phrase
285
329
  # Calculates hash code according to all attributes.
286
330
  # @return [Integer] Hash code
287
331
  def hash
288
- [account_id, name, point_of_contact, main_format, media, shares_translation_memory, project_image, remove_project_image, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory].hash
332
+ [account_id, name, point_of_contact, main_format, media, shares_translation_memory, project_image, remove_project_image, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, default_encoding].hash
289
333
  end
290
334
 
291
335
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
 
3
3
  module Phrase
4
- class ProjectsQualityPerformanceScore200Response
4
+ class QualityPerformanceScoreList200Response
5
5
  attr_accessor :error
6
6
 
7
7
  attr_accessor :data
@@ -22,8 +22,8 @@ module Phrase
22
22
  def self.openapi_types
23
23
  {
24
24
  :'error' => :'ErrorError',
25
- :'data' => :'ProjectsQualityPerformanceScore200ResponseAnyOfData',
26
- :'errors' => :'Array<ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner>'
25
+ :'data' => :'QualityPerformanceScoreList200ResponseAnyOfData',
26
+ :'errors' => :'Array<QualityPerformanceScoreList200ResponseAnyOfErrorsInner>'
27
27
  }
28
28
  end
29
29
 
@@ -37,7 +37,7 @@ module Phrase
37
37
  def self.openapi_any_of
38
38
  [
39
39
  :'Error',
40
- :'ProjectsQualityPerformanceScore200ResponseAnyOf'
40
+ :'QualityPerformanceScoreList200ResponseAnyOf'
41
41
  ]
42
42
  end
43
43
 
@@ -45,13 +45,13 @@ module Phrase
45
45
  # @param [Hash] attributes Model attributes in the form of hash
46
46
  def initialize(attributes = {})
47
47
  if (!attributes.is_a?(Hash))
48
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectsQualityPerformanceScore200Response` initialize method"
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::QualityPerformanceScoreList200Response` initialize method"
49
49
  end
50
50
 
51
51
  # check to see if the attribute exists and convert string to symbol for hash key
52
52
  attributes = attributes.each_with_object({}) { |(k, v), h|
53
53
  if (!self.class.attribute_map.key?(k.to_sym))
54
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ProjectsQualityPerformanceScore200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::QualityPerformanceScoreList200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
55
  end
56
56
  h[k.to_sym] = v
57
57
  }
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
 
3
3
  module Phrase
4
- class ProjectsQualityPerformanceScore200ResponseAnyOf
4
+ class QualityPerformanceScoreList200ResponseAnyOf
5
5
  attr_accessor :data
6
6
 
7
7
  # Array of errors for any failing translation IDs
@@ -18,8 +18,8 @@ module Phrase
18
18
  # Attribute type mapping.
19
19
  def self.openapi_types
20
20
  {
21
- :'data' => :'ProjectsQualityPerformanceScore200ResponseAnyOfData',
22
- :'errors' => :'Array<ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner>'
21
+ :'data' => :'QualityPerformanceScoreList200ResponseAnyOfData',
22
+ :'errors' => :'Array<QualityPerformanceScoreList200ResponseAnyOfErrorsInner>'
23
23
  }
24
24
  end
25
25
 
@@ -33,13 +33,13 @@ module Phrase
33
33
  # @param [Hash] attributes Model attributes in the form of hash
34
34
  def initialize(attributes = {})
35
35
  if (!attributes.is_a?(Hash))
36
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOf` initialize method"
36
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::QualityPerformanceScoreList200ResponseAnyOf` initialize method"
37
37
  end
38
38
 
39
39
  # check to see if the attribute exists and convert string to symbol for hash key
40
40
  attributes = attributes.each_with_object({}) { |(k, v), h|
41
41
  if (!self.class.attribute_map.key?(k.to_sym))
42
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
42
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::QualityPerformanceScoreList200ResponseAnyOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
43
43
  end
44
44
  h[k.to_sym] = v
45
45
  }
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
 
3
3
  module Phrase
4
- class ProjectsQualityPerformanceScore200ResponseAnyOfData
4
+ class QualityPerformanceScoreList200ResponseAnyOfData
5
5
  attr_accessor :translations
6
6
 
7
7
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,7 +14,7 @@ module Phrase
14
14
  # Attribute type mapping.
15
15
  def self.openapi_types
16
16
  {
17
- :'translations' => :'Array<ProjectsQualityPerformanceScore200ResponseAnyOfDataTranslationsInner>'
17
+ :'translations' => :'Array<QualityPerformanceScoreList200ResponseAnyOfDataTranslationsInner>'
18
18
  }
19
19
  end
20
20
 
@@ -28,13 +28,13 @@ module Phrase
28
28
  # @param [Hash] attributes Model attributes in the form of hash
29
29
  def initialize(attributes = {})
30
30
  if (!attributes.is_a?(Hash))
31
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOfData` initialize method"
31
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::QualityPerformanceScoreList200ResponseAnyOfData` initialize method"
32
32
  end
33
33
 
34
34
  # check to see if the attribute exists and convert string to symbol for hash key
35
35
  attributes = attributes.each_with_object({}) { |(k, v), h|
36
36
  if (!self.class.attribute_map.key?(k.to_sym))
37
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOfData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
37
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::QualityPerformanceScoreList200ResponseAnyOfData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
38
38
  end
39
39
  h[k.to_sym] = v
40
40
  }
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
 
3
3
  module Phrase
4
- class ProjectsQualityPerformanceScore200ResponseAnyOfDataTranslationsInner
4
+ class QualityPerformanceScoreList200ResponseAnyOfDataTranslationsInner
5
5
  # Engine used for the translation scoring
6
6
  attr_accessor :engine
7
7
 
@@ -39,13 +39,13 @@ module Phrase
39
39
  # @param [Hash] attributes Model attributes in the form of hash
40
40
  def initialize(attributes = {})
41
41
  if (!attributes.is_a?(Hash))
42
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOfDataTranslationsInner` initialize method"
42
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::QualityPerformanceScoreList200ResponseAnyOfDataTranslationsInner` initialize method"
43
43
  end
44
44
 
45
45
  # check to see if the attribute exists and convert string to symbol for hash key
46
46
  attributes = attributes.each_with_object({}) { |(k, v), h|
47
47
  if (!self.class.attribute_map.key?(k.to_sym))
48
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOfDataTranslationsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::QualityPerformanceScoreList200ResponseAnyOfDataTranslationsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
49
49
  end
50
50
  h[k.to_sym] = v
51
51
  }
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
 
3
3
  module Phrase
4
- class ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner
4
+ class QualityPerformanceScoreList200ResponseAnyOfErrorsInner
5
5
  attr_accessor :message
6
6
 
7
7
  attr_accessor :code
@@ -37,13 +37,13 @@ module Phrase
37
37
  # @param [Hash] attributes Model attributes in the form of hash
38
38
  def initialize(attributes = {})
39
39
  if (!attributes.is_a?(Hash))
40
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner` initialize method"
40
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::QualityPerformanceScoreList200ResponseAnyOfErrorsInner` initialize method"
41
41
  end
42
42
 
43
43
  # check to see if the attribute exists and convert string to symbol for hash key
44
44
  attributes = attributes.each_with_object({}) { |(k, v), h|
45
45
  if (!self.class.attribute_map.key?(k.to_sym))
46
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
46
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::QualityPerformanceScoreList200ResponseAnyOfErrorsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
47
47
  end
48
48
  h[k.to_sym] = v
49
49
  }
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
 
3
3
  module Phrase
4
- class ProjectsQualityPerformanceScoreRequest
4
+ class QualityPerformanceScoreListRequest
5
5
  # Translation ids you want to get the quality performance score for
6
6
  attr_accessor :translation_ids
7
7
 
@@ -29,13 +29,13 @@ module Phrase
29
29
  # @param [Hash] attributes Model attributes in the form of hash
30
30
  def initialize(attributes = {})
31
31
  if (!attributes.is_a?(Hash))
32
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectsQualityPerformanceScoreRequest` initialize method"
32
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::QualityPerformanceScoreListRequest` initialize method"
33
33
  end
34
34
 
35
35
  # check to see if the attribute exists and convert string to symbol for hash key
36
36
  attributes = attributes.each_with_object({}) { |(k, v), h|
37
37
  if (!self.class.attribute_map.key?(k.to_sym))
38
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ProjectsQualityPerformanceScoreRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
38
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::QualityPerformanceScoreListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
39
39
  end
40
40
  h[k.to_sym] = v
41
41
  }