@@ -2,6 +2,7 @@ package main
22
33import (
44 "encoding/json"
5+ "fmt"
56
67 "net/url"
78 "strings"
@@ -14,24 +15,8 @@ import (
1415// BillingAccount is an entity of the Swisscom Application Cloud which handles billing.
1516type BillingAccount struct {
1617 Metadata struct {
17- GUID string `json:"guid"`
18- URL string `json:"url"`
19- CreatedAt string `json:"created_at"`
20- UpdatedAt string `json:"updated_at"`
18+ GUID string `json:"guid"`
2119 } `json:"metadata"`
22- Entity struct {
23- Status string `json:"status"`
24- StatusReasonData struct {
25- Code string `json:"code"`
26- Description string `json:"description"`
27- } `json:"status_reason_data"`
28- Prohibited bool `json:"prohibited"`
29- Name string `json:"name"`
30- CustomerNumber string `json:"customer_number"`
31- CustomerType string `json:"customer_type"`
32- OrganizationCount int `json:"organization_count"`
33- MaxOrganizations int `json:"max_organizations"`
34- } `json:"entity"`
3520}
3621
3722// BillingAccountResponse is a response from the server to a billing account request.
@@ -42,7 +27,7 @@ type BillingAccountResponse struct {
4227
4328// getBillingAccount retrieves a billing account by name.
4429func getBillingAccount (c plugin.CliConnection , name string ) (BillingAccount , error ) {
45- accURL := url .QueryEscape ("/custom/accounts?q=name:%s" )
30+ accURL := url .QueryEscape (fmt . Sprintf ( "/custom/accounts?q=name:%s" , name ) )
4631 resLines , err := c .CliCommandWithoutTerminalOutput ("curl" , accURL )
4732
4833 if err != nil {
0 commit comments