phrase 4.34.0 → 4.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,223 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class UserShort
5
+ attr_accessor :id
6
+
7
+ attr_accessor :username
8
+
9
+ attr_accessor :name
10
+
11
+ attr_accessor :gravatar_uid
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ :'id' => :'id',
17
+ :'username' => :'username',
18
+ :'name' => :'name',
19
+ :'gravatar_uid' => :'gravatar_uid'
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.openapi_types
25
+ {
26
+ :'id' => :'String',
27
+ :'username' => :'String',
28
+ :'name' => :'String',
29
+ :'gravatar_uid' => :'String'
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::UserShort` 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::UserShort`. 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?(:'username')
59
+ self.username = attributes[:'username']
60
+ end
61
+
62
+ if attributes.key?(:'name')
63
+ self.name = attributes[:'name']
64
+ end
65
+
66
+ if attributes.key?(:'gravatar_uid')
67
+ self.gravatar_uid = attributes[:'gravatar_uid']
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
+ username == o.username &&
91
+ name == o.name &&
92
+ gravatar_uid == o.gravatar_uid
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, username, name, gravatar_uid].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 :Time
145
+ Time.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :Boolean
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ Phrase.const_get(type).build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ if value.nil?
196
+ is_nullable = self.class.openapi_nullable.include?(attr)
197
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
+ end
199
+
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end
@@ -1,3 +1,3 @@
1
1
  module Phrase
2
- VERSION = '4.34.0'
2
+ VERSION = '4.35.0'
3
3
  end
data/lib/phrase.rb CHANGED
@@ -180,10 +180,14 @@ require 'phrase/models/release_update_parameters'
180
180
  require 'phrase/models/release_update_parameters1'
181
181
  require 'phrase/models/repo_sync'
182
182
  require 'phrase/models/repo_sync_create_parameters'
183
+ require 'phrase/models/repo_sync_create_parameters_export_schedule'
183
184
  require 'phrase/models/repo_sync_event'
184
185
  require 'phrase/models/repo_sync_event_uploads_inner'
185
186
  require 'phrase/models/repo_sync_export_parameters'
187
+ require 'phrase/models/repo_sync_export_schedule'
186
188
  require 'phrase/models/repo_sync_import_parameters'
189
+ require 'phrase/models/repo_sync_update_parameters'
190
+ require 'phrase/models/repo_sync_update_parameters_export_schedule'
187
191
  require 'phrase/models/screenshot'
188
192
  require 'phrase/models/screenshot_marker'
189
193
  require 'phrase/models/screenshot_marker_create_parameters'
@@ -246,6 +250,7 @@ require 'phrase/models/upload_batches_create_parameters'
246
250
  require 'phrase/models/upload_summary'
247
251
  require 'phrase/models/user'
248
252
  require 'phrase/models/user_preview'
253
+ require 'phrase/models/user_short'
249
254
  require 'phrase/models/variable'
250
255
  require 'phrase/models/variable_create_parameters'
251
256
  require 'phrase/models/variable_update_parameters'
@@ -121,4 +121,19 @@ describe 'RepoSyncsApi' do
121
121
  end
122
122
  end
123
123
 
124
+ # unit tests for repo_sync_update
125
+ # Update a repo sync
126
+ # Update settings for an existing Repo Sync. Sending &#x60;owner_id&#x60;, &#x60;export_triggers&#x60;, or &#x60;export_schedule&#x60; requires the caller to have &#x60;manage_github_sync?&#x60; permission on the project (returns &#x60;403&#x60; otherwise). Sending &#x60;export_triggers&#x60; or &#x60;export_schedule&#x60; when the automatic export feature is not enabled for the account returns &#x60;422&#x60;.
127
+ # @param account_id Account ID
128
+ # @param id ID
129
+ # @param repo_sync_update_parameters
130
+ # @param [Hash] opts the optional parameters
131
+ # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
132
+ # @return [RepoSync]
133
+ describe 'repo_sync_update test' do
134
+ it 'should work' do
135
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
136
+ end
137
+ end
138
+
124
139
  end
@@ -0,0 +1,63 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::RepoSyncCreateParametersExportSchedule
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'RepoSyncCreateParametersExportSchedule' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::RepoSyncCreateParametersExportSchedule.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of RepoSyncCreateParametersExportSchedule' do
19
+ it 'should create an instance of RepoSyncCreateParametersExportSchedule' do
20
+ expect(@instance).to be_instance_of(Phrase::RepoSyncCreateParametersExportSchedule)
21
+ end
22
+ end
23
+ describe 'test attribute "frequency"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["hour", "day", "week", "month", "cron"])
27
+ # validator.allowable_values.each do |value|
28
+ # expect { @instance.frequency = value }.not_to raise_error
29
+ # end
30
+ end
31
+ end
32
+
33
+ describe 'test attribute "time"' do
34
+ it 'should work' do
35
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
36
+ end
37
+ end
38
+
39
+ describe 'test attribute "time_zone"' do
40
+ it 'should work' do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
45
+ describe 'test attribute "days_of_week"' do
46
+ it 'should work' do
47
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
+ end
49
+ end
50
+
51
+ describe 'test attribute "day_of_month"' do
52
+ it 'should work' do
53
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
54
+ end
55
+ end
56
+
57
+ describe 'test attribute "cron_schedule"' do
58
+ it 'should work' do
59
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60
+ end
61
+ end
62
+
63
+ end
@@ -88,4 +88,26 @@ describe 'RepoSyncCreateParameters' do
88
88
  end
