Skip to content

Commit

Permalink
get subs by group
Browse files Browse the repository at this point in the history
  • Loading branch information
incrementing committed Aug 30, 2023
1 parent c0016f0 commit 1d022af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions asc/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ type SubscriptionGroupResponse struct {
Links DocumentLinks `json:"links"`
}

type SubscriptionsResponse struct {
Data []Subscription `json:"data"`
Links DocumentLinks `json:"links"`
}

type Subscription struct {
Attributes SubscriptionAttributes `json:"attributes"`
ID string `json:"id"`
Expand Down Expand Up @@ -353,6 +358,15 @@ func (s *SubscriptionsService) CreateSubscriptionPriceChange(ctx context.Context
return res, resp, err
}

// ListSubscriptionsByGroup returns a list of subscriptions for a given subscription group ID.
//
// https://developer.apple.com/documentation/appstoreconnectapi/list_all_subscriptions_for_a_subscription_group
func (s *SubscriptionsService) ListSubscriptionsByGroup(ctx context.Context, id string) (*SubscriptionsResponse, *Response, error) {
res := new(SubscriptionsResponse)
resp, err := s.client.get(ctx, "v1/subscriptionGroups/"+id+"/subscriptions", nil, res)
return res, resp, err
}

// GetSubscription returns the subscription for a given subscription ID.
//
// https://developer.apple.com/documentation/appstoreconnectapi/read_subscription_information
Expand Down

0 comments on commit 1d022af

Please sign in to comment.