-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[spaceship] support fetching build_bundle_file_sizes
for a BuildBundle
#20860
Changes from all commits
f0f9833
d6667e2
5786256
b0968df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require_relative '../model' | ||
module Spaceship | ||
class ConnectAPI | ||
class BuildBundleFileSizes | ||
include Spaceship::ConnectAPI::Model | ||
|
||
attr_accessor :device_model | ||
attr_accessor :os_version | ||
attr_accessor :download_bytes | ||
attr_accessor :install_bytes | ||
|
||
attr_mapping({ | ||
"deviceModel" => "device_model", | ||
"osVersion" => "os_version", | ||
"downloadBytes" => "download_bytes", | ||
"installBytes" => "install_bytes" | ||
}) | ||
|
||
def self.type | ||
return "buildBundleFileSizes" | ||
end | ||
|
||
# | ||
# API | ||
# | ||
|
||
def self.all(client: nil, build_bundle_id: nil, limit: 30) | ||
client ||= Spaceship::ConnectAPI | ||
resps = client.get_build_bundles_build_bundle_file_sizes(build_bundle_id: build_bundle_id).all_pages | ||
resps.flat_map(&:to_models) | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -412,6 +412,15 @@ def get_beta_tester_metrics(filter: {}, includes: nil, limit: nil, sort: nil) | |
test_flight_request_client.get("betaTesterMetrics", params) | ||
end | ||
|
||
# | ||
# buildBundles | ||
# | ||
|
||
def get_build_bundles_build_bundle_file_sizes(build_bundle_id:, limit: nil) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went with |
||
params = test_flight_request_client.build_params(filter: nil, includes: nil, limit: limit, sort: nil, cursor: nil) | ||
test_flight_request_client.get("buildBundles/#{build_bundle_id}/buildBundleFileSizes", params) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Am I in the right place? Is the TestFlight client the right place to implement this kind of thing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This client names are a little bit weird since App Store Connect API has changed a bit since this was create 🙈 But yup! This would be the correct place for this 💪 |
||
end | ||
|
||
# | ||
# builds | ||
# | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is quite the mouthful 😄
I stuck with it because the endpoint is
buildBundles/{id}/buildBundleFileSizes
so there is some repetition here already... There are other buildBundles methods that don't have the repetition, so if we implemented everything, I was imagining that it would look like this:get_build_bundles_build_bundle_file_sizes
buildBundles/{id}/buildBundleFileSizes
get_build_bundles_ app_clip_domain_cache_status
buildBundles/{id}/appClipDomainCacheStatus
get_build_bundles_app_clip_domain_debug_status
buildBundles/{id}/appClipDomainDebugStatus
get_build_bundles_beta_app_clip_invocations
buildBundles/{id}/betaAppClipInvocations
Would that make sense? If there is a better approach, please let me know 🙏 I couldn't really find any other examples to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is quite the mouthful 😅 I feel like this is generally okay here though. We provide helper methods in th models to make this easier to use for most users.
Eventually maybe we can namespace this better but that would require a whole redesign so I think this method name makes sense on the route that it's doing.