89
89
  end
90
90
 
91
+ describe 'test attribute "owner_id"' do
92
+ it 'should work' do
93
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
94
+ end
95
+ end
96
+
97
+ describe 'test attribute "export_triggers"' do
98
+ it 'should work' do
99
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
100
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["schedule", "branch_merged", "job_completed"])
101
+ # validator.allowable_values.each do |value|
102
+ # expect { @instance.export_triggers = value }.not_to raise_error
103
+ # end
104
+ end
105
+ end
106
+
107
+ describe 'test attribute "export_schedule"' do
108
+ it 'should work' do
109
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
110
+ end
111
+ end
112
+
91
113
  end
@@ -0,0 +1,51 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::RepoSyncExportSchedule
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'RepoSyncExportSchedule' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::RepoSyncExportSchedule.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of RepoSyncExportSchedule' do
19
+ it 'should create an instance of RepoSyncExportSchedule' do
20
+ expect(@instance).to be_instance_of(Phrase::RepoSyncExportSchedule)
21
+ end
22
+ end
23
+ describe 'test attribute "frequency"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["hour", "day", "week", "month", "cron"])
27
+ # validator.allowable_values.each do |value|
28
+ # expect { @instance.frequency = value }.not_to raise_error
29
+ # end
30
+ end
31
+ end
32
+
33
+ describe 'test attribute "cron_schedule"' do
34
+ it 'should work' do
35
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
36
+ end
37
+ end
38
+
39
+ describe 'test attribute "time_zone"' do
40
+ it 'should work' do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
45
+ describe 'test attribute "next_run_at"' do
46
+ it 'should work' do
47
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
+ end
49
+ end
50
+
51
+ end
@@ -86,4 +86,26 @@ describe 'RepoSync' do
86
86
  end
87
87
  end
88
88
 
89
+ describe 'test attribute "owner"' 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
+
95
+ describe 'test attribute "export_triggers"' do
96
+ it 'should work' do
97
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
98
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["schedule", "branch_merged", "job_completed"])
99
+ # validator.allowable_values.each do |value|
100
+ # expect { @instance.export_triggers = value }.not_to raise_error
101
+ # end
102
+ end
103
+ end
104
+
105
+ describe 'test attribute "export_schedule"' do
106
+ it 'should work' do
107
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
108
+ end
109
+ end
110
+
89
111
  end
@@ -0,0 +1,63 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::RepoSyncUpdateParametersExportSchedule
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'RepoSyncUpdateParametersExportSchedule' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::RepoSyncUpdateParametersExportSchedule.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of RepoSyncUpdateParametersExportSchedule' do
19
+ it 'should create an instance of RepoSyncUpdateParametersExportSchedule' do
20
+ expect(@instance).to be_instance_of(Phrase::RepoSyncUpdateParametersExportSchedule)
21
+ end
22
+ end
23
+ describe 'test attribute "frequency"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["hour", "day", "week", "month", "cron"])
27
+ # validator.allowable_values.each do |value|
28
+ # expect { @instance.frequency = value }.not_to raise_error
29
+ # end
30
+ end
31
+ end
32
+
33
+ describe 'test attribute "time"' do
34
+ it 'should work' do
35
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
36
+ end
37
+ end
38
+
39
+ describe 'test attribute "time_zone"' do
40
+ it 'should work' do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
45
+ describe 'test attribute "days_of_week"' do
46
+ it 'should work' do
47
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
+ end
49
+ end
50
+
51
+ describe 'test attribute "day_of_month"' do
52
+ it 'should work' do
53
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
54
+ end
55
+ end
56
+
57
+ describe 'test attribute "cron_schedule"' do
58
+ it 'should work' do
59
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60
+ end
61
+ end
62
+
63
+ end
@@ -0,0 +1,51 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::RepoSyncUpdateParameters
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'RepoSyncUpdateParameters' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::RepoSyncUpdateParameters.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of RepoSyncUpdateParameters' do
19
+ it 'should create an instance of RepoSyncUpdateParameters' do
20
+ expect(@instance).to be_instance_of(Phrase::RepoSyncUpdateParameters)
21
+ end
22
+ end
23
+ describe 'test attribute "name"' 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 "owner_id"' 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 "export_triggers"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["schedule", "branch_merged", "job_completed"])
39
+ # validator.allowable_values.each do |value|
40
+ # expect { @instance.export_triggers = value }.not_to raise_error
41
+ # end
42
+ end
43
+ end
44
+
45
+ describe 'test attribute "export_schedule"' do
46
+ it 'should work' do
47
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
+ end
49
+ end
50
+
51
+ end
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+ require 'json'
3
+ require 'date'
4
+
5
+ # Unit tests for Phrase::UserShort
6
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
7
+ # Please update as you see appropriate
8
+ describe 'UserShort' do
9
+ before do
10
+ # run before each test
11
+ @instance = Phrase::UserShort.new
12
+ end
13
+
14
+ after do
15
+ # run after each test
16
+ end
17
+
18
+ describe 'test an instance of UserShort' do
19
+ it 'should create an instance of UserShort' do
20
+ expect(@instance).to be_instance_of(Phrase::UserShort)
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 "username"' 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 "name"' 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 "gravatar_uid"' 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
+ end