phrase 1.0.10 → 1.0.11

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -3
  3. data/docs/Invitation.md +5 -1
  4. data/docs/InvitationCreateParameters.md +4 -0
  5. data/docs/InvitationUpdateParameters.md +4 -0
  6. data/docs/Member.md +7 -1
  7. data/docs/MemberProjectDetail.md +35 -0
  8. data/docs/MemberProjectDetailProjectRoles.md +19 -0
  9. data/docs/MemberSpaces.md +25 -0
  10. data/docs/MemberUpdateParameters.md +4 -0
  11. data/docs/MemberUpdateSettingsParameters.md +19 -0
  12. data/docs/MembersApi.md +66 -0
  13. data/lib/phrase.rb +4 -0
  14. data/lib/phrase/api/members_api.rb +80 -0
  15. data/lib/phrase/models/invitation.rb +26 -4
  16. data/lib/phrase/models/invitation_create_parameters.rb +25 -1
  17. data/lib/phrase/models/invitation_update_parameters.rb +25 -1
  18. data/lib/phrase/models/member.rb +35 -4
  19. data/lib/phrase/models/member_project_detail.rb +285 -0
  20. data/lib/phrase/models/member_project_detail_project_roles.rb +203 -0
  21. data/lib/phrase/models/member_spaces.rb +230 -0
  22. data/lib/phrase/models/member_update_parameters.rb +25 -1
  23. data/lib/phrase/models/member_update_settings_parameters.rb +207 -0
  24. data/lib/phrase/version.rb +1 -1
  25. data/spec/api/members_api_spec.rb +15 -0
  26. data/spec/models/invitation_create_parameters_spec.rb +12 -0
  27. data/spec/models/invitation_spec.rb +12 -0
  28. data/spec/models/invitation_update_parameters_spec.rb +12 -0
  29. data/spec/models/member_project_detail_project_roles_spec.rb +35 -0
  30. data/spec/models/member_project_detail_spec.rb +83 -0
  31. data/spec/models/member_spaces_spec.rb +53 -0
  32. data/spec/models/member_spec.rb +18 -0
  33. data/spec/models/member_update_parameters_spec.rb +12 -0
  34. data/spec/models/member_update_settings_parameters_spec.rb +35 -0
  35. metadata +18 -2
