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,243 +0,0 @@
1
- require 'date'
2
-
3
- module Phrase
4
- class BitbucketSync
5
- attr_accessor :id
6
-
7
- attr_accessor :repository_name
8
-
9
- attr_accessor :last_export_to_bitbucket_at
10
-
11
- attr_accessor :last_import_from_bitbucket_at
12
-
13
- attr_accessor :valid_phraseapp_yaml
14
-
15
- attr_accessor :phraseapp_projects
16
-
17
- # Attribute mapping from ruby-style variable name to JSON key.
18
- def self.attribute_map
19
- {
20
- :'id' => :'id',
21
- :'repository_name' => :'repository_name',
22
- :'last_export_to_bitbucket_at' => :'last_export_to_bitbucket_at',
23
- :'last_import_from_bitbucket_at' => :'last_import_from_bitbucket_at',
24
- :'valid_phraseapp_yaml' => :'valid_phraseapp_yaml',
25
- :'phraseapp_projects' => :'phraseapp_projects'
26
- }
27
- end
28
-
29
- # Attribute type mapping.
30
- def self.openapi_types
31
- {
32
- :'id' => :'String',
33
- :'repository_name' => :'String',
34
- :'last_export_to_bitbucket_at' => :'DateTime',
35
- :'last_import_from_bitbucket_at' => :'DateTime',
36
- :'valid_phraseapp_yaml' => :'Boolean',
37
- :'phraseapp_projects' => :'Array<ProjectShort>'
38
- }
39
- end
40
-
41
- # List of attributes with nullable: true
42
- def self.openapi_nullable
43
- Set.new([
44
- ])
45
- end
46
-
47
- # Initializes the object
48
- # @param [Hash] attributes Model attributes in the form of hash
49
- def initialize(attributes = {})
50
- if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::BitbucketSync` initialize method"
52
- end
53
-
54
- # check to see if the attribute exists and convert string to symbol for hash key
55
- attributes = attributes.each_with_object({}) { |(k, v), h|
56
- if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::BitbucketSync`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
- end
59
- h[k.to_sym] = v
60
- }
61
-
62
- if attributes.key?(:'id')
63
- self.id = attributes[:'id']
64
- end
65
-
66
- if attributes.key?(:'repository_name')
67
- self.repository_name = attributes[:'repository_name']
68
- end
69
-
70
- if attributes.key?(:'last_export_to_bitbucket_at')
71
- self.last_export_to_bitbucket_at = attributes[:'last_export_to_bitbucket_at']
72
- end
73
-
74
- if attributes.key?(:'last_import_from_bitbucket_at')
75
- self.last_import_from_bitbucket_at = attributes[:'last_import_from_bitbucket_at']
76
- end
77
-
78
- if attributes.key?(:'valid_phraseapp_yaml')
79
- self.valid_phraseapp_yaml = attributes[:'valid_phraseapp_yaml']
80
- end
81
-
82
- if attributes.key?(:'phraseapp_projects')
83
- if (value = attributes[:'phraseapp_projects']).is_a?(Array)
84
- self.phraseapp_projects = value
85
- end
86
- end
87
- end
88
-
89
- # Show invalid properties with the reasons. Usually used together with valid?
90
- # @return Array for valid properties with the reasons
91
- def list_invalid_properties
92
- invalid_properties = Array.new
93
- invalid_properties
94
- end
95
-
96
- # Check to see if the all the properties in the model are valid
97
- # @return true if the model is valid
98
- def valid?
99
- true
100
- end
101
-
102
- # Checks equality by comparing each attribute.
103
- # @param [Object] Object to be compared
104
- def ==(o)
105
- return true if self.equal?(o)
106
- self.class == o.class &&
107
- id == o.id &&
108
- repository_name == o.repository_name &&
109
- last_export_to_bitbucket_at == o.last_export_to_bitbucket_at &&
110
- last_import_from_bitbucket_at == o.last_import_from_bitbucket_at &&
111
- valid_phraseapp_yaml == o.valid_phraseapp_yaml &&
112
- phraseapp_projects == o.phraseapp_projects
113
- end
114
-
115
- # @see the `==` method
116
- # @param [Object] Object to be compared
117
- def eql?(o)
118
- self == o
119
- end
120
-
121
- # Calculates hash code according to all attributes.
122
- # @return [Integer] Hash code
123
- def hash
124
- [id, repository_name, last_export_to_bitbucket_at, last_import_from_bitbucket_at, valid_phraseapp_yaml, phraseapp_projects].hash
125
- end
126
-
127
- # Builds the object from hash
128
- # @param [Hash] attributes Model attributes in the form of hash
129
- # @return [Object] Returns the model itself
130
- def self.build_from_hash(attributes)
131
- new.build_from_hash(attributes)
132
- end
133
-
134
- # Builds the object from hash
135
- # @param [Hash] attributes Model attributes in the form of hash
136
- # @return [Object] Returns the model itself
137
- def build_from_hash(attributes)
138
- return nil unless attributes.is_a?(Hash)
139
- self.class.openapi_types.each_pair do |key, type|
140
- if type =~ /\AArray<(.*)>/i
141
- # check to ensure the input is an array given that the attribute
142
- # is documented as an array but the input is not
143
- if attributes[self.class.attribute_map[key]].is_a?(Array)
144
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
145
- end
146
- elsif !attributes[self.class.attribute_map[key]].nil?
147
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
- end # or else data not found in attributes(hash), not an issue as the data can be optional
149
- end
150
-
151
- self
152
- end
153
-
154
- # Deserializes the data based on type
155
- # @param string type Data type
156
- # @param string value Value to be deserialized
157
- # @return [Object] Deserialized data
158
- def _deserialize(type, value)
159
- case type.to_sym
160
- when :DateTime
161
- DateTime.parse(value)
162
- when :Date
163
- Date.parse(value)
164
- when :Time
165
- Time.parse(value)
166
- when :String
167
- value.to_s
168
- when :Integer
169
- value.to_i
170
- when :Float
171
- value.to_f
172
- when :Boolean
173
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
- true
175
- else
176
- false
177
- end
178
- when :Object
179
- # generic object (usually a Hash), return directly
180
- value
181
- when /\AArray<(?<inner_type>.+)>\z/
182
- inner_type = Regexp.last_match[:inner_type]
183
- value.map { |v| _deserialize(inner_type, v) }
184
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
- k_type = Regexp.last_match[:k_type]
186
- v_type = Regexp.last_match[:v_type]
187
- {}.tap do |hash|
188
- value.each do |k, v|
189
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
- end
191
- end
192
- else # model
193
- Phrase.const_get(type).build_from_hash(value)
194
- end
195
- end
196
-
197
- # Returns the string representation of the object
198
- # @return [String] String presentation of the object
199
- def to_s
200
- to_hash.to_s
201
- end
202
-
203
- # to_body is an alias to to_hash (backward compatibility)
204
- # @return [Hash] Returns the object in the form of hash
205
- def to_body
206
- to_hash
207
- end
208
-
209
- # Returns the object in the form of hash
210
- # @return [Hash] Returns the object in the form of hash
211
- def to_hash
212
- hash = {}
213
- self.class.attribute_map.each_pair do |attr, param|
214
- value = self.send(attr)
215
- if value.nil?
216
- is_nullable = self.class.openapi_nullable.include?(attr)
217
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
- end
219
-
220
- hash[param] = _to_hash(value)
221
- end
222
- hash
223
- end
224
-
225
- # Outputs non-array value in the form of hash
226
- # For object, use to_hash. Otherwise, just return the value
227
- # @param [Object] value Any valid value
228
- # @return [Hash] Returns the value in the form of hash
229
- def _to_hash(value)
230
- if value.is_a?(Array)
231
- value.compact.map { |v| _to_hash(v) }
232
- elsif value.is_a?(Hash)
233
- {}.tap do |hash|
234
- value.each { |k, v| hash[k] = _to_hash(v) }
235
- end
236
- elsif value.respond_to? :to_hash
237
- value.to_hash
238
- else
239
- value
240
- end
241
- end
242
- end
243
- end
@@ -1,197 +0,0 @@
1
- require 'date'
2
-
3
- module Phrase
4
- class BitbucketSyncExportParameters
5
- # Account ID to specify the actual account the project 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::BitbucketSyncExportParameters` 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::BitbucketSyncExportParameters`. 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
@@ -1,196 +0,0 @@
1
- require 'date'
2
-
3
- module Phrase
4
- class BitbucketSyncExportResponse
5
- attr_accessor :status_path
6
-
7
- # Attribute mapping from ruby-style variable name to JSON key.
8
- def self.attribute_map
9
- {
10
- :'status_path' => :'status_path'
11
- }
12
- end
13
-
14
- # Attribute type mapping.
15
- def self.openapi_types
16
- {
17
- :'status_path' => :'String'
18
- }
19
- end
20
-
21
- # List of attributes with nullable: true
22
- def self.openapi_nullable
23
- Set.new([
24
- ])
25
- end
26
-
27
- # Initializes the object
28
- # @param [Hash] attributes Model attributes in the form of hash
29
- def initialize(attributes = {})
30
- if (!attributes.is_a?(Hash))
31
- fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::BitbucketSyncExportResponse` initialize method"
32
- end
33
-
34
- # check to see if the attribute exists and convert string to symbol for hash key
35
- attributes = attributes.each_with_object({}) { |(k, v), h|
36
- if (!self.class.attribute_map.key?(k.to_sym))
37
- fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::BitbucketSyncExportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
38
- end
39
- h[k.to_sym] = v
40
- }
41
-
42
- if attributes.key?(:'status_path')
43
- self.status_path = attributes[:'status_path']
44
- end
45
- end
46
-
47
- # Show invalid properties with the reasons. Usually used together with valid?
48
- # @return Array for valid properties with the reasons
49
- def list_invalid_properties
50
- invalid_properties = Array.new
51
- invalid_properties
52
- end
53
-
54
- # Check to see if the all the properties in the model are valid
55
- # @return true if the model is valid
56
- def valid?
57
- true
58
- end
59
-
60
- # Checks equality by comparing each attribute.
61
- # @param [Object] Object to be compared
62
- def ==(o)
63
- return true if self.equal?(o)
64
- self.class == o.class &&
65
- status_path == o.status_path
66
- end
67
-
68
- # @see the `==` method
69
- # @param [Object] Object to be compared
70
- def eql?(o)
71
- self == o
72
- end
73
-
74
- # Calculates hash code according to all attributes.
75
- # @return [Integer] Hash code
76
- def hash
77
- [status_path].hash
78
- end
79
-
80
- # Builds the object from hash
81
- # @param [Hash] attributes Model attributes in the form of hash
82
- # @return [Object] Returns the model itself
83
- def self.build_from_hash(attributes)
84
- new.build_from_hash(attributes)
85
- end
86
-
87
- # Builds the object from hash
88
- # @param [Hash] attributes Model attributes in the form of hash
89
- # @return [Object] Returns the model itself
90
- def build_from_hash(attributes)
91
- return nil unless attributes.is_a?(Hash)
92
- self.class.openapi_types.each_pair do |key, type|
93
- if type =~ /\AArray<(.*)>/i
94
- # check to ensure the input is an array given that the attribute
95
- # is documented as an array but the input is not
96
- if attributes[self.class.attribute_map[key]].is_a?(Array)
97
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
98
- end
99
- elsif !attributes[self.class.attribute_map[key]].nil?
100
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
- end # or else data not found in attributes(hash), not an issue as the data can be optional
102
- end
103
-
104
- self
105
- end
106
-
107
- # Deserializes the data based on type
108
- # @param string type Data type
109
- # @param string value Value to be deserialized
110
- # @return [Object] Deserialized data
111
- def _deserialize(type, value)
112
- case type.to_sym
113
- when :DateTime
114
- DateTime.parse(value)
115
- when :Date
116
- Date.parse(value)
117
- when :Time
118
- Time.parse(value)
119
- when :String
120
- value.to_s
121
- when :Integer
122
- value.to_i
123
- when :Float
124
- value.to_f
125
- when :Boolean
126
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
- true
128
- else
129
- false
130
- end
131
- when :Object
132
- # generic object (usually a Hash), return directly
133
- value
134
- when /\AArray<(?<inner_type>.+)>\z/
135
- inner_type = Regexp.last_match[:inner_type]
136
- value.map { |v| _deserialize(inner_type, v) }
137
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
138
- k_type = Regexp.last_match[:k_type]
139
- v_type = Regexp.last_match[:v_type]
140
- {}.tap do |hash|
141
- value.each do |k, v|
142
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
143
- end
144
- end
145
- else # model
146
- Phrase.const_get(type).build_from_hash(value)
147
- end
148
- end
149
-
150
- # Returns the string representation of the object
151
- # @return [String] String presentation of the object
152
- def to_s
153
- to_hash.to_s
154
- end
155
-
156
- # to_body is an alias to to_hash (backward compatibility)
157
- # @return [Hash] Returns the object in the form of hash
158
- def to_body
159
- to_hash
160
- end
161
-
162
- # Returns the object in the form of hash
163
- # @return [Hash] Returns the object in the form of hash
164
- def to_hash
165
- hash = {}
166
- self.class.attribute_map.each_pair do |attr, param|
167
- value = self.send(attr)
168
- if value.nil?
169
- is_nullable = self.class.openapi_nullable.include?(attr)
170
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
171
- end
172
-
173
- hash[param] = _to_hash(value)
174
- end
175
- hash
176
- end
177
-
178
- # Outputs non-array value in the form of hash
179
- # For object, use to_hash. Otherwise, just return the value
180
- # @param [Object] value Any valid value
181
- # @return [Hash] Returns the value in the form of hash
182
- def _to_hash(value)
183
- if value.is_a?(Array)
184
- value.compact.map { |v| _to_hash(v) }
185
- elsif value.is_a?(Hash)
186
- {}.tap do |hash|
187
- value.each { |k, v| hash[k] = _to_hash(v) }
188
- end
189
- elsif value.respond_to? :to_hash
190
- value.to_hash
191
- else
192
- value
193
- end
194
- end
195
- end
196
- end