quiz_api_client 4.15.0 → 4.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cadaa3edf6975cbdb4b9281124426254a17d49125d7f3a9342e872b826a132c7
4
- data.tar.gz: 73a3bf7743d64540340f09c638aa8cfa8b4125142da6205036b5c6b55b698c0a
3
+ metadata.gz: 133c4f8957b34364bb6593a4b42e4457513be8660ad7eb9c5c06ef88612c2be9
4
+ data.tar.gz: d44d9611acba9c72bdcbe1b5f04b92a087c5d153157034ddd2186331a824bb25
5
5
  SHA512:
6
- metadata.gz: eb0e0a4aad300a2073ab6d534ce201e944bfbfd24280f11509603ac8b81d7c747d175c0408a126c58dec1a326c2715c8cb1e33281d622eeef0a8b52b7e151f66
7
- data.tar.gz: 19693517278da57fd622f017e590f8d5081aa4f51c8864545230377bfa53ff44d8cbd1ce85d821b0b3ef8477f1e3e948b844e8db3548ec577840c00c9475541d
6
+ metadata.gz: 3ba48330b8b9724443dbfe3cc5e50828468b333369a69bc55508a06b0a93a6964e37f9b1b1916a04c7dfa1cd414e129f715de7ff414239a84547fa5a6be6fbc5
7
+ data.tar.gz: c2cfb2990d045e7202d116fd0348ffa65629ba330e0854436b85de838a7616d7d8afa5a15622214943f6d52f7b3c77dac7ce915c5101a06fbeb407ea0898e57d
@@ -0,0 +1,16 @@
1
+ module QuizApiClient::Services
2
+ class AccountService < BaseApiService
3
+ def update(params:, token: nil)
4
+ patch_to_quiz_api(params: params, token: token)
5
+ end
6
+
7
+ private
8
+
9
+ def patch_to_quiz_api(params:, token:)
10
+ client(token: token).patch(
11
+ '/api/account',
12
+ account: params
13
+ )
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module QuizApiClient
2
- VERSION = '4.15.0'.freeze
2
+ VERSION = '4.16.1'.freeze
3
3
  end
@@ -18,6 +18,10 @@ module QuizApiClient
18
18
  yield(config) if block_given?
19
19
  end
20
20
 
21
+ def account_service
22
+ @_account_service ||= Services::AccountService.new(config)
23
+ end
24
+
21
25
  def bank_service
22
26
  @_bank_service ||= Services::BankService.new(config)
23
27
  end
@@ -134,6 +138,7 @@ require 'quiz_api_client/http_request/metrics'
134
138
  require 'quiz_api_client/services/jwt_service'
135
139
  require 'quiz_api_client/services/base_api_service'
136
140
 
141
+ require 'quiz_api_client/services/account_service'
137
142
  require 'quiz_api_client/services/bank_service'
138
143
  require 'quiz_api_client/services/bank_entries_service'
139
144
  require 'quiz_api_client/services/content_exports_service'
@@ -0,0 +1,37 @@
1
+ RSpec.describe QuizApiClient::Services::AccountService do
2
+ let(:host) { 'api.host' }
3
+ let(:config) { QuizApiClient::Config.new { |c| c.host = host } }
4
+ let(:subject) { described_class.new(config) }
5
+
6
+ describe '#update' do
7
+ let(:params) do
8
+ { tenant_domain: 'foo.instructure.com' }
9
+ end
10
+
11
+ let(:response) do
12
+ {
13
+ 'id' => '1',
14
+ 'uuid' => '5862e3c7-b598-40c8-996f-cd0cd1778358',
15
+ 'tenant_domain' => params[:tenant_domain]
16
+ }
17
+ end
18
+
19
+ let(:expected_url) { "https://#{host}/api/account" }
20
+
21
+ before do
22
+ stub_request(:patch, expected_url)
23
+ .with(body: { account: params }.to_json)
24
+ .to_return(
25
+ status: 200,
26
+ body: response.to_json,
27
+ headers: { 'Content-Type' => 'application/json' }
28
+ )
29
+ end
30
+
31
+ it 'pathces to the correct endpoint and returns the response' do
32
+ expect(
33
+ subject.update(params: params, token: 'token').parsed_response
34
+ ).to eq(response)
35
+ end
36
+ end
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quiz_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.15.0
4
+ version: 4.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Slaughter
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: exe
17
17
  cert_chain: []
18
- date: 2024-03-28 00:00:00.000000000 Z
18
+ date: 2024-06-05 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: httparty
@@ -167,6 +167,7 @@ email:
167
167
  - rkuss@instructure.com
168
168
  - rtaylor@instructure.com
169
169
  - dustin.cowles@instructure.com
170
+ - wdransfield@instructure.com
170
171
  executables: []
171
172
  extensions: []
172
173
  extra_rdoc_files: []
@@ -179,6 +180,7 @@ files:
179
180
  - lib/quiz_api_client/http_request/failure.rb
180
181
  - lib/quiz_api_client/http_request/metrics.rb
181
182
  - lib/quiz_api_client/json_formatter.rb
183
+ - lib/quiz_api_client/services/account_service.rb
182
184
  - lib/quiz_api_client/services/analyses_service.rb
183
185
  - lib/quiz_api_client/services/bank_entries_service.rb
184
186
  - lib/quiz_api_client/services/bank_service.rb
@@ -212,6 +214,7 @@ files:
212
214
  - spec/quiz_api_client/http_request/failure_spec.rb
213
215
  - spec/quiz_api_client/http_request/metrics_spec.rb
214
216
  - spec/quiz_api_client_spec.rb
217
+ - spec/services/account_service_spec.rb
215
218
  - spec/services/analyses_service_spec.rb
216
219
  - spec/services/bank_entries_service_spec.rb
217
220
  - spec/services/bank_service_spec.rb
@@ -267,6 +270,7 @@ test_files:
267
270
  - spec/quiz_api_client/http_request/failure_spec.rb
268
271
  - spec/quiz_api_client/http_request/metrics_spec.rb
269
272
  - spec/quiz_api_client_spec.rb
273
+ - spec/services/account_service_spec.rb
270
274
  - spec/services/analyses_service_spec.rb
271
275
  - spec/services/bank_entries_service_spec.rb
272
276
  - spec/services/bank_service_spec.rb