@@ -34,7 +34,7 @@ func NewOrgService(opts ...option.RequestOption) (r OrgService) {
3434}
3535
3636// Retrieve an organization by name
37- func (r * OrgService ) Get (ctx context.Context , org string , opts ... option.RequestOption ) (res * OrgGetResponse , err error ) {
37+ func (r * OrgService ) Get (ctx context.Context , org string , opts ... option.RequestOption ) (res * Org , err error ) {
3838 opts = append (r .Options [:], opts ... )
3939 if org == "" {
4040 err = errors .New ("missing required org parameter" )
@@ -53,11 +53,11 @@ func (r *OrgService) List(ctx context.Context, opts ...option.RequestOption) (re
5353 return
5454}
5555
56- type OrgGetResponse struct {
56+ type Org struct {
5757 DisplayName string `json:"display_name,required"`
5858 // Any of "org".
59- Object OrgGetResponseObject `json:"object,required"`
60- Slug string `json:"slug,required"`
59+ Object OrgObject `json:"object,required"`
60+ Slug string `json:"slug,required"`
6161 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
6262 JSON struct {
6363 DisplayName respjson.Field
@@ -69,21 +69,21 @@ type OrgGetResponse struct {
6969}
7070
7171// Returns the unmodified JSON received from the API
72- func (r OrgGetResponse ) RawJSON () string { return r .JSON .raw }
73- func (r * OrgGetResponse ) UnmarshalJSON (data []byte ) error {
72+ func (r Org ) RawJSON () string { return r .JSON .raw }
73+ func (r * Org ) UnmarshalJSON (data []byte ) error {
7474 return apijson .UnmarshalRoot (data , r )
7575}
7676
77- type OrgGetResponseObject string
77+ type OrgObject string
7878
7979const (
80- OrgGetResponseObjectOrg OrgGetResponseObject = "org"
80+ OrgObjectOrg OrgObject = "org"
8181)
8282
8383type OrgListResponse struct {
84- Data []OrgListResponseData `json:"data,required"`
85- HasMore bool `json:"has_more,required"`
86- NextCursor string `json:"next_cursor"`
84+ Data []Org `json:"data,required"`
85+ HasMore bool `json:"has_more,required"`
86+ NextCursor string `json:"next_cursor"`
8787 // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
8888 JSON struct {
8989 Data respjson.Field
@@ -99,24 +99,3 @@ func (r OrgListResponse) RawJSON() string { return r.JSON.raw }
9999func (r * OrgListResponse ) UnmarshalJSON (data []byte ) error {
100100 return apijson .UnmarshalRoot (data , r )
101101}
102-
103- type OrgListResponseData struct {
104- DisplayName string `json:"display_name,required"`
105- // Any of "org".
106- Object string `json:"object,required"`
107- Slug string `json:"slug,required"`
108- // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
109- JSON struct {
110- DisplayName respjson.Field
111- Object respjson.Field
112- Slug respjson.Field
113- ExtraFields map [string ]respjson.Field
114- raw string
115- } `json:"-"`
116- }
117-
118- // Returns the unmodified JSON received from the API
119- func (r OrgListResponseData ) RawJSON () string { return r .JSON .raw }
120- func (r * OrgListResponseData ) UnmarshalJSON (data []byte ) error {
121- return apijson .UnmarshalRoot (data , r )
122- }
0 commit comments