phrase 2.5.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -11
- data/docs/AccountsApi.md +2 -8
- data/docs/AuthorizationsApi.md +5 -20
- data/docs/BitbucketSyncApi.md +3 -12
- data/docs/BlacklistedKeysApi.md +5 -20
- data/docs/BranchesApi.md +7 -28
- data/docs/CommentsApi.md +8 -32
- data/docs/DistributionsApi.md +5 -20
- data/docs/DocumentsApi.md +2 -8
- data/docs/FormatsApi.md +1 -4
- data/docs/GitHubSyncApi.md +2 -8
- data/docs/GitLabSyncApi.md +7 -28
- data/docs/GlossariesApi.md +5 -20
- data/docs/GlossaryTermTranslationsApi.md +3 -12
- data/docs/GlossaryTermsApi.md +5 -20
- data/docs/ICUApi.md +1 -4
- data/docs/IcuSkeletonParameters.md +2 -0
- data/docs/Invitation.md +3 -1
- data/docs/InvitationsApi.md +7 -28
- data/docs/JobCreateParameters.md +3 -1
- data/docs/JobLocalesApi.md +8 -32
- data/docs/JobTemplateLocalesApi.md +5 -20
- data/docs/JobTemplatesApi.md +5 -20
- data/docs/JobsApi.md +141 -44
- data/docs/KeyCreateParameters.md +2 -0
- data/docs/KeysApi.md +11 -44
- data/docs/LocalesApi.md +7 -28
- data/docs/Member.md +1 -1
- data/docs/MembersApi.md +5 -20
- data/docs/NotificationGroupsApi.md +3 -12
- data/docs/NotificationsApi.md +3 -12
- data/docs/OrdersApi.md +5 -20
- data/docs/ProjectLocales.md +2 -0
- data/docs/ProjectMemberSpecific.md +27 -0
- data/docs/ProjectsApi.md +5 -20
- data/docs/ReleasesApi.md +6 -24
- data/docs/ScreenshotMarkersApi.md +5 -20
- data/docs/ScreenshotsApi.md +5 -20
- data/docs/SearchApi.md +1 -4
- data/docs/SpacesApi.md +8 -32
- data/docs/StyleGuidesApi.md +5 -20
- data/docs/TagsApi.md +4 -16
- data/docs/{Team1.md → TeamShort.md} +2 -2
- data/docs/TeamsApi.md +11 -44
- data/docs/TranslationsApi.md +17 -68
- data/docs/UploadsApi.md +3 -12
- data/docs/UsersApi.md +1 -4
- data/docs/VariablesApi.md +5 -20
- data/docs/VersionsHistoryApi.md +2 -8
- data/docs/WebhooksApi.md +6 -24
- data/lib/phrase/api/accounts_api.rb +2 -2
- data/lib/phrase/api/authorizations_api.rb +5 -5
- data/lib/phrase/api/bitbucket_sync_api.rb +3 -3
- data/lib/phrase/api/blacklisted_keys_api.rb +5 -5
- data/lib/phrase/api/branches_api.rb +7 -7
- data/lib/phrase/api/comments_api.rb +8 -8
- data/lib/phrase/api/distributions_api.rb +5 -5
- data/lib/phrase/api/documents_api.rb +2 -2
- data/lib/phrase/api/formats_api.rb +1 -1
- data/lib/phrase/api/git_hub_sync_api.rb +2 -2
- data/lib/phrase/api/git_lab_sync_api.rb +7 -7
- data/lib/phrase/api/glossaries_api.rb +5 -5
- data/lib/phrase/api/glossary_term_translations_api.rb +3 -3
- data/lib/phrase/api/glossary_terms_api.rb +5 -5
- data/lib/phrase/api/icu_api.rb +1 -1
- data/lib/phrase/api/invitations_api.rb +7 -7
- data/lib/phrase/api/job_locales_api.rb +8 -8
- data/lib/phrase/api/job_template_locales_api.rb +5 -5
- data/lib/phrase/api/job_templates_api.rb +5 -5
- data/lib/phrase/api/jobs_api.rb +157 -11
- data/lib/phrase/api/keys_api.rb +11 -11
- data/lib/phrase/api/locales_api.rb +7 -7
- data/lib/phrase/api/members_api.rb +5 -5
- data/lib/phrase/api/notification_groups_api.rb +3 -3
- data/lib/phrase/api/notifications_api.rb +3 -3
- data/lib/phrase/api/orders_api.rb +5 -5
- data/lib/phrase/api/projects_api.rb +5 -5
- data/lib/phrase/api/releases_api.rb +6 -6
- data/lib/phrase/api/screenshot_markers_api.rb +5 -5
- data/lib/phrase/api/screenshots_api.rb +5 -5
- data/lib/phrase/api/search_api.rb +1 -1
- data/lib/phrase/api/spaces_api.rb +8 -8
- data/lib/phrase/api/style_guides_api.rb +5 -5
- data/lib/phrase/api/tags_api.rb +4 -4
- data/lib/phrase/api/teams_api.rb +11 -11
- data/lib/phrase/api/translations_api.rb +17 -17
- data/lib/phrase/api/uploads_api.rb +3 -3
- data/lib/phrase/api/users_api.rb +1 -1
- data/lib/phrase/api/variables_api.rb +5 -5
- data/lib/phrase/api/versions_history_api.rb +2 -2
- data/lib/phrase/api/webhooks_api.rb +6 -6
- data/lib/phrase/configuration.rb +0 -8
- data/lib/phrase/models/icu_skeleton_parameters.rb +11 -1
- data/lib/phrase/models/invitation.rb +13 -2
- data/lib/phrase/models/job_create_parameters.rb +14 -4
- data/lib/phrase/models/key_create_parameters.rb +11 -1
- data/lib/phrase/models/member.rb +1 -1
- data/lib/phrase/models/project_locales.rb +11 -2
- data/lib/phrase/models/project_member_specific.rb +239 -0
- data/lib/phrase/models/{team1.rb → team_short.rb} +3 -3
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +2 -1
- data/spec/api/jobs_api_spec.rb +30 -0
- data/spec/models/icu_skeleton_parameters_spec.rb +6 -0
- data/spec/models/invitation_spec.rb +6 -0
- data/spec/models/job_create_parameters_spec.rb +6 -0
- data/spec/models/key_create_parameters_spec.rb +6 -0
- data/spec/models/project_locales_spec.rb +6 -0
- data/spec/models/project_member_specific_spec.rb +59 -0
- data/spec/models/{team1_spec.rb → team_short_spec.rb} +6 -6
- metadata +204 -200
@@ -62,7 +62,7 @@ module Phrase
|
|
62
62
|
return_type = opts[:return_type] || 'Webhook'
|
63
63
|
|
64
64
|
# auth_names
|
65
|
-
auth_names = opts[:auth_names] || ['Basic', 'Token'
|
65
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
66
66
|
|
67
67
|
new_options = opts.merge(
|
68
68
|
:header_params => header_params,
|
@@ -132,7 +132,7 @@ module Phrase
|
|
132
132
|
return_type = opts[:return_type]
|
133
133
|
|
134
134
|
# auth_names
|
135
|
-
auth_names = opts[:auth_names] || ['Basic', 'Token'
|
135
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
136
136
|
|
137
137
|
new_options = opts.merge(
|
138
138
|
:header_params => header_params,
|
@@ -204,7 +204,7 @@ module Phrase
|
|
204
204
|
return_type = opts[:return_type] || 'Webhook'
|
205
205
|
|
206
206
|
# auth_names
|
207
|
-
auth_names = opts[:auth_names] || ['Basic', 'Token'
|
207
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
208
208
|
|
209
209
|
new_options = opts.merge(
|
210
210
|
:header_params => header_params,
|
@@ -274,7 +274,7 @@ module Phrase
|
|
274
274
|
return_type = opts[:return_type]
|
275
275
|
|
276
276
|
# auth_names
|
277
|
-
auth_names = opts[:auth_names] || ['Basic', 'Token'
|
277
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
278
278
|
|
279
279
|
new_options = opts.merge(
|
280
280
|
:header_params => header_params,
|
@@ -354,7 +354,7 @@ module Phrase
|
|
354
354
|
return_type = opts[:return_type] || 'Webhook'
|
355
355
|
|
356
356
|
# auth_names
|
357
|
-
auth_names = opts[:auth_names] || ['Basic', 'Token'
|
357
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
358
358
|
|
359
359
|
new_options = opts.merge(
|
360
360
|
:header_params => header_params,
|
@@ -426,7 +426,7 @@ module Phrase
|
|
426
426
|
return_type = opts[:return_type] || 'Array<Webhook>'
|
427
427
|
|
428
428
|
# auth_names
|
429
|
-
auth_names = opts[:auth_names] || ['Basic', 'Token'
|
429
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
430
430
|
|
431
431
|
new_options = opts.merge(
|
432
432
|
:header_params => header_params,
|
data/lib/phrase/configuration.rb
CHANGED
@@ -195,14 +195,6 @@ module Phrase
|
|
195
195
|
key: 'Authorization',
|
196
196
|
value: api_key_with_prefix('Authorization')
|
197
197
|
},
|
198
|
-
'bearerAuth' =>
|
199
|
-
{
|
200
|
-
type: 'bearer',
|
201
|
-
in: 'header',
|
202
|
-
format: 'JWT',
|
203
|
-
key: 'Authorization',
|
204
|
-
value: "Bearer #{access_token}"
|
205
|
-
},
|
206
198
|
}
|
207
199
|
end
|
208
200
|
|
@@ -8,6 +8,9 @@ module Phrase
|
|
8
8
|
# Locale codes
|
9
9
|
attr_accessor :locale_codes
|
10
10
|
|
11
|
+
# Keep the content and add missing plural forms for each locale
|
12
|
+
attr_accessor :keep_content
|
13
|
+
|
11
14
|
# Indicates whether the zero form should be included or excluded in the returned skeletons
|
12
15
|
attr_accessor :zero_form_enabled
|
13
16
|
|
@@ -16,6 +19,7 @@ module Phrase
|
|
16
19
|
{
|
17
20
|
:'content' => :'content',
|
18
21
|
:'locale_codes' => :'locale_codes',
|
22
|
+
:'keep_content' => :'keep_content',
|
19
23
|
:'zero_form_enabled' => :'zero_form_enabled'
|
20
24
|
}
|
21
25
|
end
|
@@ -25,6 +29,7 @@ module Phrase
|
|
25
29
|
{
|
26
30
|
:'content' => :'String',
|
27
31
|
:'locale_codes' => :'Array<String>',
|
32
|
+
:'keep_content' => :'Boolean',
|
28
33
|
:'zero_form_enabled' => :'Boolean'
|
29
34
|
}
|
30
35
|
end
|
@@ -60,6 +65,10 @@ module Phrase
|
|
60
65
|
end
|
61
66
|
end
|
62
67
|
|
68
|
+
if attributes.key?(:'keep_content')
|
69
|
+
self.keep_content = attributes[:'keep_content']
|
70
|
+
end
|
71
|
+
|
63
72
|
if attributes.key?(:'zero_form_enabled')
|
64
73
|
self.zero_form_enabled = attributes[:'zero_form_enabled']
|
65
74
|
end
|
@@ -85,6 +94,7 @@ module Phrase
|
|
85
94
|
self.class == o.class &&
|
86
95
|
content == o.content &&
|
87
96
|
locale_codes == o.locale_codes &&
|
97
|
+
keep_content == o.keep_content &&
|
88
98
|
zero_form_enabled == o.zero_form_enabled
|
89
99
|
end
|
90
100
|
|
@@ -97,7 +107,7 @@ module Phrase
|
|
97
107
|
# Calculates hash code according to all attributes.
|
98
108
|
# @return [Integer] Hash code
|
99
109
|
def hash
|
100
|
-
[content, locale_codes, zero_form_enabled].hash
|
110
|
+
[content, locale_codes, keep_content, zero_form_enabled].hash
|
101
111
|
end
|
102
112
|
|
103
113
|
# Builds the object from hash
|
@@ -14,6 +14,8 @@ module Phrase
|
|
14
14
|
|
15
15
|
attr_accessor :locales
|
16
16
|
|
17
|
+
attr_accessor :teams
|
18
|
+
|
17
19
|
attr_accessor :default_locale_codes
|
18
20
|
|
19
21
|
attr_accessor :permissions
|
@@ -39,6 +41,7 @@ module Phrase
|
|
39
41
|
:'state' => :'state',
|
40
42
|
:'projects' => :'projects',
|
41
43
|
:'locales' => :'locales',
|
44
|
+
:'teams' => :'teams',
|
42
45
|
:'default_locale_codes' => :'default_locale_codes',
|
43
46
|
:'permissions' => :'permissions',
|
44
47
|
:'locale_ids' => :'locale_ids',
|
@@ -59,13 +62,14 @@ module Phrase
|
|
59
62
|
:'state' => :'String',
|
60
63
|
:'projects' => :'Array<ProjectShort>',
|
61
64
|
:'locales' => :'Array<LocalePreview>',
|
65
|
+
:'teams' => :'Array<TeamShort>',
|
62
66
|
:'default_locale_codes' => :'Array<String>',
|
63
67
|
:'permissions' => :'Object',
|
64
68
|
:'locale_ids' => :'Array<String>',
|
65
69
|
:'created_at' => :'DateTime',
|
66
70
|
:'updated_at' => :'DateTime',
|
67
71
|
:'accepted_at' => :'DateTime',
|
68
|
-
:'spaces' => :'Array<
|
72
|
+
:'spaces' => :'Array<Space>',
|
69
73
|
:'project_role' => :'Array<MemberProjectDetailProjectRoles>'
|
70
74
|
}
|
71
75
|
end
|
@@ -119,6 +123,12 @@ module Phrase
|
|
119
123
|
end
|
120
124
|
end
|
121
125
|
|
126
|
+
if attributes.key?(:'teams')
|
127
|
+
if (value = attributes[:'teams']).is_a?(Array)
|
128
|
+
self.teams = value
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
122
132
|
if attributes.key?(:'default_locale_codes')
|
123
133
|
if (value = attributes[:'default_locale_codes']).is_a?(Array)
|
124
134
|
self.default_locale_codes = value
|
@@ -184,6 +194,7 @@ module Phrase
|
|
184
194
|
state == o.state &&
|
185
195
|
projects == o.projects &&
|
186
196
|
locales == o.locales &&
|
197
|
+
teams == o.teams &&
|
187
198
|
default_locale_codes == o.default_locale_codes &&
|
188
199
|
permissions == o.permissions &&
|
189
200
|
locale_ids == o.locale_ids &&
|
@@ -203,7 +214,7 @@ module Phrase
|
|
203
214
|
# Calculates hash code according to all attributes.
|
204
215
|
# @return [Integer] Hash code
|
205
216
|
def hash
|
206
|
-
[id, email, role, state, projects, locales, default_locale_codes, permissions, locale_ids, created_at, updated_at, accepted_at, spaces, project_role].hash
|
217
|
+
[id, email, role, state, projects, locales, teams, default_locale_codes, permissions, locale_ids, created_at, updated_at, accepted_at, spaces, project_role].hash
|
207
218
|
end
|
208
219
|
|
209
220
|
# Builds the object from hash
|
@@ -26,6 +26,9 @@ module Phrase
|
|
26
26
|
# ids of keys that should be included within the job
|
27
27
|
attr_accessor :translation_key_ids
|
28
28
|
|
29
|
+
# id of a job template you would like to model the created job after. Any manually added parameters will take preference over template attributes.
|
30
|
+
attr_accessor :job_template_id
|
31
|
+
|
29
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
33
|
def self.attribute_map
|
31
34
|
{
|
@@ -36,7 +39,8 @@ module Phrase
|
|
36
39
|
:'due_date' => :'due_date',
|
37
40
|
:'ticket_url' => :'ticket_url',
|
38
41
|
:'tags' => :'tags',
|
39
|
-
:'translation_key_ids' => :'translation_key_ids'
|
42
|
+
:'translation_key_ids' => :'translation_key_ids',
|
43
|
+
:'job_template_id' => :'job_template_id'
|
40
44
|
}
|
41
45
|
end
|
42
46
|
|
@@ -50,7 +54,8 @@ module Phrase
|
|
50
54
|
:'due_date' => :'DateTime',
|
51
55
|
:'ticket_url' => :'String',
|
52
56
|
:'tags' => :'Array<String>',
|
53
|
-
:'translation_key_ids' => :'Array<String>'
|
57
|
+
:'translation_key_ids' => :'Array<String>',
|
58
|
+
:'job_template_id' => :'String'
|
54
59
|
}
|
55
60
|
end
|
56
61
|
|
@@ -110,6 +115,10 @@ module Phrase
|
|
110
115
|
self.translation_key_ids = value
|
111
116
|
end
|
112
117
|
end
|
118
|
+
|
119
|
+
if attributes.key?(:'job_template_id')
|
120
|
+
self.job_template_id = attributes[:'job_template_id']
|
121
|
+
end
|
113
122
|
end
|
114
123
|
|
115
124
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -137,7 +146,8 @@ module Phrase
|
|
137
146
|
due_date == o.due_date &&
|
138
147
|
ticket_url == o.ticket_url &&
|
139
148
|
tags == o.tags &&
|
140
|
-
translation_key_ids == o.translation_key_ids
|
149
|
+
translation_key_ids == o.translation_key_ids &&
|
150
|
+
job_template_id == o.job_template_id
|
141
151
|
end
|
142
152
|
|
143
153
|
# @see the `==` method
|
@@ -149,7 +159,7 @@ module Phrase
|
|
149
159
|
# Calculates hash code according to all attributes.
|
150
160
|
# @return [Integer] Hash code
|
151
161
|
def hash
|
152
|
-
[branch, name, source_locale_id, briefing, due_date, ticket_url, tags, translation_key_ids].hash
|
162
|
+
[branch, name, source_locale_id, briefing, due_date, ticket_url, tags, translation_key_ids, job_template_id].hash
|
153
163
|
end
|
154
164
|
|
155
165
|
# Builds the object from hash
|
@@ -35,6 +35,9 @@ module Phrase
|
|
35
35
|
# Indicates whether the key should be exported as \"unformatted\". Supported by Android XML and other formats.
|
36
36
|
attr_accessor :unformatted
|
37
37
|
|
38
|
+
# Creates a translation in the default locale with the specified content
|
39
|
+
attr_accessor :default_translation_content
|
40
|
+
|
38
41
|
# Indicates whether the key should be exported with \"xml:space=preserve\". Supported by several XML-based formats.
|
39
42
|
attr_accessor :xml_space_preserve
|
40
43
|
|
@@ -61,6 +64,7 @@ module Phrase
|
|
61
64
|
:'screenshot' => :'screenshot',
|
62
65
|
:'remove_screenshot' => :'remove_screenshot',
|
63
66
|
:'unformatted' => :'unformatted',
|
67
|
+
:'default_translation_content' => :'default_translation_content',
|
64
68
|
:'xml_space_preserve' => :'xml_space_preserve',
|
65
69
|
:'original_file' => :'original_file',
|
66
70
|
:'localized_format_string' => :'localized_format_string',
|
@@ -82,6 +86,7 @@ module Phrase
|
|
82
86
|
:'screenshot' => :'File',
|
83
87
|
:'remove_screenshot' => :'Boolean',
|
84
88
|
:'unformatted' => :'Boolean',
|
89
|
+
:'default_translation_content' => :'String',
|
85
90
|
:'xml_space_preserve' => :'Boolean',
|
86
91
|
:'original_file' => :'String',
|
87
92
|
:'localized_format_string' => :'String',
|
@@ -154,6 +159,10 @@ module Phrase
|
|
154
159
|
self.unformatted = attributes[:'unformatted']
|
155
160
|
end
|
156
161
|
|
162
|
+
if attributes.key?(:'default_translation_content')
|
163
|
+
self.default_translation_content = attributes[:'default_translation_content']
|
164
|
+
end
|
165
|
+
|
157
166
|
if attributes.key?(:'xml_space_preserve')
|
158
167
|
self.xml_space_preserve = attributes[:'xml_space_preserve']
|
159
168
|
end
|
@@ -200,6 +209,7 @@ module Phrase
|
|
200
209
|
screenshot == o.screenshot &&
|
201
210
|
remove_screenshot == o.remove_screenshot &&
|
202
211
|
unformatted == o.unformatted &&
|
212
|
+
default_translation_content == o.default_translation_content &&
|
203
213
|
xml_space_preserve == o.xml_space_preserve &&
|
204
214
|
original_file == o.original_file &&
|
205
215
|
localized_format_string == o.localized_format_string &&
|
@@ -215,7 +225,7 @@ module Phrase
|
|
215
225
|
# Calculates hash code according to all attributes.
|
216
226
|
# @return [Integer] Hash code
|
217
227
|
def hash
|
218
|
-
[branch, name, description, plural, name_plural, data_type, tags, max_characters_allowed, screenshot, remove_screenshot, unformatted, xml_space_preserve, original_file, localized_format_string, localized_format_key].hash
|
228
|
+
[branch, name, description, plural, name_plural, data_type, tags, max_characters_allowed, screenshot, remove_screenshot, unformatted, default_translation_content, xml_space_preserve, original_file, localized_format_string, localized_format_key].hash
|
219
229
|
end
|
220
230
|
|
221
231
|
# Builds the object from hash
|
data/lib/phrase/models/member.rb
CHANGED
@@ -6,6 +6,8 @@ module Phrase
|
|
6
6
|
|
7
7
|
attr_accessor :name
|
8
8
|
|
9
|
+
attr_accessor :project_role
|
10
|
+
|
9
11
|
attr_accessor :main_format
|
10
12
|
|
11
13
|
attr_accessor :created_at
|
@@ -19,6 +21,7 @@ module Phrase
|
|
19
21
|
{
|
20
22
|
:'id' => :'id',
|
21
23
|
:'name' => :'name',
|
24
|
+
:'project_role' => :'project_role',
|
22
25
|
:'main_format' => :'main_format',
|
23
26
|
:'created_at' => :'created_at',
|
24
27
|
:'updated_at' => :'updated_at',
|
@@ -31,6 +34,7 @@ module Phrase
|
|
31
34
|
{
|
32
35
|
:'id' => :'String',
|
33
36
|
:'name' => :'String',
|
37
|
+
:'project_role' => :'String',
|
34
38
|
:'main_format' => :'String',
|
35
39
|
:'created_at' => :'DateTime',
|
36
40
|
:'updated_at' => :'DateTime',
|
@@ -48,7 +52,7 @@ module Phrase
|
|
48
52
|
def self.openapi_all_of
|
49
53
|
[
|
50
54
|
:'ProjectLocales1',
|
51
|
-
:'
|
55
|
+
:'ProjectMemberSpecific'
|
52
56
|
]
|
53
57
|
end
|
54
58
|
|
@@ -75,6 +79,10 @@ module Phrase
|
|
75
79
|
self.name = attributes[:'name']
|
76
80
|
end
|
77
81
|
|
82
|
+
if attributes.key?(:'project_role')
|
83
|
+
self.project_role = attributes[:'project_role']
|
84
|
+
end
|
85
|
+
|
78
86
|
if attributes.key?(:'main_format')
|
79
87
|
self.main_format = attributes[:'main_format']
|
80
88
|
end
|
@@ -114,6 +122,7 @@ module Phrase
|
|
114
122
|
self.class == o.class &&
|
115
123
|
id == o.id &&
|
116
124
|
name == o.name &&
|
125
|
+
project_role == o.project_role &&
|
117
126
|
main_format == o.main_format &&
|
118
127
|
created_at == o.created_at &&
|
119
128
|
updated_at == o.updated_at &&
|
@@ -129,7 +138,7 @@ module Phrase
|
|
129
138
|
# Calculates hash code according to all attributes.
|
130
139
|
# @return [Integer] Hash code
|
131
140
|
def hash
|
132
|
-
[id, name, main_format, created_at, updated_at, locales].hash
|
141
|
+
[id, name, project_role, main_format, created_at, updated_at, locales].hash
|
133
142
|
end
|
134
143
|
|
135
144
|
# Builds the object from hash
|
@@ -0,0 +1,239 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class ProjectMemberSpecific
|
5
|
+
attr_accessor :id
|
6
|
+
|
7
|
+
attr_accessor :name
|
8
|
+
|
9
|
+
attr_accessor :project_role
|
10
|
+
|
11
|
+
attr_accessor :main_format
|
12
|
+
|
13
|
+
attr_accessor :created_at
|
14
|
+
|
15
|
+
attr_accessor :updated_at
|
16
|
+
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
+
def self.attribute_map
|
19
|
+
{
|
20
|
+
:'id' => :'id',
|
21
|
+
:'name' => :'name',
|
22
|
+
:'project_role' => :'project_role',
|
23
|
+
:'main_format' => :'main_format',
|
24
|
+
:'created_at' => :'created_at',
|
25
|
+
:'updated_at' => :'updated_at'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.openapi_types
|
31
|
+
{
|
32
|
+
:'id' => :'String',
|
33
|
+
:'name' => :'String',
|
34
|
+
:'project_role' => :'String',
|
35
|
+
:'main_format' => :'String',
|
36
|
+
:'created_at' => :'DateTime',
|
37
|
+
:'updated_at' => :'DateTime'
|
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::ProjectMemberSpecific` 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::ProjectMemberSpecific`. 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?(:'name')
|
67
|
+
self.name = attributes[:'name']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'project_role')
|
71
|
+
self.project_role = attributes[:'project_role']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'main_format')
|
75
|
+
self.main_format = attributes[:'main_format']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'created_at')
|
79
|
+
self.created_at = attributes[:'created_at']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'updated_at')
|
83
|
+
self.updated_at = attributes[:'updated_at']
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
invalid_properties
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check to see if the all the properties in the model are valid
|
95
|
+
# @return true if the model is valid
|
96
|
+
def valid?
|
97
|
+
true
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def ==(o)
|
103
|
+
return true if self.equal?(o)
|
104
|
+
self.class == o.class &&
|
105
|
+
id == o.id &&
|
106
|
+
name == o.name &&
|
107
|
+
project_role == o.project_role &&
|
108
|
+
main_format == o.main_format &&
|
109
|
+
created_at == o.created_at &&
|
110
|
+
updated_at == o.updated_at
|
111
|
+
end
|
112
|
+
|
113
|
+
# @see the `==` method
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def eql?(o)
|
116
|
+
self == o
|
117
|
+
end
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Integer] Hash code
|
121
|
+
def hash
|
122
|
+
[id, name, project_role, main_format, created_at, updated_at].hash
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def self.build_from_hash(attributes)
|
129
|
+
new.build_from_hash(attributes)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.openapi_types.each_pair do |key, type|
|
138
|
+
if type =~ /\AArray<(.*)>/i
|
139
|
+
# check to ensure the input is an array given that the attribute
|
140
|
+
# is documented as an array but the input is not
|
141
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
142
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
143
|
+
end
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
146
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
147
|
+
end
|
148
|
+
|
149
|
+
self
|
150
|
+
end
|
151
|
+
|
152
|
+
# Deserializes the data based on type
|
153
|
+
# @param string type Data type
|
154
|
+
# @param string value Value to be deserialized
|
155
|
+
# @return [Object] Deserialized data
|
156
|
+
def _deserialize(type, value)
|
157
|
+
case type.to_sym
|
158
|
+
when :DateTime
|
159
|
+
DateTime.parse(value)
|
160
|
+
when :Date
|
161
|
+
Date.parse(value)
|
162
|
+
when :String
|
163
|
+
value.to_s
|
164
|
+
when :Integer
|
165
|
+
value.to_i
|
166
|
+
when :Float
|
167
|
+
value.to_f
|
168
|
+
when :Boolean
|
169
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
170
|
+
true
|
171
|
+
else
|
172
|
+
false
|
173
|
+
end
|
174
|
+
when :Object
|
175
|
+
# generic object (usually a Hash), return directly
|
176
|
+
value
|
177
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
178
|
+
inner_type = Regexp.last_match[:inner_type]
|
179
|
+
value.map { |v| _deserialize(inner_type, v) }
|
180
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
181
|
+
k_type = Regexp.last_match[:k_type]
|
182
|
+
v_type = Regexp.last_match[:v_type]
|
183
|
+
{}.tap do |hash|
|
184
|
+
value.each do |k, v|
|
185
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
else # model
|
189
|
+
Phrase.const_get(type).build_from_hash(value)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the string representation of the object
|
194
|
+
# @return [String] String presentation of the object
|
195
|
+
def to_s
|
196
|
+
to_hash.to_s
|
197
|
+
end
|
198
|
+
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_body
|
202
|
+
to_hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Returns the object in the form of hash
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
207
|
+
def to_hash
|
208
|
+
hash = {}
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
210
|
+
value = self.send(attr)
|
211
|
+
if value.nil?
|
212
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
213
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
214
|
+
end
|
215
|
+
|
216
|
+
hash[param] = _to_hash(value)
|
217
|
+
end
|
218
|
+
hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Outputs non-array value in the form of hash
|
222
|
+
# For object, use to_hash. Otherwise, just return the value
|
223
|
+
# @param [Object] value Any valid value
|
224
|
+
# @return [Hash] Returns the value in the form of hash
|
225
|
+
def _to_hash(value)
|
226
|
+
if value.is_a?(Array)
|
227
|
+
value.compact.map { |v| _to_hash(v) }
|
228
|
+
elsif value.is_a?(Hash)
|
229
|
+
{}.tap do |hash|
|
230
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
231
|
+
end
|
232
|
+
elsif value.respond_to? :to_hash
|
233
|
+
value.to_hash
|
234
|
+
else
|
235
|
+
value
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'date'
|
2
2
|
|
3
3
|
module Phrase
|
4
|
-
class
|
4
|
+
class TeamShort
|
5
5
|
attr_accessor :id
|
6
6
|
|
7
7
|
attr_accessor :name
|
@@ -40,13 +40,13 @@ module Phrase
|
|
40
40
|
# @param [Hash] attributes Model attributes in the form of hash
|
41
41
|
def initialize(attributes = {})
|
42
42
|
if (!attributes.is_a?(Hash))
|
43
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::TeamShort` initialize method"
|
44
44
|
end
|
45
45
|
|
46
46
|
# check to see if the attribute exists and convert string to symbol for hash key
|
47
47
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
48
|
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::TeamShort`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
50
50
|
end
|
51
51
|
h[k.to_sym] = v
|
52
52
|
}
|
data/lib/phrase/version.rb
CHANGED
data/lib/phrase.rb
CHANGED
@@ -123,6 +123,7 @@ require 'phrase/models/project_details'
|
|
123
123
|
require 'phrase/models/project_details1'
|
124
124
|
require 'phrase/models/project_locales'
|
125
125
|
require 'phrase/models/project_locales1'
|
126
|
+
require 'phrase/models/project_member_specific'
|
126
127
|
require 'phrase/models/project_short'
|
127
128
|
require 'phrase/models/project_update_parameters'
|
128
129
|
require 'phrase/models/release'
|
@@ -155,9 +156,9 @@ require 'phrase/models/tag_with_stats1'
|
|
155
156
|
require 'phrase/models/tag_with_stats1_statistics'
|
156
157
|
require 'phrase/models/tag_with_stats1_statistics1'
|
157
158
|
require 'phrase/models/team'
|
158
|
-
require 'phrase/models/team1'
|
159
159
|
require 'phrase/models/team_create_parameters'
|
160
160
|
require 'phrase/models/team_detail'
|
161
|
+
require 'phrase/models/team_short'
|
161
162
|
require 'phrase/models/team_update_parameters'
|
162
163
|
require 'phrase/models/teams_projects_create_parameters'
|
163
164
|
require 'phrase/models/teams_spaces_create_parameters'
|