Skip to content
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

APPS-8398: Remove ListTiers and GetTier APIs #707

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ type AppsService interface {

ListRegions(ctx context.Context) ([]*AppRegion, *Response, error)

ListTiers(ctx context.Context) ([]*AppTier, *Response, error)
GetTier(ctx context.Context, slug string) (*AppTier, *Response, error)

ListInstanceSizes(ctx context.Context) ([]*AppInstanceSize, *Response, error)
GetInstanceSize(ctx context.Context, slug string) (*AppInstanceSize, *Response, error)

Expand Down Expand Up @@ -381,36 +378,6 @@ func (s *AppsServiceOp) ListRegions(ctx context.Context) ([]*AppRegion, *Respons
return root.Regions, resp, nil
}

// ListTiers lists available app tiers.
func (s *AppsServiceOp) ListTiers(ctx context.Context) ([]*AppTier, *Response, error) {
path := fmt.Sprintf("%s/tiers", appsBasePath)
req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
if err != nil {
return nil, nil, err
}
root := new(appTiersRoot)
resp, err := s.client.Do(ctx, req, root)
if err != nil {
return nil, resp, err
}
return root.Tiers, resp, nil
}

// GetTier retrieves information about a specific app tier.
func (s *AppsServiceOp) GetTier(ctx context.Context, slug string) (*AppTier, *Response, error) {
path := fmt.Sprintf("%s/tiers/%s", appsBasePath, slug)
req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
if err != nil {
return nil, nil, err
}
root := new(appTierRoot)
resp, err := s.client.Do(ctx, req, root)
if err != nil {
return nil, resp, err
}
return root.Tier, resp, nil
}

// ListInstanceSizes lists available instance sizes for service, worker, and job components.
func (s *AppsServiceOp) ListInstanceSizes(ctx context.Context) ([]*AppInstanceSize, *Response, error) {
path := fmt.Sprintf("%s/tiers/instance_sizes", appsBasePath)
Expand Down
34 changes: 0 additions & 34 deletions apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,40 +577,6 @@ func TestApps_ListRegions(t *testing.T) {
assert.Equal(t, []*AppRegion{&testAppRegion}, regions)
}

func TestApps_ListTiers(t *testing.T) {
setup()
defer teardown()

ctx := context.Background()

mux.HandleFunc("/v2/apps/tiers", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodGet)

json.NewEncoder(w).Encode(&appTiersRoot{Tiers: []*AppTier{&testAppTier}})
})

tiers, _, err := client.Apps.ListTiers(ctx)
require.NoError(t, err)
assert.Equal(t, []*AppTier{&testAppTier}, tiers)
}

func TestApps_GetTier(t *testing.T) {
setup()
defer teardown()

ctx := context.Background()

mux.HandleFunc(fmt.Sprintf("/v2/apps/tiers/%s", testAppTier.Slug), func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodGet)

json.NewEncoder(w).Encode(&appTierRoot{Tier: &testAppTier})
})

tier, _, err := client.Apps.GetTier(ctx, testAppTier.Slug)
require.NoError(t, err)
assert.Equal(t, &testAppTier, tier)
}

func TestApps_ListInstanceSizes(t *testing.T) {
setup()
defer teardown()
Expand Down
Loading