@@ -0,0 +1,207 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class MemberUpdateSettingsParameters
5
+ # Member role, can be any of of Manager, Developer, Translator
6
+ attr_accessor :project_role
7
+
8
+ # List of locale ids the user has access to.
9
+ attr_accessor :locale_ids
10
+
11
+ # Attribute mapping from ruby-style variable name to JSON key.
12
+ def self.attribute_map
13
+ {
14
+ :'project_role' => :'project_role',
15
+ :'locale_ids' => :'locale_ids'
16
+ }
17
+ end
18
+
19
+ # Attribute type mapping.
20
+ def self.openapi_types
21
+ {
22
+ :'project_role' => :'String',
23
+ :'locale_ids' => :'Array<String>'
24
+ }
25
+ end
26
+
27
+ # List of attributes with nullable: true
28
+ def self.openapi_nullable
29
+ Set.new([
30
+ ])
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ if (!attributes.is_a?(Hash))
37
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::MemberUpdateSettingsParameters` initialize method"
38
+ end
39
+
40
+ # check to see if the attribute exists and convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}) { |(k, v), h|
42
+ if (!self.class.attribute_map.key?(k.to_sym))
43
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::MemberUpdateSettingsParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
44
+ end
45
+ h[k.to_sym] = v
46
+ }
47
+
48
+ if attributes.key?(:'project_role')
49
+ self.project_role = attributes[:'project_role']
50
+ end
51
+
52
+ if attributes.key?(:'locale_ids')
53
+ if (value = attributes[:'locale_ids']).is_a?(Array)
54
+ self.locale_ids = value
55
+ end
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ project_role == o.project_role &&
78
+ locale_ids == o.locale_ids
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Integer] Hash code
89
+ def hash
90
+ [project_role, locale_ids].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def self.build_from_hash(attributes)
97
+ new.build_from_hash(attributes)
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.openapi_types.each_pair do |key, type|
106
+ if type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
110
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
115
+ end
116
+
117
+ self
118
+ end
119
+
120
+ # Deserializes the data based on type
121
+ # @param string type Data type
122
+ # @param string value Value to be deserialized
123
+ # @return [Object] Deserialized data
124
+ def _deserialize(type, value)
125
+ case type.to_sym
126
+ when :DateTime
127
+ DateTime.parse(value)
128
+ when :Date
129
+ Date.parse(value)
130
+ when :String
131
+ value.to_s
132
+ when :Integer
133
+ value.to_i
134
+ when :Float
135
+ value.to_f
136
+ when :Boolean
137
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
138
+ true
139
+ else
140
+ false
141
+ end
142
+ when :Object
143
+ # generic object (usually a Hash), return directly
144
+ value
145
+ when /\AArray<(?<inner_type>.+)>\z/
146
+ inner_type = Regexp.last_match[:inner_type]
147
+ value.map { |v| _deserialize(inner_type, v) }
148
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
149
+ k_type = Regexp.last_match[:k_type]
150
+ v_type = Regexp.last_match[:v_type]
151
+ {}.tap do |hash|
152
+ value.each do |k, v|
153
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
154
+ end
155
+ end
156
+ else # model
157
+ Phrase.const_get(type).build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+ end
207
+ end
@@ -1,3 +1,3 @@
1
1
  module Phrase
2
- VERSION = '1.0.10'
2
+ VERSION = '1.0.11'
3
3
  end
@@ -63,6 +63,21 @@ describe 'MembersApi' do
63
63
  end
64
64
  end
65
65
 
66
+ # unit tests for member_update_settings
67
+ # Update a member&#39;s project settings
68
+ # Update user settings in the project. Access token scope must include &lt;code&gt;team.manage&lt;/code&gt;.
69
+ # @param project_id Project ID
70
+ # @param id ID
71
+ # @param member_update_settings_parameters
72
+ # @param [Hash] opts the optional parameters
73
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
74
+ # @return [MemberProjectDetail]
75
+ describe 'member_update_settings test' do
76
+ it 'should work' do
77
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
78
+ end
79
+ end
80
+
66
81
  # unit tests for members_list
67
82
  # List members
68
83
  # Get all users active in the account. It also lists resources like projects and locales the member has access to. In case nothing is shown the default access from the role is used. Access token scope must include &lt;code&gt;team.manage&lt;/code&gt;.
@@ -44,6 +44,18 @@ describe 'InvitationCreateParameters' do
44
44
  end
45
45
  end
46
46
 
47
+ describe 'test attribute "space_ids"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "default_locale_codes"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
47
59
  describe 'test attribute "permissions"' do
48
60
  it 'should work' do
49
61
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -56,6 +56,12 @@ describe 'Invitation' do
56
56
  end
57
57
  end
58
58
 
59
+ describe 'test attribute "default_locale_codes"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
59
65
  describe 'test attribute "permissions"' do
60
66
  it 'should work' do
61
67
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -80,4 +86,10 @@ describe 'Invitation' do
80
86
  end
81
87
  end
82
88
 
89
+ describe 'test attribute "spaces"' do
90
+ it 'should work' do
91
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
+ end
93
+ end
94
+
83
95
  end
@@ -38,6 +38,18 @@ describe 'InvitationUpdateParameters' do
38
38
  end
39
39
  end
40
40
 
41
+ describe 'test attribute "space_ids"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "default_locale_codes"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
41
53
  describe 'test attribute "permissions"' do
42
54
  it 'should work' do
43
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::MemberProjectDetailProjectRoles
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'MemberProjectDetailProjectRoles' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::MemberProjectDetailProjectRoles.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of MemberProjectDetailProjectRoles' do
19
+ it 'should create an instance of MemberProjectDetailProjectRoles' do
20
+ expect(@instance).to be_instance_of(Phrase::MemberProjectDetailProjectRoles)
21
+ end
22
+ end
23
+ describe 'test attribute "project_id"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "role"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ end
@@ -0,0 +1,83 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::MemberProjectDetail
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'MemberProjectDetail' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::MemberProjectDetail.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of MemberProjectDetail' do
19
+ it 'should create an instance of MemberProjectDetail' do
20
+ expect(@instance).to be_instance_of(Phrase::MemberProjectDetail)
21
+ end
22
+ end
23
+ describe 'test attribute "id"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "email"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ describe 'test attribute "username"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "role"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "projects"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "permissions"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "locale_ids"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ describe 'test attribute "default_locale_codes"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ describe 'test attribute "spaces"' do
72
+ it 'should work' do
73
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
+ end
75
+ end
76
+
77
+ describe 'test attribute "project_roles"' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ end
@@ -0,0 +1,53 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::MemberSpaces
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'MemberSpaces' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::MemberSpaces.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of MemberSpaces' do
19
+ it 'should create an instance of MemberSpaces' do
20
+ expect(@instance).to be_instance_of(Phrase::MemberSpaces)
21
+ end
22
+ end
23
+ describe 'test attribute "id"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "name"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ describe 'test attribute "created_at"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "updated_at"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "projects_count"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ end