phrase 3.7.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +63 -0
  3. data/README.md +13 -37
  4. data/docs/AccountDetails.md +3 -1
  5. data/docs/JobDetails.md +2 -0
  6. data/docs/JobKeysDeleteParameters.md +19 -0
  7. data/docs/JobsApi.md +16 -14
  8. data/docs/KeyCreateParameters.md +1 -1
  9. data/docs/KeyUpdateParameters.md +1 -1
  10. data/docs/KeysApi.md +4 -4
  11. data/docs/KeysExcludeParameters.md +1 -1
  12. data/docs/KeysIncludeParameters.md +1 -1
  13. data/docs/KeysSearchParameters.md +1 -1
  14. data/docs/KeysTagParameters.md +1 -1
  15. data/docs/KeysUntagParameters.md +1 -1
  16. data/docs/LocalesApi.md +3 -1
  17. data/docs/ProjectCreateParameters.md +1 -1
  18. data/docs/ProjectUpdateParameters.md +4 -2
  19. data/docs/QualityPerformanceScoreApi.md +8 -8
  20. data/docs/QualityPerformanceScoreList200Response.md +21 -0
  21. data/docs/QualityPerformanceScoreList200ResponseAnyOf.md +19 -0
  22. data/docs/QualityPerformanceScoreList200ResponseAnyOfData.md +17 -0
  23. data/docs/{ProjectsQualityPerformanceScore200ResponseAnyOfDataTranslationsInner.md → QualityPerformanceScoreList200ResponseAnyOfDataTranslationsInner.md} +2 -2
  24. data/docs/{ProjectsQualityPerformanceScore200ResponseAnyOfErrorsInner.md → QualityPerformanceScoreList200ResponseAnyOfErrorsInner.md} +2 -2
  25. data/docs/{ProjectsQualityPerformanceScoreRequest.md → QualityPerformanceScoreListRequest.md} +2 -2
  26. data/docs/RepoSyncEvent.md +3 -3
  27. data/docs/RepoSyncEventsApi.md +138 -0
  28. data/docs/RepoSyncsApi.md +2 -132
  29. data/docs/ScreenshotUpdateParameters.md +1 -1
  30. data/docs/Upload.md +3 -1
  31. data/lib/phrase/api/jobs_api.rb +24 -16
  32. data/lib/phrase/api/keys_api.rb +4 -4
  33. data/lib/phrase/api/locales_api.rb +3 -0
  34. data/lib/phrase/api/quality_performance_score_api.rb +15 -15
  35. data/lib/phrase/api/repo_sync_events_api.rb +160 -0
  36. data/lib/phrase/api/repo_syncs_api.rb +4 -154
  37. data/lib/phrase/models/account_details.rb +15 -4
  38. data/lib/phrase/models/job_details.rb +10 -1
  39. data/lib/phrase/models/job_keys_delete_parameters.rb +214 -0
  40. data/lib/phrase/models/keys_exclude_parameters.rb +1 -1
  41. data/lib/phrase/models/keys_include_parameters.rb +1 -1
  42. data/lib/phrase/models/keys_search_parameters.rb +1 -1
  43. data/lib/phrase/models/keys_tag_parameters.rb +1 -1
  44. data/lib/phrase/models/keys_untag_parameters.rb +1 -1
  45. data/lib/phrase/models/project_update_parameters.rb +48 -4
  46. data/lib/phrase/models/{projects_quality_performance_score200_response.rb → quality_performance_score_list200_response.rb} +6 -6
  47. data/lib/phrase/models/{projects_quality_performance_score200_response_any_of.rb → quality_performance_score_list200_response_any_of.rb} +5 -5
  48. data/lib/phrase/models/{projects_quality_performance_score200_response_any_of_data.rb → quality_performance_score_list200_response_any_of_data.rb} +4 -4
  49. 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
  50. 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
  51. data/lib/phrase/models/{projects_quality_performance_score_request.rb → quality_performance_score_list_request.rb} +3 -3
  52. data/lib/phrase/models/repo_sync_event.rb +15 -15
  53. data/lib/phrase/models/upload.rb +14 -1
  54. data/lib/phrase/version.rb +1 -1
  55. data/lib/phrase.rb +8 -22
  56. data/spec/api/jobs_api_spec.rb +6 -5
  57. data/spec/api/keys_api_spec.rb +2 -2
  58. data/spec/api/quality_performance_score_api_spec.rb +4 -4
  59. data/spec/api/repo_sync_events_api_spec.rb +52 -0
  60. data/spec/api/repo_syncs_api_spec.rb +2 -31
  61. data/spec/models/account_details_spec.rb +6 -0
  62. data/spec/models/job_details_spec.rb +6 -0
  63. data/spec/models/{gitlab_sync_export_spec.rb → job_keys_delete_parameters_spec.rb} +8 -8
  64. data/spec/models/project_update_parameters_spec.rb +10 -0
  65. data/spec/models/quality_performance_score_list200_response_any_of_data_spec.rb +29 -0
  66. 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
  67. 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
  68. data/spec/models/{projects_quality_performance_score200_response_any_of_spec.rb → quality_performance_score_list200_response_any_of_spec.rb} +6 -6
  69. data/spec/models/{projects_quality_performance_score200_response_spec.rb → quality_performance_score_list200_response_spec.rb} +6 -6
  70. data/spec/models/{projects_quality_performance_score_request_spec.rb → quality_performance_score_list_request_spec.rb} +6 -6
  71. data/spec/models/repo_sync_event_spec.rb +2 -2
  72. data/spec/models/upload_spec.rb +6 -0
  73. metadata +259 -315
  74. data/docs/BitbucketSync.md +0 -27
  75. data/docs/BitbucketSyncApi.md +0 -197
  76. data/docs/BitbucketSyncExportParameters.md +0 -17
  77. data/docs/BitbucketSyncExportResponse.md +0 -17
  78. data/docs/BitbucketSyncImportParameters.md +0 -17
  79. data/docs/GitHubSyncApi.md +0 -130
  80. data/docs/GitLabSyncApi.md +0 -463
  81. data/docs/GithubSyncExportParameters.md +0 -17
  82. data/docs/GithubSyncImportParameters.md +0 -17
  83. data/docs/GitlabSync.md +0 -37
  84. data/docs/GitlabSyncExport.md +0 -19
  85. data/docs/GitlabSyncExportParameters.md +0 -17
  86. data/docs/GitlabSyncHistory.md +0 -25
  87. data/docs/GitlabSyncHistoryErrorsInner.md +0 -19
  88. data/docs/GitlabSyncImportParameters.md +0 -17
  89. data/docs/ProjectsQualityPerformanceScore200Response.md +0 -21
  90. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOf.md +0 -19
  91. data/docs/ProjectsQualityPerformanceScore200ResponseAnyOfData.md +0 -17
  92. data/docs/RepoSyncEventErrorsInner.md +0 -16
  93. data/lib/phrase/api/bitbucket_sync_api.rb +0 -219
  94. data/lib/phrase/api/git_hub_sync_api.rb +0 -146
  95. data/lib/phrase/api/git_lab_sync_api.rb +0 -510
  96. data/lib/phrase/models/bitbucket_sync.rb +0 -243
  97. data/lib/phrase/models/bitbucket_sync_export_parameters.rb +0 -197
  98. data/lib/phrase/models/bitbucket_sync_export_response.rb +0 -196
  99. data/lib/phrase/models/bitbucket_sync_import_parameters.rb +0 -197
  100. data/lib/phrase/models/github_sync_export_parameters.rb +0 -197
  101. data/lib/phrase/models/github_sync_import_parameters.rb +0 -197
  102. data/lib/phrase/models/gitlab_sync.rb +0 -286
  103. data/lib/phrase/models/gitlab_sync_export.rb +0 -205
  104. data/lib/phrase/models/gitlab_sync_export_parameters.rb +0 -197
  105. data/lib/phrase/models/gitlab_sync_history.rb +0 -234
  106. data/lib/phrase/models/gitlab_sync_history_errors_inner.rb +0 -205
  107. data/lib/phrase/models/gitlab_sync_import_parameters.rb +0 -197
  108. data/lib/phrase/models/repo_sync_event_errors_inner.rb +0 -207
  109. data/spec/api/bitbucket_sync_api_spec.rb +0 -64
  110. data/spec/api/git_hub_sync_api_spec.rb +0 -49
  111. data/spec/api/git_lab_sync_api_spec.rb +0 -125
  112. data/spec/models/bitbucket_sync_export_parameters_spec.rb +0 -29
  113. data/spec/models/bitbucket_sync_export_response_spec.rb +0 -29
  114. data/spec/models/bitbucket_sync_import_parameters_spec.rb +0 -29
  115. data/spec/models/bitbucket_sync_spec.rb +0 -59
  116. data/spec/models/github_sync_export_parameters_spec.rb +0 -29
  117. data/spec/models/github_sync_import_parameters_spec.rb +0 -29
  118. data/spec/models/gitlab_sync_export_parameters_spec.rb +0 -29
  119. data/spec/models/gitlab_sync_history_errors_inner_spec.rb +0 -35
  120. data/spec/models/gitlab_sync_history_spec.rb +0 -53
  121. data/spec/models/gitlab_sync_import_parameters_spec.rb +0 -29
  122. data/spec/models/gitlab_sync_spec.rb +0 -89
  123. data/spec/models/projects_quality_performance_score200_response_any_of_data_spec.rb +0 -29
  124. data/spec/models/repo_sync_event_errors_inner_spec.rb +0 -23
@@ -1,286 +0,0 @@
1
- require 'date'
2
-
3
- module Phrase
4
- class GitlabSync
5
- attr_accessor :id
6
-
7
- attr_accessor :project_id
8
-
9
- attr_accessor :gitlab_project_id
10
-
11
- attr_accessor :gitlab_branch_name
12
-
13
- attr_accessor :auto_import
14
-
15
- attr_accessor :auto_import_secret
16
-
17
- attr_accessor :auto_import_url
18
-
19
- attr_accessor :self_hosted_api_url
20
-
21
- attr_accessor :last_exported_at
22
-
23
- attr_accessor :last_imported_at
24
-
25
- attr_accessor :last_status
26
-
27
- # Attribute mapping from ruby-style variable name to JSON key.
28
- def self.attribute_map
29
- {
30
- :'id' => :'id',
31
- :'project_id' => :'project_id',
32
- :'gitlab_project_id' => :'gitlab_project_id',
33
- :'gitlab_branch_name' => :'gitlab_branch_name',
34
- :'auto_import' => :'auto_import',
35
- :'auto_import_secret' => :'auto_import_secret',
36
- :'auto_import_url' => :'auto_import_url',
37
- :'self_hosted_api_url' => :'self_hosted_api_url',
38
- :'last_exported_at' => :'last_exported_at',
39
- :'last_imported_at' => :'last_imported_at',
40
- :'last_status' => :'last_status'
41
- }
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.openapi_types
46
- {
47
- :'id' => :'String',
48
- :'project_id' => :'String',
49
- :'gitlab_project_id' => :'Integer',
50
- :'gitlab_branch_name' => :'String',
51
- :'auto_import' => :'Boolean',
52
- :'auto_import_secret' => :'String',
53
- :'auto_import_url' => :'String',
54
- :'self_hosted_api_url' => :'String',
55
- :'last_exported_at' => :'DateTime',
56
- :'last_imported_at' => :'DateTime',
57
- :'last_status' => :'String'
58
- }
59
- end
60
-
61
- # List of attributes with nullable: true
62
- def self.openapi_nullable
63
- Set.new([
64
- ])
65
- end
66
-
67
- # Initializes the object
68
- # @param [Hash] attributes Model attributes in the form of hash
69
- def initialize(attributes = {})
70
- if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::GitlabSync` initialize method"
72
- end
73
-
74
- # check to see if the attribute exists and convert string to symbol for hash key
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!self.class.attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::GitlabSync`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'id')
83
- self.id = attributes[:'id']
84
- end
85
-
86
- if attributes.key?(:'project_id')
87
- self.project_id = attributes[:'project_id']
88
- end
89
-
90
- if attributes.key?(:'gitlab_project_id')
91
- self.gitlab_project_id = attributes[:'gitlab_project_id']
92
- end
93
-
94
- if attributes.key?(:'gitlab_branch_name')
95
- self.gitlab_branch_name = attributes[:'gitlab_branch_name']
96
- end
97
-
98
- if attributes.key?(:'auto_import')
99
- self.auto_import = attributes[:'auto_import']
100
- end
101
-
102
- if attributes.key?(:'auto_import_secret')
103
- self.auto_import_secret = attributes[:'auto_import_secret']
104
- end
105
-
106
- if attributes.key?(:'auto_import_url')
107
- self.auto_import_url = attributes[:'auto_import_url']
108
- end
109
-
110
- if attributes.key?(:'self_hosted_api_url')
111
- self.self_hosted_api_url = attributes[:'self_hosted_api_url']
112
- end
113
-
114
- if attributes.key?(:'last_exported_at')
115
- self.last_exported_at = attributes[:'last_exported_at']
116
- end
117
-
118
- if attributes.key?(:'last_imported_at')
119
- self.last_imported_at = attributes[:'last_imported_at']
120
- end
121
-
122
- if attributes.key?(:'last_status')
123
- self.last_status = attributes[:'last_status']
124
- end
125
- end
126
-
127
- # Show invalid properties with the reasons. Usually used together with valid?
128
- # @return Array for valid properties with the reasons
129
- def list_invalid_properties
130
- invalid_properties = Array.new
131
- invalid_properties
132
- end
133
-
134
- # Check to see if the all the properties in the model are valid
135
- # @return true if the model is valid
136
- def valid?
137
- true
138
- end
139
-
140
- # Checks equality by comparing each attribute.
141
- # @param [Object] Object to be compared
142
- def ==(o)
143
- return true if self.equal?(o)
144
- self.class == o.class &&
145
- id == o.id &&
146
- project_id == o.project_id &&
147
- gitlab_project_id == o.gitlab_project_id &&
148
- gitlab_branch_name == o.gitlab_branch_name &&
149
- auto_import == o.auto_import &&
150
- auto_import_secret == o.auto_import_secret &&
151
- auto_import_url == o.auto_import_url &&
152
- self_hosted_api_url == o.self_hosted_api_url &&
153
- last_exported_at == o.last_exported_at &&
154
- last_imported_at == o.last_imported_at &&
155
- last_status == o.last_status
156
- end
157
-
158
- # @see the `==` method
159
- # @param [Object] Object to be compared
160
- def eql?(o)
161
- self == o
162
- end
163
-
164
- # Calculates hash code according to all attributes.
165
- # @return [Integer] Hash code
166
- def hash
167
- [id, project_id, gitlab_project_id, gitlab_branch_name, auto_import, auto_import_secret, auto_import_url, self_hosted_api_url, last_exported_at, last_imported_at, last_status].hash
168
- end
169
-
170
- # Builds the object from hash
171
- # @param [Hash] attributes Model attributes in the form of hash
172
- # @return [Object] Returns the model itself
173
- def self.build_from_hash(attributes)
174
- new.build_from_hash(attributes)
175
- end
176
-
177
- # Builds the object from hash
178
- # @param [Hash] attributes Model attributes in the form of hash
179
- # @return [Object] Returns the model itself
180
- def build_from_hash(attributes)
181
- return nil unless attributes.is_a?(Hash)
182
- self.class.openapi_types.each_pair do |key, type|
183
- if type =~ /\AArray<(.*)>/i
184
- # check to ensure the input is an array given that the attribute
185
- # is documented as an array but the input is not
186
- if attributes[self.class.attribute_map[key]].is_a?(Array)
187
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
188
- end
189
- elsif !attributes[self.class.attribute_map[key]].nil?
190
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
- end # or else data not found in attributes(hash), not an issue as the data can be optional
192
- end
193
-
194
- self
195
- end
196
-
197
- # Deserializes the data based on type
198
- # @param string type Data type
199
- # @param string value Value to be deserialized
200
- # @return [Object] Deserialized data
201
- def _deserialize(type, value)
202
- case type.to_sym
203
- when :DateTime
204
- DateTime.parse(value)
205
- when :Date
206
- Date.parse(value)
207
- when :Time
208
- Time.parse(value)
209
- when :String
210
- value.to_s
211
- when :Integer
212
- value.to_i
213
- when :Float
214
- value.to_f
215
- when :Boolean
216
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
- true
218
- else
219
- false
220
- end
221
- when :Object
222
- # generic object (usually a Hash), return directly
223
- value
224
- when /\AArray<(?<inner_type>.+)>\z/
225
- inner_type = Regexp.last_match[:inner_type]
226
- value.map { |v| _deserialize(inner_type, v) }
227
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
228
- k_type = Regexp.last_match[:k_type]
229
- v_type = Regexp.last_match[:v_type]
230
- {}.tap do |hash|
231
- value.each do |k, v|
232
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
233
- end
234
- end
235
- else # model
236
- Phrase.const_get(type).build_from_hash(value)
237
- end
238
- end
239
-
240
- # Returns the string representation of the object
241
- # @return [String] String presentation of the object
242
- def to_s
243
- to_hash.to_s
244
- end
245
-
246
- # to_body is an alias to to_hash (backward compatibility)
247
- # @return [Hash] Returns the object in the form of hash
248
- def to_body
249
- to_hash
250
- end
251
-
252
- # Returns the object in the form of hash
253
- # @return [Hash] Returns the object in the form of hash
254
- def to_hash
255
- hash = {}
256
- self.class.attribute_map.each_pair do |attr, param|
257
- value = self.send(attr)
258
- if value.nil?
259
- is_nullable = self.class.openapi_nullable.include?(attr)
260
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
261
- end
262
-
263
- hash[param] = _to_hash(value)
264
- end
265
- hash
266
- end
267
-
268
- # Outputs non-array value in the form of hash
269
- # For object, use to_hash. Otherwise, just return the value
270
- # @param [Object] value Any valid value
271
- # @return [Hash] Returns the value in the form of hash
272
- def _to_hash(value)
273
- if value.is_a?(Array)
274
- value.compact.map { |v| _to_hash(v) }
275
- elsif value.is_a?(Hash)
276
- {}.tap do |hash|
277
- value.each { |k, v| hash[k] = _to_hash(v) }
278
- end
279
- elsif value.respond_to? :to_hash
280
- value.to_hash
281
- else
282
- value
283
- end
284
- end
285
- end
286
- end
@@ -1,205 +0,0 @@
1
- require 'date'
2
-
3
- module Phrase
4
- class GitlabSyncExport
5
- attr_accessor :merge_request_id
6
-
7
- attr_accessor :merge_request_web_url
8
-
9
- # Attribute mapping from ruby-style variable name to JSON key.
10
- def self.attribute_map
11
- {
12
- :'merge_request_id' => :'merge_request_id',
13
- :'merge_request_web_url' => :'merge_request_web_url'
14
- }
15
- end
16
-
17
- # Attribute type mapping.
18
- def self.openapi_types
19
- {
20
- :'merge_request_id' => :'Integer',
21
- :'merge_request_web_url' => :'String'
22
- }
23
- end
24
-
25
- # List of attributes with nullable: true
26
- def self.openapi_nullable
27
- Set.new([
28
- ])
29
- end
30
-
31
- # Initializes the object
32
- # @param [Hash] attributes Model attributes in the form of hash
33
- def initialize(attributes = {})
34
- if (!attributes.is_a?(Hash))
35
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::GitlabSyncExport` initialize method"
36
- end
37
-
38
- # check to see if the attribute exists and convert string to symbol for hash key
39
- attributes = attributes.each_with_object({}) { |(k, v), h|
40
- if (!self.class.attribute_map.key?(k.to_sym))
41
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::GitlabSyncExport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
42
- end
43
- h[k.to_sym] = v
44
- }
45
-
46
- if attributes.key?(:'merge_request_id')
47
- self.merge_request_id = attributes[:'merge_request_id']
48
- end
49
-
50
- if attributes.key?(:'merge_request_web_url')
51
- self.merge_request_web_url = attributes[:'merge_request_web_url']
52
- end
53
- end
54
-
55
- # Show invalid properties with the reasons. Usually used together with valid?
56
- # @return Array for valid properties with the reasons
57
- def list_invalid_properties
58
- invalid_properties = Array.new
59
- invalid_properties
60
- end
61
-
62
- # Check to see if the all the properties in the model are valid
63
- # @return true if the model is valid
64
- def valid?
65
- true
66
- end
67
-
68
- # Checks equality by comparing each attribute.
69
- # @param [Object] Object to be compared
70
- def ==(o)
71
- return true if self.equal?(o)
72
- self.class == o.class &&
73
- merge_request_id == o.merge_request_id &&
74
- merge_request_web_url == o.merge_request_web_url
75
- end
76
-
77
- # @see the `==` method
78
- # @param [Object] Object to be compared
79
- def eql?(o)
80
- self == o
81
- end
82
-
83
- # Calculates hash code according to all attributes.
84
- # @return [Integer] Hash code
85
- def hash
86
- [merge_request_id, merge_request_web_url].hash
87
- end
88
-
89
- # Builds the object from hash
90
- # @param [Hash] attributes Model attributes in the form of hash
91
- # @return [Object] Returns the model itself
92
- def self.build_from_hash(attributes)
93
- new.build_from_hash(attributes)
94
- end
95
-
96
- # Builds the object from hash
97
- # @param [Hash] attributes Model attributes in the form of hash
98
- # @return [Object] Returns the model itself
99
- def build_from_hash(attributes)
100
- return nil unless attributes.is_a?(Hash)
101
- self.class.openapi_types.each_pair do |key, type|
102
- if type =~ /\AArray<(.*)>/i
103
- # check to ensure the input is an array given that the attribute
104
- # is documented as an array but the input is not
105
- if attributes[self.class.attribute_map[key]].is_a?(Array)
106
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
107
- end
108
- elsif !attributes[self.class.attribute_map[key]].nil?
109
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
110
- end # or else data not found in attributes(hash), not an issue as the data can be optional
111
- end
112
-
113
- self
114
- end
115
-
116
- # Deserializes the data based on type
117
- # @param string type Data type
118
- # @param string value Value to be deserialized
119
- # @return [Object] Deserialized data
120
- def _deserialize(type, value)
121
- case type.to_sym
122
- when :DateTime
123
- DateTime.parse(value)
124
- when :Date
125
- Date.parse(value)
126
- when :Time
127
- Time.parse(value)
128
- when :String
129
- value.to_s
130
- when :Integer
131
- value.to_i
132
- when :Float
133
- value.to_f
134
- when :Boolean
135
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
136
- true
137
- else
138
- false
139
- end
140
- when :Object
141
- # generic object (usually a Hash), return directly
142
- value
143
- when /\AArray<(?<inner_type>.+)>\z/
144
- inner_type = Regexp.last_match[:inner_type]
145
- value.map { |v| _deserialize(inner_type, v) }
146
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
147
- k_type = Regexp.last_match[:k_type]
148
- v_type = Regexp.last_match[:v_type]
149
- {}.tap do |hash|
150
- value.each do |k, v|
151
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
152
- end
153
- end
154
- else # model
155
- Phrase.const_get(type).build_from_hash(value)
156
- end
157
- end
158
-
159
- # Returns the string representation of the object
160
- # @return [String] String presentation of the object
161
- def to_s
162
- to_hash.to_s
163
- end
164
-
165
- # to_body is an alias to to_hash (backward compatibility)
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_body
168
- to_hash
169
- end
170
-
171
- # Returns the object in the form of hash
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_hash
174
- hash = {}
175
- self.class.attribute_map.each_pair do |attr, param|
176
- value = self.send(attr)
177
- if value.nil?
178
- is_nullable = self.class.openapi_nullable.include?(attr)
179
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
180
- end
181
-
182
- hash[param] = _to_hash(value)
183
- end
184
- hash
185
- end
186
-
187
- # Outputs non-array value in the form of hash
188
- # For object, use to_hash. Otherwise, just return the value
189
- # @param [Object] value Any valid value
190
- # @return [Hash] Returns the value in the form of hash
191
- def _to_hash(value)
192
- if value.is_a?(Array)
193
- value.compact.map { |v| _to_hash(v) }
194
- elsif value.is_a?(Hash)
195
- {}.tap do |hash|
196
- value.each { |k, v| hash[k] = _to_hash(v) }
197
- end
198
- elsif value.respond_to? :to_hash
199
- value.to_hash
200
- else
201
- value
202
- end
203
- end
204
- end
205
- end
@@ -1,197 +0,0 @@
1
- require 'date'
2
-
3
- module Phrase
4
- class GitlabSyncExportParameters
5
- # Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts.
6
- attr_accessor :account_id
7
-
8
- # Attribute mapping from ruby-style variable name to JSON key.
9
- def self.attribute_map
10
- {
11
- :'account_id' => :'account_id'
12
- }
13
- end
14
-
15
- # Attribute type mapping.
16
- def self.openapi_types
17
- {
18
- :'account_id' => :'String'
19
- }
20
- end
21
-
22
- # List of attributes with nullable: true
23
- def self.openapi_nullable
24
- Set.new([
25
- ])
26
- end
27
-
28
- # Initializes the object
29
- # @param [Hash] attributes Model attributes in the form of hash
30
- def initialize(attributes = {})
31
- if (!attributes.is_a?(Hash))
32
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::GitlabSyncExportParameters` initialize method"
33
- end
34
-
35
- # check to see if the attribute exists and convert string to symbol for hash key
36
- attributes = attributes.each_with_object({}) { |(k, v), h|
37
- if (!self.class.attribute_map.key?(k.to_sym))
38
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::GitlabSyncExportParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
39
- end
40
- h[k.to_sym] = v
41
- }
42
-
43
- if attributes.key?(:'account_id')
44
- self.account_id = attributes[:'account_id']
45
- end
46
- end
47
-
48
- # Show invalid properties with the reasons. Usually used together with valid?
49
- # @return Array for valid properties with the reasons
50
- def list_invalid_properties
51
- invalid_properties = Array.new
52
- invalid_properties
53
- end
54
-
55
- # Check to see if the all the properties in the model are valid
56
- # @return true if the model is valid
57
- def valid?
58
- true
59
- end
60
-
61
- # Checks equality by comparing each attribute.
62
- # @param [Object] Object to be compared
63
- def ==(o)
64
- return true if self.equal?(o)
65
- self.class == o.class &&
66
- account_id == o.account_id
67
- end
68
-
69
- # @see the `==` method
70
- # @param [Object] Object to be compared
71
- def eql?(o)
72
- self == o
73
- end
74
-
75
- # Calculates hash code according to all attributes.
76
- # @return [Integer] Hash code
77
- def hash
78
- [account_id].hash
79
- end
80
-
81
- # Builds the object from hash
82
- # @param [Hash] attributes Model attributes in the form of hash
83
- # @return [Object] Returns the model itself
84
- def self.build_from_hash(attributes)
85
- new.build_from_hash(attributes)
86
- end
87
-
88
- # Builds the object from hash
89
- # @param [Hash] attributes Model attributes in the form of hash
90
- # @return [Object] Returns the model itself
91
- def build_from_hash(attributes)
92
- return nil unless attributes.is_a?(Hash)
93
- self.class.openapi_types.each_pair do |key, type|
94
- if type =~ /\AArray<(.*)>/i
95
- # check to ensure the input is an array given that the attribute
96
- # is documented as an array but the input is not
97
- if attributes[self.class.attribute_map[key]].is_a?(Array)
98
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
- end
100
- elsif !attributes[self.class.attribute_map[key]].nil?
101
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
- end # or else data not found in attributes(hash), not an issue as the data can be optional
103
- end
104
-
105
- self
106
- end
107
-
108
- # Deserializes the data based on type
109
- # @param string type Data type
110
- # @param string value Value to be deserialized
111
- # @return [Object] Deserialized data
112
- def _deserialize(type, value)
113
- case type.to_sym
114
- when :DateTime
115
- DateTime.parse(value)
116
- when :Date
117
- Date.parse(value)
118
- when :Time
119
- Time.parse(value)
120
- when :String
121
- value.to_s
122
- when :Integer
123
- value.to_i
124
- when :Float
125
- value.to_f
126
- when :Boolean
127
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
- true
129
- else
130
- false
131
- end
132
- when :Object
133
- # generic object (usually a Hash), return directly
134
- value
135
- when /\AArray<(?<inner_type>.+)>\z/
136
- inner_type = Regexp.last_match[:inner_type]
137
- value.map { |v| _deserialize(inner_type, v) }
138
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
- k_type = Regexp.last_match[:k_type]
140
- v_type = Regexp.last_match[:v_type]
141
- {}.tap do |hash|
142
- value.each do |k, v|
143
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
- end
145
- end
146
- else # model
147
- Phrase.const_get(type).build_from_hash(value)
148
- end
149
- end
150
-
151
- # Returns the string representation of the object
152
- # @return [String] String presentation of the object
153
- def to_s
154
- to_hash.to_s
155
- end
156
-
157
- # to_body is an alias to to_hash (backward compatibility)
158
- # @return [Hash] Returns the object in the form of hash
159
- def to_body
160
- to_hash
161
- end
162
-
163
- # Returns the object in the form of hash
164
- # @return [Hash] Returns the object in the form of hash
165
- def to_hash
166
- hash = {}
167
- self.class.attribute_map.each_pair do |attr, param|
168
- value = self.send(attr)
169
- if value.nil?
170
- is_nullable = self.class.openapi_nullable.include?(attr)
171
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
172
- end
173
-
174
- hash[param] = _to_hash(value)
175
- end
176
- hash
177
- end
178
-
179
- # Outputs non-array value in the form of hash
180
- # For object, use to_hash. Otherwise, just return the value
181
- # @param [Object] value Any valid value
182
- # @return [Hash] Returns the value in the form of hash
183
- def _to_hash(value)
184
- if value.is_a?(Array)
185
- value.compact.map { |v| _to_hash(v) }
186
- elsif value.is_a?(Hash)
187
- {}.tap do |hash|
188
- value.each { |k, v| hash[k] = _to_hash(v) }
189
- end
190
- elsif value.respond_to? :to_hash
191
- value.to_hash
192
- else
193
- value
194
- end
195
- end
196
- end
197
- end