@@ -105,7 +105,11 @@ func (c *VendorV3Client) CreateChannel(appID, name, description string) (*types.
105105 Name : name ,
106106 Description : description ,
107107 }
108- var response types.KotsChannel
108+
109+ type createChannelResponse struct {
110+ Channel types.KotsChannel `json:"channel"`
111+ }
112+ var response createChannelResponse
109113
110114 url := fmt .Sprintf ("/v3/app/%s/channel" , appID )
111115 err := c .DoJSON ("POST" , url , http .StatusCreated , request , & response )
@@ -114,30 +118,34 @@ func (c *VendorV3Client) CreateChannel(appID, name, description string) (*types.
114118 }
115119
116120 return & types.Channel {
117- ID : response .Id ,
118- Name : response .Name ,
119- Description : response .Description ,
120- Slug : response .ChannelSlug ,
121- ReleaseSequence : int64 (response .ReleaseSequence ),
122- ReleaseLabel : response .CurrentVersion ,
123- IsArchived : response .IsArchived ,
121+ ID : response .Channel . Id ,
122+ Name : response .Channel . Name ,
123+ Description : response .Channel . Description ,
124+ Slug : response .Channel . ChannelSlug ,
125+ ReleaseSequence : int64 (response .Channel . ReleaseSequence ),
126+ ReleaseLabel : response .Channel . CurrentVersion ,
127+ IsArchived : response .Channel . IsArchived ,
124128 }, nil
125129}
126130
127131func (c * VendorV3Client ) GetChannel (appID string , channelID string ) (* channels.AppChannel , []channels.ChannelRelease , error ) {
128- response := types.KotsChannel {}
132+ type getChannelResponse struct {
133+ Channel types.KotsChannel `json:"channel"`
134+ }
135+
136+ response := getChannelResponse {}
129137 url := fmt .Sprintf ("/v3/app/%s/channel/%s" , appID , url .QueryEscape (channelID ))
130138 err := c .DoJSON ("GET" , url , http .StatusOK , nil , & response )
131139 if err != nil {
132140 return nil , nil , errors .Wrap (err , "get app channel" )
133141 }
134142
135143 channelDetail := channels.AppChannel {
136- Id : response .Id ,
137- Name : response .Name ,
138- Description : response .Description ,
139- ReleaseLabel : response .CurrentVersion ,
140- ReleaseSequence : int64 (response .ReleaseSequence ),
144+ Id : response .Channel . Id ,
145+ Name : response .Channel . Name ,
146+ Description : response .Channel . Description ,
147+ ReleaseLabel : response .Channel . CurrentVersion ,
148+ ReleaseSequence : int64 (response .Channel . ReleaseSequence ),
141149 }
142150 return & channelDetail , nil , nil
143151}
0 commit comments