phrase 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/docs/Account.md +2 -0
- data/docs/AccountDetails.md +3 -3
- data/docs/AccountsApi.md +2 -2
- data/docs/AuthorizationsApi.md +2 -2
- data/docs/BlacklistedKeysApi.md +4 -2
- data/docs/BranchesApi.md +2 -2
- data/docs/CommentsApi.md +2 -2
- data/docs/DistributionsApi.md +2 -2
- data/docs/Document.md +23 -0
- data/docs/DocumentsApi.md +137 -0
- data/docs/GitHubSyncApi.md +130 -0
- data/docs/GitLabSyncApi.md +2 -2
- data/docs/GithubSyncExportParameters.md +17 -0
- data/docs/GithubSyncImportParameters.md +17 -0
- data/docs/GlossariesApi.md +2 -2
- data/docs/GlossaryTermsApi.md +2 -2
- data/docs/InlineResponse422.md +19 -0
- data/docs/InlineResponse422Errors.md +21 -0
- data/docs/InvitationsApi.md +2 -2
- data/docs/JobLocalesApi.md +2 -2
- data/docs/JobsApi.md +2 -2
- data/docs/KeysApi.md +4 -4
- data/docs/LocalesApi.md +2 -2
- data/docs/MembersApi.md +2 -2
- data/docs/OrdersApi.md +2 -2
- data/docs/Project.md +2 -0
- data/docs/ProjectDetails.md +2 -2
- data/docs/ProjectsApi.md +2 -2
- data/docs/ReleasesApi.md +2 -2
- data/docs/ScreenshotMarkersApi.md +2 -2
- data/docs/ScreenshotsApi.md +2 -2
- data/docs/SpacesApi.md +4 -4
- data/docs/StyleGuidesApi.md +2 -2
- data/docs/TagsApi.md +2 -2
- data/docs/TeamsApi.md +2 -2
- data/docs/TranslationsApi.md +8 -8
- data/docs/UploadsApi.md +2 -2
- data/docs/VersionsHistoryApi.md +2 -2
- data/docs/WebhooksApi.md +2 -2
- data/lib/phrase.rb +7 -0
- data/lib/phrase/api/accounts_api.rb +2 -2
- data/lib/phrase/api/authorizations_api.rb +2 -2
- data/lib/phrase/api/blacklisted_keys_api.rb +5 -2
- data/lib/phrase/api/branches_api.rb +2 -2
- data/lib/phrase/api/comments_api.rb +2 -2
- data/lib/phrase/api/distributions_api.rb +2 -2
- data/lib/phrase/api/documents_api.rb +152 -0
- data/lib/phrase/api/git_hub_sync_api.rb +146 -0
- data/lib/phrase/api/git_lab_sync_api.rb +2 -2
- data/lib/phrase/api/glossaries_api.rb +2 -2
- data/lib/phrase/api/glossary_terms_api.rb +2 -2
- data/lib/phrase/api/invitations_api.rb +2 -2
- data/lib/phrase/api/job_locales_api.rb +2 -2
- data/lib/phrase/api/jobs_api.rb +2 -2
- data/lib/phrase/api/keys_api.rb +4 -4
- data/lib/phrase/api/locales_api.rb +2 -2
- data/lib/phrase/api/members_api.rb +2 -2
- data/lib/phrase/api/orders_api.rb +2 -2
- data/lib/phrase/api/projects_api.rb +2 -2
- data/lib/phrase/api/releases_api.rb +2 -2
- data/lib/phrase/api/screenshot_markers_api.rb +2 -2
- data/lib/phrase/api/screenshots_api.rb +2 -2
- data/lib/phrase/api/spaces_api.rb +4 -4
- data/lib/phrase/api/style_guides_api.rb +2 -2
- data/lib/phrase/api/tags_api.rb +2 -2
- data/lib/phrase/api/teams_api.rb +2 -2
- data/lib/phrase/api/translations_api.rb +8 -8
- data/lib/phrase/api/uploads_api.rb +2 -2
- data/lib/phrase/api/versions_history_api.rb +2 -2
- data/lib/phrase/api/webhooks_api.rb +2 -2
- data/lib/phrase/models/account.rb +10 -1
- data/lib/phrase/models/account_details.rb +13 -13
- data/lib/phrase/models/document.rb +221 -0
- data/lib/phrase/models/github_sync_export_parameters.rb +195 -0
- data/lib/phrase/models/github_sync_import_parameters.rb +195 -0
- data/lib/phrase/models/inline_response422.rb +205 -0
- data/lib/phrase/models/inline_response422_errors.rb +212 -0
- data/lib/phrase/models/project.rb +10 -1
- data/lib/phrase/models/project_details.rb +10 -10
- data/lib/phrase/version.rb +1 -1
- data/spec/api/accounts_api_spec.rb +1 -1
- data/spec/api/authorizations_api_spec.rb +1 -1
- data/spec/api/blacklisted_keys_api_spec.rb +2 -1
- data/spec/api/branches_api_spec.rb +1 -1
- data/spec/api/comments_api_spec.rb +1 -1
- data/spec/api/distributions_api_spec.rb +1 -1
- data/spec/api/documents_api_spec.rb +52 -0
- data/spec/api/git_hub_sync_api_spec.rb +49 -0
- data/spec/api/git_lab_sync_api_spec.rb +1 -1
- data/spec/api/glossaries_api_spec.rb +1 -1
- data/spec/api/glossary_terms_api_spec.rb +1 -1
- data/spec/api/invitations_api_spec.rb +1 -1
- data/spec/api/job_locales_api_spec.rb +1 -1
- data/spec/api/jobs_api_spec.rb +1 -1
- data/spec/api/keys_api_spec.rb +2 -2
- data/spec/api/locales_api_spec.rb +1 -1
- data/spec/api/members_api_spec.rb +1 -1
- data/spec/api/orders_api_spec.rb +1 -1
- data/spec/api/projects_api_spec.rb +1 -1
- data/spec/api/releases_api_spec.rb +1 -1
- data/spec/api/screenshot_markers_api_spec.rb +1 -1
- data/spec/api/screenshots_api_spec.rb +1 -1
- data/spec/api/spaces_api_spec.rb +2 -2
- data/spec/api/style_guides_api_spec.rb +1 -1
- data/spec/api/tags_api_spec.rb +1 -1
- data/spec/api/teams_api_spec.rb +1 -1
- data/spec/api/translations_api_spec.rb +4 -4
- data/spec/api/uploads_api_spec.rb +1 -1
- data/spec/api/versions_history_api_spec.rb +1 -1
- data/spec/api/webhooks_api_spec.rb +1 -1
- data/spec/models/account_details_spec.rb +4 -4
- data/spec/models/account_spec.rb +6 -0
- data/spec/models/document_spec.rb +47 -0
- data/spec/models/github_sync_export_parameters_spec.rb +29 -0
- data/spec/models/github_sync_import_parameters_spec.rb +29 -0
- data/spec/models/inline_response422_errors_spec.rb +41 -0
- data/spec/models/inline_response422_spec.rb +35 -0
- data/spec/models/project_details_spec.rb +6 -6
- data/spec/models/project_spec.rb +6 -0
- metadata +181 -153
@@ -309,7 +309,7 @@ module Phrase
|
|
309
309
|
# @param [Hash] opts the optional parameters
|
310
310
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
311
311
|
# @option opts [Integer] :page Page number
|
312
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
312
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
313
313
|
# @return [Array<Styleguide>]
|
314
314
|
def styleguides_list(project_id, opts = {})
|
315
315
|
data, _status_code, _headers = styleguides_list_with_http_info(project_id, opts)
|
@@ -322,7 +322,7 @@ module Phrase
|
|
322
322
|
# @param [Hash] opts the optional parameters
|
323
323
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
324
324
|
# @option opts [Integer] :page Page number
|
325
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
325
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
326
326
|
# @return [Array<(Response<(Array<Styleguide>)>, Integer, Hash)>] Response<(Array<Styleguide>)> data, response status code and response headers
|
327
327
|
def styleguides_list_with_http_info(project_id, opts = {})
|
328
328
|
if @api_client.config.debugging
|
data/lib/phrase/api/tags_api.rb
CHANGED
@@ -235,7 +235,7 @@ module Phrase
|
|
235
235
|
# @param [Hash] opts the optional parameters
|
236
236
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
237
237
|
# @option opts [Integer] :page Page number
|
238
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
238
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
239
239
|
# @option opts [String] :branch specify the branch to use
|
240
240
|
# @return [Array<Tag>]
|
241
241
|
def tags_list(project_id, opts = {})
|
@@ -249,7 +249,7 @@ module Phrase
|
|
249
249
|
# @param [Hash] opts the optional parameters
|
250
250
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
251
251
|
# @option opts [Integer] :page Page number
|
252
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
252
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
253
253
|
# @option opts [String] :branch specify the branch to use
|
254
254
|
# @return [Array<(Response<(Array<Tag>)>, Integer, Hash)>] Response<(Array<Tag>)> data, response status code and response headers
|
255
255
|
def tags_list_with_http_info(project_id, opts = {})
|
data/lib/phrase/api/teams_api.rb
CHANGED
@@ -309,7 +309,7 @@ module Phrase
|
|
309
309
|
# @param [Hash] opts the optional parameters
|
310
310
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
311
311
|
# @option opts [Integer] :page Page number
|
312
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
312
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
313
313
|
# @return [Array<Team>]
|
314
314
|
def teams_list(account_id, opts = {})
|
315
315
|
data, _status_code, _headers = teams_list_with_http_info(account_id, opts)
|
@@ -322,7 +322,7 @@ module Phrase
|
|
322
322
|
# @param [Hash] opts the optional parameters
|
323
323
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
324
324
|
# @option opts [Integer] :page Page number
|
325
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
325
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
326
326
|
# @return [Array<(Response<(Array<Team>)>, Integer, Hash)>] Response<(Array<Team>)> data, response status code and response headers
|
327
327
|
def teams_list_with_http_info(account_id, opts = {})
|
328
328
|
if @api_client.config.debugging
|
@@ -643,7 +643,7 @@ module Phrase
|
|
643
643
|
# @param [Hash] opts the optional parameters
|
644
644
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
645
645
|
# @option opts [Integer] :page Page number
|
646
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
646
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
647
647
|
# @option opts [String] :branch specify the branch to use
|
648
648
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
649
649
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
@@ -661,7 +661,7 @@ module Phrase
|
|
661
661
|
# @param [Hash] opts the optional parameters
|
662
662
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
663
663
|
# @option opts [Integer] :page Page number
|
664
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
664
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
665
665
|
# @option opts [String] :branch specify the branch to use
|
666
666
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
667
667
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
@@ -733,7 +733,7 @@ module Phrase
|
|
733
733
|
# @param [Hash] opts the optional parameters
|
734
734
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
735
735
|
# @option opts [Integer] :page Page number
|
736
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
736
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
737
737
|
# @option opts [String] :branch specify the branch to use
|
738
738
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
739
739
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
@@ -751,7 +751,7 @@ module Phrase
|
|
751
751
|
# @param [Hash] opts the optional parameters
|
752
752
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
753
753
|
# @option opts [Integer] :page Page number
|
754
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
754
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
755
755
|
# @option opts [String] :branch specify the branch to use
|
756
756
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
757
757
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
@@ -970,7 +970,7 @@ module Phrase
|
|
970
970
|
# @param [Hash] opts the optional parameters
|
971
971
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
972
972
|
# @option opts [Integer] :page Page number
|
973
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
973
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
974
974
|
# @option opts [String] :branch specify the branch to use
|
975
975
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
976
976
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
@@ -987,7 +987,7 @@ module Phrase
|
|
987
987
|
# @param [Hash] opts the optional parameters
|
988
988
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
989
989
|
# @option opts [Integer] :page Page number
|
990
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
990
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
991
991
|
# @option opts [String] :branch specify the branch to use
|
992
992
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
993
993
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
@@ -1129,7 +1129,7 @@ module Phrase
|
|
1129
1129
|
# @param [Hash] opts the optional parameters
|
1130
1130
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
1131
1131
|
# @option opts [Integer] :page Page number
|
1132
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
1132
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
1133
1133
|
# @return [Array<Translation>]
|
1134
1134
|
def translations_search(project_id, translations_search_parameters, opts = {})
|
1135
1135
|
data, _status_code, _headers = translations_search_with_http_info(project_id, translations_search_parameters, opts)
|
@@ -1143,7 +1143,7 @@ module Phrase
|
|
1143
1143
|
# @param [Hash] opts the optional parameters
|
1144
1144
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
1145
1145
|
# @option opts [Integer] :page Page number
|
1146
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
1146
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
1147
1147
|
# @return [Array<(Response<(Array<Translation>)>, Integer, Hash)>] Response<(Array<Translation>)> data, response status code and response headers
|
1148
1148
|
def translations_search_with_http_info(project_id, translations_search_parameters, opts = {})
|
1149
1149
|
if @api_client.config.debugging
|
@@ -201,7 +201,7 @@ module Phrase
|
|
201
201
|
# @param [Hash] opts the optional parameters
|
202
202
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
203
203
|
# @option opts [Integer] :page Page number
|
204
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
204
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
205
205
|
# @option opts [String] :branch specify the branch to use
|
206
206
|
# @return [Array<Upload>]
|
207
207
|
def uploads_list(project_id, opts = {})
|
@@ -215,7 +215,7 @@ module Phrase
|
|
215
215
|
# @param [Hash] opts the optional parameters
|
216
216
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
217
217
|
# @option opts [Integer] :page Page number
|
218
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
218
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
219
219
|
# @option opts [String] :branch specify the branch to use
|
220
220
|
# @return [Array<(Response<(Array<Upload>)>, Integer, Hash)>] Response<(Array<Upload>)> data, response status code and response headers
|
221
221
|
def uploads_list_with_http_info(project_id, opts = {})
|
@@ -95,7 +95,7 @@ module Phrase
|
|
95
95
|
# @param [Hash] opts the optional parameters
|
96
96
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
97
97
|
# @option opts [Integer] :page Page number
|
98
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
98
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
99
99
|
# @option opts [String] :branch specify the branch to use
|
100
100
|
# @return [Array<TranslationVersion>]
|
101
101
|
def versions_list(project_id, translation_id, opts = {})
|
@@ -110,7 +110,7 @@ module Phrase
|
|
110
110
|
# @param [Hash] opts the optional parameters
|
111
111
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
112
112
|
# @option opts [Integer] :page Page number
|
113
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
113
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
114
114
|
# @option opts [String] :branch specify the branch to use
|
115
115
|
# @return [Array<(Response<(Array<TranslationVersion>)>, Integer, Hash)>] Response<(Array<TranslationVersion>)> data, response status code and response headers
|
116
116
|
def versions_list_with_http_info(project_id, translation_id, opts = {})
|
@@ -379,7 +379,7 @@ module Phrase
|
|
379
379
|
# @param [Hash] opts the optional parameters
|
380
380
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
381
381
|
# @option opts [Integer] :page Page number
|
382
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
382
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
383
383
|
# @return [Array<Webhook>]
|
384
384
|
def webhooks_list(project_id, opts = {})
|
385
385
|
data, _status_code, _headers = webhooks_list_with_http_info(project_id, opts)
|
@@ -392,7 +392,7 @@ module Phrase
|
|
392
392
|
# @param [Hash] opts the optional parameters
|
393
393
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
394
394
|
# @option opts [Integer] :page Page number
|
395
|
-
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items,
|
395
|
+
# @option opts [Integer] :per_page allows you to specify a page size up to 100 items, 25 by default
|
396
396
|
# @return [Array<(Response<(Array<Webhook>)>, Integer, Hash)>] Response<(Array<Webhook>)> data, response status code and response headers
|
397
397
|
def webhooks_list_with_http_info(project_id, opts = {})
|
398
398
|
if @api_client.config.debugging
|
@@ -6,6 +6,8 @@ module Phrase
|
|
6
6
|
|
7
7
|
attr_accessor :name
|
8
8
|
|
9
|
+
attr_accessor :slug
|
10
|
+
|
9
11
|
attr_accessor :company
|
10
12
|
|
11
13
|
attr_accessor :created_at
|
@@ -17,6 +19,7 @@ module Phrase
|
|
17
19
|
{
|
18
20
|
:'id' => :'id',
|
19
21
|
:'name' => :'name',
|
22
|
+
:'slug' => :'slug',
|
20
23
|
:'company' => :'company',
|
21
24
|
:'created_at' => :'created_at',
|
22
25
|
:'updated_at' => :'updated_at'
|
@@ -28,6 +31,7 @@ module Phrase
|
|
28
31
|
{
|
29
32
|
:'id' => :'String',
|
30
33
|
:'name' => :'String',
|
34
|
+
:'slug' => :'String',
|
31
35
|
:'company' => :'String',
|
32
36
|
:'created_at' => :'DateTime',
|
33
37
|
:'updated_at' => :'DateTime'
|
@@ -63,6 +67,10 @@ module Phrase
|
|
63
67
|
self.name = attributes[:'name']
|
64
68
|
end
|
65
69
|
|
70
|
+
if attributes.key?(:'slug')
|
71
|
+
self.slug = attributes[:'slug']
|
72
|
+
end
|
73
|
+
|
66
74
|
if attributes.key?(:'company')
|
67
75
|
self.company = attributes[:'company']
|
68
76
|
end
|
@@ -96,6 +104,7 @@ module Phrase
|
|
96
104
|
self.class == o.class &&
|
97
105
|
id == o.id &&
|
98
106
|
name == o.name &&
|
107
|
+
slug == o.slug &&
|
99
108
|
company == o.company &&
|
100
109
|
created_at == o.created_at &&
|
101
110
|
updated_at == o.updated_at
|
@@ -110,7 +119,7 @@ module Phrase
|
|
110
119
|
# Calculates hash code according to all attributes.
|
111
120
|
# @return [Integer] Hash code
|
112
121
|
def hash
|
113
|
-
[id, name, company, created_at, updated_at].hash
|
122
|
+
[id, name, slug, company, created_at, updated_at].hash
|
114
123
|
end
|
115
124
|
|
116
125
|
# Builds the object from hash
|
@@ -6,23 +6,23 @@ module Phrase
|
|
6
6
|
|
7
7
|
attr_accessor :name
|
8
8
|
|
9
|
+
attr_accessor :slug
|
10
|
+
|
9
11
|
attr_accessor :company
|
10
12
|
|
11
13
|
attr_accessor :created_at
|
12
14
|
|
13
15
|
attr_accessor :updated_at
|
14
16
|
|
15
|
-
attr_accessor :slug
|
16
|
-
|
17
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
18
18
|
def self.attribute_map
|
19
19
|
{
|
20
20
|
:'id' => :'id',
|
21
21
|
:'name' => :'name',
|
22
|
+
:'slug' => :'slug',
|
22
23
|
:'company' => :'company',
|
23
24
|
:'created_at' => :'created_at',
|
24
|
-
:'updated_at' => :'updated_at'
|
25
|
-
:'slug' => :'slug'
|
25
|
+
:'updated_at' => :'updated_at'
|
26
26
|
}
|
27
27
|
end
|
28
28
|
|
@@ -31,10 +31,10 @@ module Phrase
|
|
31
31
|
{
|
32
32
|
:'id' => :'String',
|
33
33
|
:'name' => :'String',
|
34
|
+
:'slug' => :'String',
|
34
35
|
:'company' => :'String',
|
35
36
|
:'created_at' => :'DateTime',
|
36
|
-
:'updated_at' => :'DateTime'
|
37
|
-
:'slug' => :'String'
|
37
|
+
:'updated_at' => :'DateTime'
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
@@ -75,6 +75,10 @@ module Phrase
|
|
75
75
|
self.name = attributes[:'name']
|
76
76
|
end
|
77
77
|
|
78
|
+
if attributes.key?(:'slug')
|
79
|
+
self.slug = attributes[:'slug']
|
80
|
+
end
|
81
|
+
|
78
82
|
if attributes.key?(:'company')
|
79
83
|
self.company = attributes[:'company']
|
80
84
|
end
|
@@ -86,10 +90,6 @@ module Phrase
|
|
86
90
|
if attributes.key?(:'updated_at')
|
87
91
|
self.updated_at = attributes[:'updated_at']
|
88
92
|
end
|
89
|
-
|
90
|
-
if attributes.key?(:'slug')
|
91
|
-
self.slug = attributes[:'slug']
|
92
|
-
end
|
93
93
|
end
|
94
94
|
|
95
95
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -112,10 +112,10 @@ module Phrase
|
|
112
112
|
self.class == o.class &&
|
113
113
|
id == o.id &&
|
114
114
|
name == o.name &&
|
115
|
+
slug == o.slug &&
|
115
116
|
company == o.company &&
|
116
117
|
created_at == o.created_at &&
|
117
|
-
updated_at == o.updated_at
|
118
|
-
slug == o.slug
|
118
|
+
updated_at == o.updated_at
|
119
119
|
end
|
120
120
|
|
121
121
|
# @see the `==` method
|
@@ -127,7 +127,7 @@ module Phrase
|
|
127
127
|
# Calculates hash code according to all attributes.
|
128
128
|
# @return [Integer] Hash code
|
129
129
|
def hash
|
130
|
-
[id, name, company, created_at, updated_at
|
130
|
+
[id, name, slug, company, created_at, updated_at].hash
|
131
131
|
end
|
132
132
|
|
133
133
|
# Builds the object from hash
|
@@ -0,0 +1,221 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class Document
|
5
|
+
attr_accessor :id
|
6
|
+
|
7
|
+
attr_accessor :name
|
8
|
+
|
9
|
+
attr_accessor :created_at
|
10
|
+
|
11
|
+
attr_accessor :updated_at
|
12
|
+
|
13
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
14
|
+
def self.attribute_map
|
15
|
+
{
|
16
|
+
:'id' => :'id',
|
17
|
+
:'name' => :'name',
|
18
|
+
:'created_at' => :'created_at',
|
19
|
+
:'updated_at' => :'updated_at'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.openapi_types
|
25
|
+
{
|
26
|
+
:'id' => :'String',
|
27
|
+
:'name' => :'String',
|
28
|
+
:'created_at' => :'DateTime',
|
29
|
+
:'updated_at' => :'DateTime'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# List of attributes with nullable: true
|
34
|
+
def self.openapi_nullable
|
35
|
+
Set.new([
|
36
|
+
])
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
if (!attributes.is_a?(Hash))
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::Document` initialize method"
|
44
|
+
end
|
45
|
+
|
46
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::Document`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
50
|
+
end
|
51
|
+
h[k.to_sym] = v
|
52
|
+
}
|
53
|
+
|
54
|
+
if attributes.key?(:'id')
|
55
|
+
self.id = attributes[:'id']
|
56
|
+
end
|
57
|
+
|
58
|
+
if attributes.key?(:'name')
|
59
|
+
self.name = attributes[:'name']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.key?(:'created_at')
|
63
|
+
self.created_at = attributes[:'created_at']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'updated_at')
|
67
|
+
self.updated_at = attributes[:'updated_at']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
72
|
+
# @return Array for valid properties with the reasons
|
73
|
+
def list_invalid_properties
|
74
|
+
invalid_properties = Array.new
|
75
|
+
invalid_properties
|
76
|
+
end
|
77
|
+
|
78
|
+
# Check to see if the all the properties in the model are valid
|
79
|
+
# @return true if the model is valid
|
80
|
+
def valid?
|
81
|
+
true
|
82
|
+
end
|
83
|
+
|
84
|
+
# Checks equality by comparing each attribute.
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def ==(o)
|
87
|
+
return true if self.equal?(o)
|
88
|
+
self.class == o.class &&
|
89
|
+
id == o.id &&
|
90
|
+
name == o.name &&
|
91
|
+
created_at == o.created_at &&
|
92
|
+
updated_at == o.updated_at
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(o)
|
98
|
+
self == o
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[id, name, created_at, updated_at].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
new.build_from_hash(attributes)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def build_from_hash(attributes)
|
118
|
+
return nil unless attributes.is_a?(Hash)
|
119
|
+
self.class.openapi_types.each_pair do |key, type|
|
120
|
+
if type =~ /\AArray<(.*)>/i
|
121
|
+
# check to ensure the input is an array given that the attribute
|
122
|
+
# is documented as an array but the input is not
|
123
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
124
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
125
|
+
end
|
126
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
127
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
128
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
129
|
+
end
|
130
|
+
|
131
|
+
self
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
# @param string type Data type
|
136
|
+
# @param string value Value to be deserialized
|
137
|
+
# @return [Object] Deserialized data
|
138
|
+
def _deserialize(type, value)
|
139
|
+
case type.to_sym
|
140
|
+
when :DateTime
|
141
|
+
DateTime.parse(value)
|
142
|
+
when :Date
|
143
|
+
Date.parse(value)
|
144
|
+
when :String
|
145
|
+
value.to_s
|
146
|
+
when :Integer
|
147
|
+
value.to_i
|
148
|
+
when :Float
|
149
|
+
value.to_f
|
150
|
+
when :Boolean
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
+
true
|
153
|
+
else
|
154
|
+
false
|
155
|
+
end
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
else # model
|
171
|
+
Phrase.const_get(type).build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|