@@ -140,6 +140,11 @@ func (c *Client) CreateVolumePurchasingLocation(request *VolumePurchasingLocatio
140
140
defer resp .Body .Close ()
141
141
}
142
142
143
+ err = c .ReclaimVolumePurchasingLocationByID (responseLocation .ID )
144
+ if err != nil {
145
+ return nil , fmt .Errorf ("failed to reclaim volume purchasing location: %v" , err )
146
+ }
147
+
143
148
return & responseLocation , nil
144
149
}
145
150
@@ -157,6 +162,11 @@ func (c *Client) UpdateVolumePurchasingLocationByID(id string, request *VolumePu
157
162
defer resp .Body .Close ()
158
163
}
159
164
165
+ err = c .ReclaimVolumePurchasingLocationByID (responseLocation .ID )
166
+ if err != nil {
167
+ return nil , fmt .Errorf ("failed to reclaim volume purchasing location: %v" , err )
168
+ }
169
+
160
170
return & responseLocation , nil
161
171
}
162
172
@@ -175,6 +185,27 @@ func (c *Client) DeleteVolumePurchasingLocationByID(id string) error {
175
185
return nil
176
186
}
177
187
188
+ // ReclaimVolumePurchasingLocationByID reclaims a specific volume purchasing location by its ID
189
+ func (c * Client ) ReclaimVolumePurchasingLocationByID (id string ) error {
190
+ endpoint := fmt .Sprintf ("%s/%s/reclaim" , uriVolumePurchasingLocations , id )
191
+
192
+ resp , _ := c .HTTP .DoRequest ("POST" , endpoint , nil , nil )
193
+
194
+ if resp == nil {
195
+ return fmt .Errorf ("failed to reclaim volume purchasing location: received nil response" )
196
+ }
197
+
198
+ if resp .Body != nil {
199
+ defer resp .Body .Close ()
200
+ }
201
+
202
+ if resp .StatusCode != 202 {
203
+ return fmt .Errorf ("failed to reclaim volume purchasing location: unexpected status code %d" , resp .StatusCode )
204
+ }
205
+
206
+ return nil
207
+ }
208
+
178
209
// QUERY do we need the stuff below here?
179
210
180
211
// GetVolumePurchasingContentForLocationByID retrieves the content for a specific volume purchasing location by its ID.
0 commit comments