-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add beta app review detail endpoints
- Loading branch information
Zoltan Ormandi
committed
Apr 30, 2023
1 parent
dcc1828
commit bcbd3ca
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
lib/app_store_connect_api/domain/beta_app_review_details.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
module AppStoreConnectApi | ||
module Domain | ||
module BetaAppReviewDetails | ||
# @see https://developer.apple.com/documentation/appstoreconnectapi/list_beta_app_review_details | ||
def beta_app_review_details(options = {}) | ||
get '/v1/betaAppReviewDetails', options | ||
end | ||
|
||
# @see https://developer.apple.com/documentation/appstoreconnectapi/read_beta_app_review_detail_information | ||
def beta_app_review_detail(beta_app_review_detail_id, options = {}) | ||
get "/v1/betaAppReviewDetails/#{beta_app_review_detail_id}", options | ||
end | ||
|
||
# @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_beta_app_review_detail | ||
def update_beta_app_review_detail(beta_app_review_detail_id, attributes) | ||
patch "/v1/betaAppReviewDetails/#{beta_app_review_detail_id}", data: { attributes: attributes, | ||
id: beta_app_review_detail_id, | ||
type: 'betaAppReviewDetails' } | ||
end | ||
|
||
# @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_app_information_of_a_beta_app_review_detail | ||
def beta_app_review_detail_app(beta_app_review_detail_id, options = {}) | ||
get "/v1/betaAppReviewDetails/#{beta_app_review_detail_id}/app", options | ||
end | ||
end | ||
end | ||
end |
35 changes: 35 additions & 0 deletions
35
spec/app_store_connect_api/client/beta_app_review_details_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe AppStoreConnectApi::Client::BetaAppReviewDetails, :api do | ||
describe '#beta_app_review_details' do | ||
subject { client.beta_app_review_details limit: 10 } | ||
|
||
it_behaves_like 'a GET endpoint', url: 'https://api.appstoreconnect.apple.com/v1/betaAppReviewDetails', | ||
query_params: { limit: 10 } | ||
end | ||
|
||
describe '#beta_app_review_detail' do | ||
subject { client.beta_app_review_detail 'beta-app-review-detail-id', include: 'app' } | ||
|
||
it_behaves_like 'a GET endpoint', url: 'https://api.appstoreconnect.apple.com/v1/betaAppReviewDetails/beta-app-review-detail-id', | ||
query_params: { include: 'app' } | ||
end | ||
|
||
describe '#update_beta_app_review_detail' do | ||
subject { client.update_beta_app_review_detail 'beta-app-review-detail-id', notes: 'Text' } | ||
|
||
it_behaves_like 'a PATCH endpoint', url: 'https://api.appstoreconnect.apple.com/v1/betaAppReviewDetails/beta-app-review-detail-id', | ||
body: { | ||
data: { attributes: { notes: 'Text' }, | ||
id: 'beta-app-review-detail-id', | ||
type: 'betaAppReviewDetails' } | ||
} | ||
end | ||
|
||
describe '#beta_app_review_detail_app' do | ||
subject { client.beta_app_review_detail_app 'beta-app-review-detail-id', fields: { apps: 'bundleId' } } | ||
|
||
it_behaves_like 'a GET endpoint', url: 'https://api.appstoreconnect.apple.com/v1/betaAppReviewDetails/beta-app-review-detail-id/app', | ||
query_params: { fields: { apps: 'bundleId' } } | ||
end | ||
end |