phrase 2.2.0 → 2.5.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 +20 -3
- data/docs/AccountsApi.md +8 -2
- data/docs/AuthorizationsApi.md +20 -5
- data/docs/BitbucketSyncApi.md +12 -3
- data/docs/BlacklistedKeysApi.md +20 -5
- data/docs/BranchesApi.md +28 -7
- data/docs/CommentsApi.md +32 -8
- data/docs/Distribution.md +2 -0
- data/docs/DistributionCreateParameters.md +2 -0
- data/docs/DistributionUpdateParameters.md +2 -0
- data/docs/DistributionsApi.md +20 -5
- data/docs/DocumentsApi.md +8 -2
- data/docs/FormatsApi.md +4 -1
- data/docs/GitHubSyncApi.md +8 -2
- data/docs/GitLabSyncApi.md +28 -7
- data/docs/GlossariesApi.md +20 -5
- data/docs/GlossaryTermTranslationsApi.md +12 -3
- data/docs/GlossaryTermsApi.md +20 -5
- data/docs/ICUApi.md +73 -0
- data/docs/Icu.md +17 -0
- data/docs/IcuSkeletonParameters.md +21 -0
- data/docs/InvitationCreateParameters.md +2 -0
- data/docs/InvitationUpdateParameters.md +2 -0
- data/docs/InvitationsApi.md +28 -7
- data/docs/JobLocaleCompleteReviewParameters.md +17 -0
- data/docs/JobLocaleUpdateParameters.md +3 -1
- data/docs/JobLocalesApi.md +99 -7
- data/docs/JobLocalesCreateParameters.md +4 -2
- data/docs/JobTemplateLocalesApi.md +20 -5
- data/docs/JobTemplatesApi.md +20 -5
- data/docs/JobsApi.md +44 -11
- data/docs/KeysApi.md +44 -11
- data/docs/LocalesApi.md +35 -10
- data/docs/Member.md +6 -0
- data/docs/MembersApi.md +20 -5
- data/docs/NotificationGroupsApi.md +12 -3
- data/docs/NotificationsApi.md +12 -3
- data/docs/OrdersApi.md +20 -5
- data/docs/Project.md +2 -0
- data/docs/ProjectDetails.md +2 -0
- data/docs/ProjectsApi.md +20 -5
- data/docs/ReleaseCreateParameters.md +2 -0
- data/docs/ReleasesApi.md +24 -6
- data/docs/ScreenshotMarkersApi.md +20 -5
- data/docs/ScreenshotsApi.md +20 -5
- data/docs/SearchApi.md +4 -1
- data/docs/SpacesApi.md +32 -8
- data/docs/StyleGuidesApi.md +20 -5
- data/docs/TagsApi.md +16 -4
- data/docs/Team1.md +23 -0
- data/docs/TeamsApi.md +44 -11
- data/docs/TranslationsApi.md +68 -17
- data/docs/TranslationsVerifyParameters.md +3 -5
- data/docs/UploadsApi.md +12 -3
- data/docs/UserPreview.md +3 -1
- data/docs/UsersApi.md +4 -1
- data/docs/VariablesApi.md +20 -5
- data/docs/VersionsHistoryApi.md +8 -2
- data/docs/WebhooksApi.md +24 -6
- 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 +78 -0
- data/lib/phrase/api/invitations_api.rb +7 -7
- data/lib/phrase/api/job_locales_api.rb +93 -7
- 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 +11 -11
- data/lib/phrase/api/keys_api.rb +11 -11
- data/lib/phrase/api/locales_api.rb +20 -11
- 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 +8 -0
- data/lib/phrase/models/distribution.rb +12 -1
- data/lib/phrase/models/distribution_create_parameters.rb +13 -1
- data/lib/phrase/models/distribution_update_parameters.rb +13 -1
- data/lib/phrase/models/icu.rb +195 -0
- data/lib/phrase/models/icu_skeleton_parameters.rb +217 -0
- data/lib/phrase/models/invitation_create_parameters.rb +13 -1
- data/lib/phrase/models/invitation_update_parameters.rb +13 -1
- data/lib/phrase/models/job_locale_complete_review_parameters.rb +195 -0
- data/lib/phrase/models/job_locale_update_parameters.rb +16 -4
- data/lib/phrase/models/job_locales_create_parameters.rb +17 -5
- data/lib/phrase/models/member.rb +30 -1
- data/lib/phrase/models/project.rb +10 -1
- data/lib/phrase/models/project_details.rb +10 -1
- data/lib/phrase/models/release_create_parameters.rb +13 -1
- data/lib/phrase/models/team1.rb +221 -0
- data/lib/phrase/models/translations_verify_parameters.rb +14 -24
- data/lib/phrase/models/user_preview.rb +13 -4
- data/lib/phrase/response.rb +1 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -0
- data/phrase.gemspec +2 -2
- data/spec/api/icu_api_spec.rb +36 -0
- data/spec/api/job_locales_api_spec.rb +16 -0
- data/spec/api/locales_api_spec.rb +2 -0
- data/spec/models/distribution_create_parameters_spec.rb +6 -0
- data/spec/models/distribution_spec.rb +6 -0
- data/spec/models/distribution_update_parameters_spec.rb +6 -0
- data/spec/models/icu_skeleton_parameters_spec.rb +41 -0
- data/spec/models/icu_spec.rb +29 -0
- data/spec/models/invitation_create_parameters_spec.rb +6 -0
- data/spec/models/invitation_update_parameters_spec.rb +6 -0
- data/spec/models/job_locale_complete_review_parameters_spec.rb +29 -0
- data/spec/models/job_locale_update_parameters_spec.rb +6 -0
- data/spec/models/job_locales_create_parameters_spec.rb +6 -0
- data/spec/models/member_spec.rb +18 -0
- data/spec/models/project_details_spec.rb +6 -0
- data/spec/models/project_spec.rb +6 -0
- data/spec/models/release_create_parameters_spec.rb +6 -0
- data/spec/models/team1_spec.rb +47 -0
- data/spec/models/translations_verify_parameters_spec.rb +2 -8
- data/spec/models/user_preview_spec.rb +6 -0
- metadata +214 -194
data/lib/phrase/models/member.rb
CHANGED
@@ -8,6 +8,10 @@ module Phrase
|
|
8
8
|
|
9
9
|
attr_accessor :username
|
10
10
|
|
11
|
+
attr_accessor :created_at
|
12
|
+
|
13
|
+
attr_accessor :last_activity_at
|
14
|
+
|
11
15
|
attr_accessor :role
|
12
16
|
|
13
17
|
attr_accessor :projects
|
@@ -16,6 +20,8 @@ module Phrase
|
|
16
20
|
|
17
21
|
attr_accessor :default_locale_codes
|
18
22
|
|
23
|
+
attr_accessor :teams
|
24
|
+
|
19
25
|
attr_accessor :spaces
|
20
26
|
|
21
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -24,10 +30,13 @@ module Phrase
|
|
24
30
|
:'id' => :'id',
|
25
31
|
:'email' => :'email',
|
26
32
|
:'username' => :'username',
|
33
|
+
:'created_at' => :'created_at',
|
34
|
+
:'last_activity_at' => :'last_activity_at',
|
27
35
|
:'role' => :'role',
|
28
36
|
:'projects' => :'projects',
|
29
37
|
:'permissions' => :'permissions',
|
30
38
|
:'default_locale_codes' => :'default_locale_codes',
|
39
|
+
:'teams' => :'teams',
|
31
40
|
:'spaces' => :'spaces'
|
32
41
|
}
|
33
42
|
end
|
@@ -38,10 +47,13 @@ module Phrase
|
|
38
47
|
:'id' => :'String',
|
39
48
|
:'email' => :'String',
|
40
49
|
:'username' => :'String',
|
50
|
+
:'created_at' => :'DateTime',
|
51
|
+
:'last_activity_at' => :'DateTime',
|
41
52
|
:'role' => :'String',
|
42
53
|
:'projects' => :'Array<ProjectLocales>',
|
43
54
|
:'permissions' => :'Object',
|
44
55
|
:'default_locale_codes' => :'Array<String>',
|
56
|
+
:'teams' => :'Array<Team1>',
|
45
57
|
:'spaces' => :'Array<MemberSpaces>'
|
46
58
|
}
|
47
59
|
end
|
@@ -79,6 +91,14 @@ module Phrase
|
|
79
91
|
self.username = attributes[:'username']
|
80
92
|
end
|
81
93
|
|
94
|
+
if attributes.key?(:'created_at')
|
95
|
+
self.created_at = attributes[:'created_at']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'last_activity_at')
|
99
|
+
self.last_activity_at = attributes[:'last_activity_at']
|
100
|
+
end
|
101
|
+
|
82
102
|
if attributes.key?(:'role')
|
83
103
|
self.role = attributes[:'role']
|
84
104
|
end
|
@@ -99,6 +119,12 @@ module Phrase
|
|
99
119
|
end
|
100
120
|
end
|
101
121
|
|
122
|
+
if attributes.key?(:'teams')
|
123
|
+
if (value = attributes[:'teams']).is_a?(Array)
|
124
|
+
self.teams = value
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
102
128
|
if attributes.key?(:'spaces')
|
103
129
|
if (value = attributes[:'spaces']).is_a?(Array)
|
104
130
|
self.spaces = value
|
@@ -127,10 +153,13 @@ module Phrase
|
|
127
153
|
id == o.id &&
|
128
154
|
email == o.email &&
|
129
155
|
username == o.username &&
|
156
|
+
created_at == o.created_at &&
|
157
|
+
last_activity_at == o.last_activity_at &&
|
130
158
|
role == o.role &&
|
131
159
|
projects == o.projects &&
|
132
160
|
permissions == o.permissions &&
|
133
161
|
default_locale_codes == o.default_locale_codes &&
|
162
|
+
teams == o.teams &&
|
134
163
|
spaces == o.spaces
|
135
164
|
end
|
136
165
|
|
@@ -143,7 +172,7 @@ module Phrase
|
|
143
172
|
# Calculates hash code according to all attributes.
|
144
173
|
# @return [Integer] Hash code
|
145
174
|
def hash
|
146
|
-
[id, email, username, role, projects, permissions, default_locale_codes, spaces].hash
|
175
|
+
[id, email, username, created_at, last_activity_at, role, projects, permissions, default_locale_codes, teams, spaces].hash
|
147
176
|
end
|
148
177
|
|
149
178
|
# Builds the object from hash
|
@@ -16,6 +16,8 @@ module Phrase
|
|
16
16
|
|
17
17
|
attr_accessor :space
|
18
18
|
|
19
|
+
attr_accessor :point_of_contact
|
20
|
+
|
19
21
|
attr_accessor :created_at
|
20
22
|
|
21
23
|
attr_accessor :updated_at
|
@@ -30,6 +32,7 @@ module Phrase
|
|
30
32
|
:'project_image_url' => :'project_image_url',
|
31
33
|
:'account' => :'account',
|
32
34
|
:'space' => :'space',
|
35
|
+
:'point_of_contact' => :'point_of_contact',
|
33
36
|
:'created_at' => :'created_at',
|
34
37
|
:'updated_at' => :'updated_at'
|
35
38
|
}
|
@@ -45,6 +48,7 @@ module Phrase
|
|
45
48
|
:'project_image_url' => :'String',
|
46
49
|
:'account' => :'Account',
|
47
50
|
:'space' => :'Space1',
|
51
|
+
:'point_of_contact' => :'UserPreview',
|
48
52
|
:'created_at' => :'DateTime',
|
49
53
|
:'updated_at' => :'DateTime'
|
50
54
|
}
|
@@ -99,6 +103,10 @@ module Phrase
|
|
99
103
|
self.space = attributes[:'space']
|
100
104
|
end
|
101
105
|
|
106
|
+
if attributes.key?(:'point_of_contact')
|
107
|
+
self.point_of_contact = attributes[:'point_of_contact']
|
108
|
+
end
|
109
|
+
|
102
110
|
if attributes.key?(:'created_at')
|
103
111
|
self.created_at = attributes[:'created_at']
|
104
112
|
end
|
@@ -133,6 +141,7 @@ module Phrase
|
|
133
141
|
project_image_url == o.project_image_url &&
|
134
142
|
account == o.account &&
|
135
143
|
space == o.space &&
|
144
|
+
point_of_contact == o.point_of_contact &&
|
136
145
|
created_at == o.created_at &&
|
137
146
|
updated_at == o.updated_at
|
138
147
|
end
|
@@ -146,7 +155,7 @@ module Phrase
|
|
146
155
|
# Calculates hash code according to all attributes.
|
147
156
|
# @return [Integer] Hash code
|
148
157
|
def hash
|
149
|
-
[id, name, slug, main_format, project_image_url, account, space, created_at, updated_at].hash
|
158
|
+
[id, name, slug, main_format, project_image_url, account, space, point_of_contact, created_at, updated_at].hash
|
150
159
|
end
|
151
160
|
|
152
161
|
# Builds the object from hash
|
@@ -16,6 +16,8 @@ module Phrase
|
|
16
16
|
|
17
17
|
attr_accessor :space
|
18
18
|
|
19
|
+
attr_accessor :point_of_contact
|
20
|
+
|
19
21
|
attr_accessor :created_at
|
20
22
|
|
21
23
|
attr_accessor :updated_at
|
@@ -32,6 +34,7 @@ module Phrase
|
|
32
34
|
:'project_image_url' => :'project_image_url',
|
33
35
|
:'account' => :'account',
|
34
36
|
:'space' => :'space',
|
37
|
+
:'point_of_contact' => :'point_of_contact',
|
35
38
|
:'created_at' => :'created_at',
|
36
39
|
:'updated_at' => :'updated_at',
|
37
40
|
:'shares_translation_memory' => :'shares_translation_memory'
|
@@ -48,6 +51,7 @@ module Phrase
|
|
48
51
|
:'project_image_url' => :'String',
|
49
52
|
:'account' => :'Account',
|
50
53
|
:'space' => :'Space1',
|
54
|
+
:'point_of_contact' => :'UserPreview',
|
51
55
|
:'created_at' => :'DateTime',
|
52
56
|
:'updated_at' => :'DateTime',
|
53
57
|
:'shares_translation_memory' => :'Boolean'
|
@@ -111,6 +115,10 @@ module Phrase
|
|
111
115
|
self.space = attributes[:'space']
|
112
116
|
end
|
113
117
|
|
118
|
+
if attributes.key?(:'point_of_contact')
|
119
|
+
self.point_of_contact = attributes[:'point_of_contact']
|
120
|
+
end
|
121
|
+
|
114
122
|
if attributes.key?(:'created_at')
|
115
123
|
self.created_at = attributes[:'created_at']
|
116
124
|
end
|
@@ -149,6 +157,7 @@ module Phrase
|
|
149
157
|
project_image_url == o.project_image_url &&
|
150
158
|
account == o.account &&
|
151
159
|
space == o.space &&
|
160
|
+
point_of_contact == o.point_of_contact &&
|
152
161
|
created_at == o.created_at &&
|
153
162
|
updated_at == o.updated_at &&
|
154
163
|
shares_translation_memory == o.shares_translation_memory
|
@@ -163,7 +172,7 @@ module Phrase
|
|
163
172
|
# Calculates hash code according to all attributes.
|
164
173
|
# @return [Integer] Hash code
|
165
174
|
def hash
|
166
|
-
[id, name, slug, main_format, project_image_url, account, space, created_at, updated_at, shares_translation_memory].hash
|
175
|
+
[id, name, slug, main_format, project_image_url, account, space, point_of_contact, created_at, updated_at, shares_translation_memory].hash
|
167
176
|
end
|
168
177
|
|
169
178
|
# Builds the object from hash
|
@@ -8,6 +8,9 @@ module Phrase
|
|
8
8
|
# List of platforms the release should support.
|
9
9
|
attr_accessor :platforms
|
10
10
|
|
11
|
+
# List of locale ids that will be included in the release. If empty, distribution locales will be used
|
12
|
+
attr_accessor :locale_ids
|
13
|
+
|
11
14
|
# Branch used for release
|
12
15
|
attr_accessor :branch
|
13
16
|
|
@@ -16,6 +19,7 @@ module Phrase
|
|
16
19
|
{
|
17
20
|
:'description' => :'description',
|
18
21
|
:'platforms' => :'platforms',
|
22
|
+
:'locale_ids' => :'locale_ids',
|
19
23
|
:'branch' => :'branch'
|
20
24
|
}
|
21
25
|
end
|
@@ -25,6 +29,7 @@ module Phrase
|
|
25
29
|
{
|
26
30
|
:'description' => :'String',
|
27
31
|
:'platforms' => :'Array<String>',
|
32
|
+
:'locale_ids' => :'Array<String>',
|
28
33
|
:'branch' => :'String'
|
29
34
|
}
|
30
35
|
end
|
@@ -60,6 +65,12 @@ module Phrase
|
|
60
65
|
end
|
61
66
|
end
|
62
67
|
|
68
|
+
if attributes.key?(:'locale_ids')
|
69
|
+
if (value = attributes[:'locale_ids']).is_a?(Array)
|
70
|
+
self.locale_ids = value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
63
74
|
if attributes.key?(:'branch')
|
64
75
|
self.branch = attributes[:'branch']
|
65
76
|
end
|
@@ -85,6 +96,7 @@ module Phrase
|
|
85
96
|
self.class == o.class &&
|
86
97
|
description == o.description &&
|
87
98
|
platforms == o.platforms &&
|
99
|
+
locale_ids == o.locale_ids &&
|
88
100
|
branch == o.branch
|
89
101
|
end
|
90
102
|
|
@@ -97,7 +109,7 @@ module Phrase
|
|
97
109
|
# Calculates hash code according to all attributes.
|
98
110
|
# @return [Integer] Hash code
|
99
111
|
def hash
|
100
|
-
[description, platforms, branch].hash
|
112
|
+
[description, platforms, locale_ids, branch].hash
|
101
113
|
end
|
102
114
|
|
103
115
|
# Builds the object from hash
|
@@ -0,0 +1,221 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class Team1
|
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::Team1` 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::Team1`. 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
|
@@ -5,22 +5,18 @@ module Phrase
|
|
5
5
|
# specify the branch to use
|
6
6
|
attr_accessor :branch
|
7
7
|
|
8
|
+
# specify the locale of the translations to be verified
|
9
|
+
attr_accessor :locale_id
|
10
|
+
|
8
11
|
# Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
9
12
|
attr_accessor :q
|
10
13
|
|
11
|
-
# Sort criteria. Can be one of: key_name, created_at, updated_at.
|
12
|
-
attr_accessor :sort
|
13
|
-
|
14
|
-
# Order direction. Can be one of: asc, desc.
|
15
|
-
attr_accessor :order
|
16
|
-
|
17
14
|
# Attribute mapping from ruby-style variable name to JSON key.
|
18
15
|
def self.attribute_map
|
19
16
|
{
|
20
17
|
:'branch' => :'branch',
|
21
|
-
:'
|
22
|
-
:'
|
23
|
-
:'order' => :'order'
|
18
|
+
:'locale_id' => :'locale_id',
|
19
|
+
:'q' => :'q'
|
24
20
|
}
|
25
21
|
end
|
26
22
|
|
@@ -28,9 +24,8 @@ module Phrase
|
|
28
24
|
def self.openapi_types
|
29
25
|
{
|
30
26
|
:'branch' => :'String',
|
31
|
-
:'
|
32
|
-
:'
|
33
|
-
:'order' => :'String'
|
27
|
+
:'locale_id' => :'String',
|
28
|
+
:'q' => :'String'
|
34
29
|
}
|
35
30
|
end
|
36
31
|
|
@@ -59,16 +54,12 @@ module Phrase
|
|
59
54
|
self.branch = attributes[:'branch']
|
60
55
|
end
|
61
56
|
|
62
|
-
if attributes.key?(:'
|
63
|
-
self.
|
57
|
+
if attributes.key?(:'locale_id')
|
58
|
+
self.locale_id = attributes[:'locale_id']
|
64
59
|
end
|
65
60
|
|
66
|
-
if attributes.key?(:'
|
67
|
-
self.
|
68
|
-
end
|
69
|
-
|
70
|
-
if attributes.key?(:'order')
|
71
|
-
self.order = attributes[:'order']
|
61
|
+
if attributes.key?(:'q')
|
62
|
+
self.q = attributes[:'q']
|
72
63
|
end
|
73
64
|
end
|
74
65
|
|
@@ -91,9 +82,8 @@ module Phrase
|
|
91
82
|
return true if self.equal?(o)
|
92
83
|
self.class == o.class &&
|
93
84
|
branch == o.branch &&
|
94
|
-
|
95
|
-
|
96
|
-
order == o.order
|
85
|
+
locale_id == o.locale_id &&
|
86
|
+
q == o.q
|
97
87
|
end
|
98
88
|
|
99
89
|
# @see the `==` method
|
@@ -105,7 +95,7 @@ module Phrase
|
|
105
95
|
# Calculates hash code according to all attributes.
|
106
96
|
# @return [Integer] Hash code
|
107
97
|
def hash
|
108
|
-
[branch,
|
98
|
+
[branch, locale_id, q].hash
|
109
99
|
end
|
110
100
|
|
111
101
|
# Builds the object from hash
|
@@ -8,12 +8,15 @@ module Phrase
|
|
8
8
|
|
9
9
|
attr_accessor :name
|
10
10
|
|
11
|
+
attr_accessor :gravatar_uid
|
12
|
+
|
11
13
|
# Attribute mapping from ruby-style variable name to JSON key.
|
12
14
|
def self.attribute_map
|
13
15
|
{
|
14
16
|
:'id' => :'id',
|
15
17
|
:'username' => :'username',
|
16
|
-
:'name' => :'name'
|
18
|
+
:'name' => :'name',
|
19
|
+
:'gravatar_uid' => :'gravatar_uid'
|
17
20
|
}
|
18
21
|
end
|
19
22
|
|
@@ -22,7 +25,8 @@ module Phrase
|
|
22
25
|
{
|
23
26
|
:'id' => :'String',
|
24
27
|
:'username' => :'String',
|
25
|
-
:'name' => :'String'
|
28
|
+
:'name' => :'String',
|
29
|
+
:'gravatar_uid' => :'String'
|
26
30
|
}
|
27
31
|
end
|
28
32
|
|
@@ -58,6 +62,10 @@ module Phrase
|
|
58
62
|
if attributes.key?(:'name')
|
59
63
|
self.name = attributes[:'name']
|
60
64
|
end
|
65
|
+
|
66
|
+
if attributes.key?(:'gravatar_uid')
|
67
|
+
self.gravatar_uid = attributes[:'gravatar_uid']
|
68
|
+
end
|
61
69
|
end
|
62
70
|
|
63
71
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -80,7 +88,8 @@ module Phrase
|
|
80
88
|
self.class == o.class &&
|
81
89
|
id == o.id &&
|
82
90
|
username == o.username &&
|
83
|
-
name == o.name
|
91
|
+
name == o.name &&
|
92
|
+
gravatar_uid == o.gravatar_uid
|
84
93
|
end
|
85
94
|
|
86
95
|
# @see the `==` method
|
@@ -92,7 +101,7 @@ module Phrase
|
|
92
101
|
# Calculates hash code according to all attributes.
|
93
102
|
# @return [Integer] Hash code
|
94
103
|
def hash
|
95
|
-
[id, username, name].hash
|
104
|
+
[id, username, name, gravatar_uid].hash
|
96
105
|
end
|
97
106
|
|
98
107
|
# Builds the object from hash
|
data/lib/phrase/response.rb
CHANGED
@@ -10,7 +10,7 @@ module Phrase
|
|
10
10
|
link_headers = headers["link"]
|
11
11
|
if link_headers
|
12
12
|
@paginated = true
|
13
|
-
parsed_links = LinkHeaderParser.parse(link_headers, base: 'https://api.phrase.com').
|
13
|
+
parsed_links = LinkHeaderParser.parse(link_headers, base: 'https://api.phrase.com').group_by_relation_type
|
14
14
|
next_page_link = parsed_links[:next]&.first
|
15
15
|
if next_page_link
|
16
16
|
@next_page = CGI.parse(URI.parse(next_page_link.target_uri).query)["page"]&.first&.to_i
|
data/lib/phrase/version.rb
CHANGED
data/lib/phrase.rb
CHANGED
@@ -58,6 +58,8 @@ require 'phrase/models/glossary_term_translation_create_parameters'
|
|
58
58
|
require 'phrase/models/glossary_term_translation_update_parameters'
|
59
59
|
require 'phrase/models/glossary_term_update_parameters'
|
60
60
|
require 'phrase/models/glossary_update_parameters'
|
61
|
+
require 'phrase/models/icu'
|
62
|
+
require 'phrase/models/icu_skeleton_parameters'
|
61
63
|
require 'phrase/models/inline_response422'
|
62
64
|
require 'phrase/models/inline_response422_errors'
|
63
65
|
require 'phrase/models/invitation'
|
@@ -72,6 +74,7 @@ require 'phrase/models/job_details1'
|
|
72
74
|
require 'phrase/models/job_keys_create_parameters'
|
73
75
|
require 'phrase/models/job_locale'
|
74
76
|
require 'phrase/models/job_locale_complete_parameters'
|
77
|
+
require 'phrase/models/job_locale_complete_review_parameters'
|
75
78
|
require 'phrase/models/job_locale_reopen_parameters'
|
76
79
|
require 'phrase/models/job_locale_update_parameters'
|
77
80
|
require 'phrase/models/job_locales_create_parameters'
|
@@ -152,6 +155,7 @@ require 'phrase/models/tag_with_stats1'
|
|
152
155
|
require 'phrase/models/tag_with_stats1_statistics'
|
153
156
|
require 'phrase/models/tag_with_stats1_statistics1'
|
154
157
|
require 'phrase/models/team'
|
158
|
+
require 'phrase/models/team1'
|
155
159
|
require 'phrase/models/team_create_parameters'
|
156
160
|
require 'phrase/models/team_detail'
|
157
161
|
require 'phrase/models/team_update_parameters'
|
@@ -208,6 +212,7 @@ require 'phrase/api/git_lab_sync_api'
|
|
208
212
|
require 'phrase/api/glossaries_api'
|
209
213
|
require 'phrase/api/glossary_term_translations_api'
|
210
214
|
require 'phrase/api/glossary_terms_api'
|
215
|
+
require 'phrase/api/icu_api'
|
211
216
|
require 'phrase/api/invitations_api'
|
212
217
|
require 'phrase/api/job_locales_api'
|
213
218
|
require 'phrase/api/job_template_locales_api'
|
data/phrase.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.summary = "You can collaborate on language file translation with your team or order translations through our platform. The API allows you to import locale files, download locale files, tag keys or interact in other ways with the localization data stored in Phrase for your account."
|
14
14
|
s.description = "Phrase is a translation management platform for software projects."
|
15
15
|
s.license = 'MIT'
|
16
|
-
s.required_ruby_version = ">=
|
16
|
+
s.required_ruby_version = ">= 2.6.0"
|
17
17
|
|
18
18
|
s.metadata = {
|
19
19
|
"bug_tracker_uri" => "https://github.com/phrase/phrase-ruby/issues",
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
24
24
|
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
25
|
-
s.add_runtime_dependency 'link-header-parser', '~>
|
25
|
+
s.add_runtime_dependency 'link-header-parser', '~> 4.0'
|
26
26
|
|
27
27
|
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
28
28
|
|