Skip to content

Commit 8173a73

Browse files
feat: try to fix name collision in codegen
1 parent c751d1a commit 8173a73

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-e5d271673921ab0a71b2c28bb60722b459bf94c927d0c41680b27db5b8f6d977.yml
3-
openapi_spec_hash: 89781fbe4b5bac8f45d8584c6aaf7b33
4-
config_hash: ea71f062b8803c872089ec60c46478be
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-da3f4038bb544acae375f44527f515dc58308f67822905258b155192041e65ed.yml
3+
openapi_spec_hash: 4c7f6f453c20eda7fd8689e8917c65f9
4+
config_hash: a7d0557c72de54fd6baded5b189777c3

api.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Methods:
2525

2626
Params Types:
2727

28-
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeAttachmentParam">VolumeAttachmentParam</a>
28+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeMountParam">VolumeMountParam</a>
2929

3030
Response Types:
3131

3232
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>
33-
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeAttachment">VolumeAttachment</a>
33+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeMount">VolumeMount</a>
3434

3535
Methods:
3636

@@ -54,6 +54,7 @@ Methods:
5454
Response Types:
5555

5656
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Volume">Volume</a>
57+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeAttachment">VolumeAttachment</a>
5758

5859
Methods:
5960

instance.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ type Instance struct {
165165
// Number of virtual CPUs
166166
Vcpus int64 `json:"vcpus"`
167167
// Volumes attached to the instance
168-
Volumes []VolumeAttachment `json:"volumes"`
168+
Volumes []VolumeMount `json:"volumes"`
169169
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
170170
JSON struct {
171171
ID respjson.Field
@@ -240,7 +240,7 @@ func (r *InstanceNetwork) UnmarshalJSON(data []byte) error {
240240
return apijson.UnmarshalRoot(data, r)
241241
}
242242

243-
type VolumeAttachment struct {
243+
type VolumeMount struct {
244244
// Path where volume is mounted in the guest
245245
MountPath string `json:"mount_path,required"`
246246
// Volume identifier
@@ -265,22 +265,22 @@ type VolumeAttachment struct {
265265
}
266266

267267
// Returns the unmodified JSON received from the API
268-
func (r VolumeAttachment) RawJSON() string { return r.JSON.raw }
269-
func (r *VolumeAttachment) UnmarshalJSON(data []byte) error {
268+
func (r VolumeMount) RawJSON() string { return r.JSON.raw }
269+
func (r *VolumeMount) UnmarshalJSON(data []byte) error {
270270
return apijson.UnmarshalRoot(data, r)
271271
}
272272

273-
// ToParam converts this VolumeAttachment to a VolumeAttachmentParam.
273+
// ToParam converts this VolumeMount to a VolumeMountParam.
274274
//
275275
// Warning: the fields of the param type will not be present. ToParam should only
276276
// be used at the last possible moment before sending a request. Test for this with
277-
// VolumeAttachmentParam.Overrides()
278-
func (r VolumeAttachment) ToParam() VolumeAttachmentParam {
279-
return param.Override[VolumeAttachmentParam](json.RawMessage(r.RawJSON()))
277+
// VolumeMountParam.Overrides()
278+
func (r VolumeMount) ToParam() VolumeMountParam {
279+
return param.Override[VolumeMountParam](json.RawMessage(r.RawJSON()))
280280
}
281281

282282
// The properties MountPath, VolumeID are required.
283-
type VolumeAttachmentParam struct {
283+
type VolumeMountParam struct {
284284
// Path where volume is mounted in the guest
285285
MountPath string `json:"mount_path,required"`
286286
// Volume identifier
@@ -295,11 +295,11 @@ type VolumeAttachmentParam struct {
295295
paramObj
296296
}
297297

298-
func (r VolumeAttachmentParam) MarshalJSON() (data []byte, err error) {
299-
type shadow VolumeAttachmentParam
298+
func (r VolumeMountParam) MarshalJSON() (data []byte, err error) {
299+
type shadow VolumeMountParam
300300
return param.MarshalObject(r, (*shadow)(&r))
301301
}
302-
func (r *VolumeAttachmentParam) UnmarshalJSON(data []byte) error {
302+
func (r *VolumeMountParam) UnmarshalJSON(data []byte) error {
303303
return apijson.UnmarshalRoot(data, r)
304304
}
305305

@@ -322,7 +322,7 @@ type InstanceNewParams struct {
322322
// Network configuration for the instance
323323
Network InstanceNewParamsNetwork `json:"network,omitzero"`
324324
// Volumes to attach to the instance at creation time
325-
Volumes []VolumeAttachmentParam `json:"volumes,omitzero"`
325+
Volumes []VolumeMountParam `json:"volumes,omitzero"`
326326
paramObj
327327
}
328328

instance_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestInstanceNewWithOptionalParams(t *testing.T) {
4040
OverlaySize: hypeman.String("20GB"),
4141
Size: hypeman.String("2GB"),
4242
Vcpus: hypeman.Int(2),
43-
Volumes: []hypeman.VolumeAttachmentParam{{
43+
Volumes: []hypeman.VolumeMountParam{{
4444
MountPath: "/mnt/data",
4545
VolumeID: "vol-abc123",
4646
Overlay: hypeman.Bool(true),

0 commit comments

Comments
 (0)