Skip to content

Commit

Permalink
Remove redundant fields from capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
sel-bukharov committed Oct 16, 2023
1 parent 5e5dfde commit 9bc53e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
45 changes: 0 additions & 45 deletions selvpcclient/resell/v2/capabilities/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package capabilities

// Capabilities contains possible availability values of different domain resources.
type Capabilities struct {
// Licenses contains licenses information.
Licenses []License `json:"licenses"`

// Logo contains project logo information.
Logo Logo `json:"logo"`

Expand All @@ -13,21 +10,6 @@ type Capabilities struct {

// Resources contains billing resources information.
Resources []Resource `json:"resources"`

// Subnets contains public subnets information.
Subnets []Subnet `json:"subnets"`

// Traffic contains domain traffic information.
Traffic Traffic `json:"traffic"`
}

// License contains single license information.
type License struct {
// Availability contains availability between locations.
Availability []string `json:"availability"`

// Type represents license type.
Type string `json:"type"`
}

// Logo contains project logo information.
Expand Down Expand Up @@ -86,30 +68,3 @@ type Resource struct {
// Unbillable shows if resource is not should be billed.
Unbillable bool `json:"unbillable"`
}

// Subnet contains information about single public subnet.
type Subnet struct {
// Availability contains availability between locations.
Availability []string `json:"availability"`

// Type represents subnet type.
Type string `json:"type"`

// PrefixLength represents subnet prefix length.
PrefixLength string `json:"prefix_length"`
}

// Traffic contains information about domain traffic.
type Traffic struct {
// Granularities represents traffic granularities.
Granularities []Granularity `json:"granularities"`
}

// Granularity contains information about domain traffic granularity.
type Granularity struct {
// Granularity represents granularity in seconds.
Granularity int `json:"granularity"`

// Timespan represents period of time in days.
Timespan int `json:"timespan"`
}
9 changes: 0 additions & 9 deletions selvpcclient/resell/v2/capabilities/testing/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,12 @@ func TestGetCapabilities(t *testing.T) {
if c == nil {
t.Fatal("didn't get capabilities")
}
if len(c.Licenses) != 2 {
t.Errorf("expected 2 licenses, but got %d", len(c.Licenses))
}
if len(c.Regions) != 3 {
t.Errorf("expected 3 regions, but got %d", len(c.Regions))
}
if len(c.Resources) != 16 {
t.Errorf("expected 16 resources, but got %d", len(c.Resources))
}
if len(c.Subnets) != 1 {
t.Errorf("expected 1 subnets, but got %d", len(c.Subnets))
}
if len(c.Traffic.Granularities) != 3 {
t.Errorf("expected 3 traffic granularities, but got %d", len(c.Traffic.Granularities))
}
}

func TestGetCapabilitiesHTTPError(t *testing.T) {
Expand Down

0 comments on commit 9bc53e1

Please sign in to comment.