From e55797e157b0a6bae1af98912170e49747c9a464 Mon Sep 17 00:00:00 2001 From: Lukas Malkmus Date: Thu, 15 Jun 2023 20:13:25 +0200 Subject: [PATCH] fix(orgs): rename plan 'hobby' -> 'personal' --- axiom/orgs.go | 8 ++++---- axiom/orgs_string.go | 6 +++--- axiom/orgs_test.go | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/axiom/orgs.go b/axiom/orgs.go index 92255719..8b34d014 100644 --- a/axiom/orgs.go +++ b/axiom/orgs.go @@ -21,9 +21,9 @@ type Plan uint8 const ( emptyPlan Plan = iota // - Hobby // hobby + Personal // personal Basic // basic - Team // team + Team // teamMonthly Enterprise // enterprise Comped // comped ) @@ -32,8 +32,8 @@ func planFromString(s string) (plan Plan, err error) { switch s { case emptyPlan.String(): plan = emptyPlan - case Hobby.String(): - plan = Hobby + case Personal.String(): + plan = Personal case Basic.String(): plan = Basic case Team.String(): diff --git a/axiom/orgs_string.go b/axiom/orgs_string.go index 55ebb332..9e04a893 100644 --- a/axiom/orgs_string.go +++ b/axiom/orgs_string.go @@ -9,16 +9,16 @@ func _() { // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[emptyPlan-0] - _ = x[Hobby-1] + _ = x[Personal-1] _ = x[Basic-2] _ = x[Team-3] _ = x[Enterprise-4] _ = x[Comped-5] } -const _Plan_name = "hobbybasicteamenterprisecomped" +const _Plan_name = "personalbasicteamMonthlyenterprisecomped" -var _Plan_index = [...]uint8{0, 0, 5, 10, 14, 24, 30} +var _Plan_index = [...]uint8{0, 0, 8, 13, 24, 34, 40} func (i Plan) String() string { if i >= Plan(len(_Plan_index)-1) { diff --git a/axiom/orgs_test.go b/axiom/orgs_test.go index 7d3e3393..1abec3be 100644 --- a/axiom/orgs_test.go +++ b/axiom/orgs_test.go @@ -196,13 +196,13 @@ func TestOrganizationsService_Get(t *testing.T) { func TestPlan_Marshal(t *testing.T) { exp := `{ - "plan": "hobby" + "plan": "personal" }` b, err := json.Marshal(struct { Plan Plan `json:"plan"` }{ - Plan: Hobby, + Plan: Personal, }) require.NoError(t, err) require.NotEmpty(t, b) @@ -214,10 +214,10 @@ func TestPlan_Unmarshal(t *testing.T) { var act struct { Plan Plan `json:"plan"` } - err := json.Unmarshal([]byte(`{ "plan": "hobby" }`), &act) + err := json.Unmarshal([]byte(`{ "plan": "personal" }`), &act) require.NoError(t, err) - assert.Equal(t, Hobby, act.Plan) + assert.Equal(t, Personal, act.Plan) } func TestPlan_String(t *testing.T) { @@ -227,7 +227,7 @@ func TestPlan_String(t *testing.T) { assert.Equal(t, emptyPlan, Plan(0)) assert.Contains(t, (Comped + 1).String(), "Plan(") - for p := Hobby; p <= Comped; p++ { + for p := Personal; p <= Comped; p++ { s := p.String() assert.NotEmpty(t, s) assert.NotContains(t, s, "Plan(") @@ -235,7 +235,7 @@ func TestPlan_String(t *testing.T) { } func TestPlanFromString(t *testing.T) { - for plan := Hobby; plan <= Comped; plan++ { + for plan := Personal; plan <= Comped; plan++ { s := plan.String() parsedPlan, err := planFromString(s) @@ -301,7 +301,7 @@ func TestPaymentStatusFromString(t *testing.T) { func TestLicense(t *testing.T) { exp := License{ ID: "98baf1f7-0b51-403f-abc1-2ee91972a225", - Plan: Hobby, + Plan: Personal, MaxUsers: 50, MaxTeams: 10, MaxDatasets: 25,