From c776f264b0ab7bf97de8624df5ae6e201d7ac26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COleksandr?= <90334925+olekgo@users.noreply.github.com> Date: Tue, 9 Apr 2024 01:03:39 +0100 Subject: [PATCH 1/4] fix TaggedVlans type --- model_interface.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/model_interface.go b/model_interface.go index 567f64cca..ed594427f 100644 --- a/model_interface.go +++ b/model_interface.go @@ -54,7 +54,7 @@ type Interface struct { RfChannelWidth NullableFloat64 `json:"rf_channel_width,omitempty"` TxPower NullableInt32 `json:"tx_power,omitempty"` UntaggedVlan NullableNestedVLAN `json:"untagged_vlan,omitempty"` - TaggedVlans []int32 `json:"tagged_vlans,omitempty"` + TaggedVlans []NestedVLAN `json:"tagged_vlans,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` Cable NullableNestedCable `json:"cable"` @@ -1142,9 +1142,9 @@ func (o *Interface) UnsetUntaggedVlan() { } // GetTaggedVlans returns the TaggedVlans field value if set, zero value otherwise. -func (o *Interface) GetTaggedVlans() []int32 { +func (o *Interface) GetTaggedVlans() []NestedVLAN { if o == nil || IsNil(o.TaggedVlans) { - var ret []int32 + var ret []NestedVLAN return ret } return o.TaggedVlans @@ -1152,7 +1152,7 @@ func (o *Interface) GetTaggedVlans() []int32 { // GetTaggedVlansOk returns a tuple with the TaggedVlans field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Interface) GetTaggedVlansOk() ([]int32, bool) { +func (o *Interface) GetTaggedVlansOk() ([]NestedVLAN, bool) { if o == nil || IsNil(o.TaggedVlans) { return nil, false } @@ -1169,7 +1169,7 @@ func (o *Interface) HasTaggedVlans() bool { } // SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. -func (o *Interface) SetTaggedVlans(v []int32) { +func (o *Interface) SetTaggedVlans(v []NestedVLAN) { o.TaggedVlans = v } From 5da5777b3e3967ef715e8fd0b082249898c5b1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COleksandr?= <90334925+olekgo@users.noreply.github.com> Date: Tue, 9 Apr 2024 01:40:52 +0100 Subject: [PATCH 2/4] fix go.mod, go.sum --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index e47143be5..809783e8f 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -module github.com/netbox-community/go-netbox/v3 +module github.com/olekgo/go-netbox/v3 go 1.18 -require github.com/stretchr/testify v1.8.4 +require github.com/stretchr/testify v1.9.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index fa4b6e682..60ce688a0 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 5ed4128b9354963c894286483eccd82bc6a861b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COleksandr?= <90334925+olekgo@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:01:46 +0100 Subject: [PATCH 3/4] NestedVLAN and NestedASN --- .openapi-generator/FILES | 2 + api/openapi.yaml | 32 ++++- docs/Interface.md | 8 +- docs/NestedASN.md | 114 ++++++++++++++++++ docs/Site.md | 8 +- model_interface.go | 4 +- model_nested_asn.go | 254 +++++++++++++++++++++++++++++++++++++++ model_site.go | 12 +- scripts/fix-spec.py | 24 ++++ 9 files changed, 440 insertions(+), 18 deletions(-) create mode 100644 docs/NestedASN.md create mode 100644 model_nested_asn.go diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index fae151a2d..ad26d3460 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -315,6 +315,7 @@ docs/ModuleStatusLabel.md docs/ModuleStatusValue.md docs/ModuleType.md docs/ModuleTypeRequest.md +docs/NestedASN.md docs/NestedCable.md docs/NestedCableRequest.md docs/NestedCircuit.md @@ -1236,6 +1237,7 @@ model_module_status_label.go model_module_status_value.go model_module_type.go model_module_type_request.go +model_nested_asn.go model_nested_cable.go model_nested_cable_request.go model_nested_circuit.go diff --git a/api/openapi.yaml b/api/openapi.yaml index c7bb24cd8..842c1eaa8 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -104425,7 +104425,7 @@ components: tagged_vlans: type: array items: - type: integer + $ref: '#/components/schemas/NestedVLAN' mark_connected: type: boolean description: Treat as if a cable is connected @@ -108426,6 +108426,34 @@ components: - display - id - url + NestedASN: + type: object + description: |- + Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a + dictionary of attributes which can be used to uniquely identify the related object. This class should be + subclassed to return a full representation of the related object on read. + properties: + id: + type: integer + readOnly: true + url: + type: string + format: uri + readOnly: true + display: + type: string + readOnly: true + asn: + type: integer + maximum: 4294967295 + minimum: 1 + format: int64 + description: 16- or 32-bit autonomous system number + required: + - asn + - display + - id + - url NestedCableRequest: type: object description: 'Represents an object related through a ForeignKey field. On write, @@ -129233,7 +129261,7 @@ components: asns: type: array items: - type: integer + $ref: '#/components/schemas/NestedASN' tags: type: array items: diff --git a/docs/Interface.md b/docs/Interface.md index b4a4cd18d..2cfdbb028 100644 --- a/docs/Interface.md +++ b/docs/Interface.md @@ -33,7 +33,7 @@ Name | Type | Description | Notes **RfChannelWidth** | Pointer to **NullableFloat64** | Populated by selected channel (if set) | [optional] **TxPower** | Pointer to **NullableInt32** | | [optional] **UntaggedVlan** | Pointer to [**NullableNestedVLAN**](NestedVLAN.md) | | [optional] -**TaggedVlans** | Pointer to **[]int32** | | [optional] +**TaggedVlans** | Pointer to [**[]NestedVLAN**](NestedVLAN.md) | | [optional] **MarkConnected** | Pointer to **bool** | Treat as if a cable is connected | [optional] **Cable** | [**NullableNestedCable**](NestedCable.md) | | [readonly] **CableEnd** | **string** | | [readonly] @@ -900,20 +900,20 @@ HasUntaggedVlan returns a boolean if a field has been set. UnsetUntaggedVlan ensures that no value is present for UntaggedVlan, not even an explicit nil ### GetTaggedVlans -`func (o *Interface) GetTaggedVlans() []int32` +`func (o *Interface) GetTaggedVlans() []NestedVLAN` GetTaggedVlans returns the TaggedVlans field if non-nil, zero value otherwise. ### GetTaggedVlansOk -`func (o *Interface) GetTaggedVlansOk() (*[]int32, bool)` +`func (o *Interface) GetTaggedVlansOk() (*[]NestedVLAN, bool)` GetTaggedVlansOk returns a tuple with the TaggedVlans field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTaggedVlans -`func (o *Interface) SetTaggedVlans(v []int32)` +`func (o *Interface) SetTaggedVlans(v []NestedVLAN)` SetTaggedVlans sets TaggedVlans field to given value. diff --git a/docs/NestedASN.md b/docs/NestedASN.md new file mode 100644 index 000000000..a93d1ab99 --- /dev/null +++ b/docs/NestedASN.md @@ -0,0 +1,114 @@ +# NestedASN + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [readonly] +**Url** | **string** | | [readonly] +**Display** | **string** | | [readonly] +**Asn** | **int64** | 16- or 32-bit autonomous system number | + +## Methods + +### NewNestedASN + +`func NewNestedASN(id int32, url string, display string, asn int64, ) *NestedASN` + +NewNestedASN instantiates a new NestedASN object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNestedASNWithDefaults + +`func NewNestedASNWithDefaults() *NestedASN` + +NewNestedASNWithDefaults instantiates a new NestedASN object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *NestedASN) GetId() int32` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *NestedASN) GetIdOk() (*int32, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *NestedASN) SetId(v int32)` + +SetId sets Id field to given value. + + +### GetUrl + +`func (o *NestedASN) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *NestedASN) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *NestedASN) SetUrl(v string)` + +SetUrl sets Url field to given value. + + +### GetDisplay + +`func (o *NestedASN) GetDisplay() string` + +GetDisplay returns the Display field if non-nil, zero value otherwise. + +### GetDisplayOk + +`func (o *NestedASN) GetDisplayOk() (*string, bool)` + +GetDisplayOk returns a tuple with the Display field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisplay + +`func (o *NestedASN) SetDisplay(v string)` + +SetDisplay sets Display field to given value. + + +### GetAsn + +`func (o *NestedASN) GetAsn() int64` + +GetAsn returns the Asn field if non-nil, zero value otherwise. + +### GetAsnOk + +`func (o *NestedASN) GetAsnOk() (*int64, bool)` + +GetAsnOk returns a tuple with the Asn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAsn + +`func (o *NestedASN) SetAsn(v int64)` + +SetAsn sets Asn field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Site.md b/docs/Site.md index 71facb16e..e35992628 100644 --- a/docs/Site.md +++ b/docs/Site.md @@ -21,7 +21,7 @@ Name | Type | Description | Notes **Latitude** | Pointer to **NullableFloat64** | GPS coordinate in decimal format (xx.yyyyyy) | [optional] **Longitude** | Pointer to **NullableFloat64** | GPS coordinate in decimal format (xx.yyyyyy) | [optional] **Comments** | Pointer to **string** | | [optional] -**Asns** | Pointer to **[]int32** | | [optional] +**Asns** | Pointer to [**[]NestedASN**](NestedASN.md) | | [optional] **Tags** | Pointer to [**[]NestedTag**](NestedTag.md) | | [optional] **CustomFields** | Pointer to **map[string]interface{}** | | [optional] **Created** | **NullableTime** | | [readonly] @@ -514,20 +514,20 @@ HasComments returns a boolean if a field has been set. ### GetAsns -`func (o *Site) GetAsns() []int32` +`func (o *Site) GetAsns() []NestedASN` GetAsns returns the Asns field if non-nil, zero value otherwise. ### GetAsnsOk -`func (o *Site) GetAsnsOk() (*[]int32, bool)` +`func (o *Site) GetAsnsOk() (*[]NestedASN, bool)` GetAsnsOk returns a tuple with the Asns field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAsns -`func (o *Site) SetAsns(v []int32)` +`func (o *Site) SetAsns(v []NestedASN)` SetAsns sets Asns field to given value. diff --git a/model_interface.go b/model_interface.go index ed594427f..10ce7d5c8 100644 --- a/model_interface.go +++ b/model_interface.go @@ -54,7 +54,7 @@ type Interface struct { RfChannelWidth NullableFloat64 `json:"rf_channel_width,omitempty"` TxPower NullableInt32 `json:"tx_power,omitempty"` UntaggedVlan NullableNestedVLAN `json:"untagged_vlan,omitempty"` - TaggedVlans []NestedVLAN `json:"tagged_vlans,omitempty"` + TaggedVlans []NestedVLAN `json:"tagged_vlans,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` Cable NullableNestedCable `json:"cable"` @@ -1168,7 +1168,7 @@ func (o *Interface) HasTaggedVlans() bool { return false } -// SetTaggedVlans gets a reference to the given []int32 and assigns it to the TaggedVlans field. +// SetTaggedVlans gets a reference to the given []NestedVLAN and assigns it to the TaggedVlans field. func (o *Interface) SetTaggedVlans(v []NestedVLAN) { o.TaggedVlans = v } diff --git a/model_nested_asn.go b/model_nested_asn.go new file mode 100644 index 000000000..2585d51bc --- /dev/null +++ b/model_nested_asn.go @@ -0,0 +1,254 @@ +/* +NetBox REST API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 3.7.1 (3.7) +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package netbox + +import ( + "encoding/json" + "fmt" +) + +// checks if the NestedASN type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NestedASN{} + +// NestedASN Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. +type NestedASN struct { + Id int32 `json:"id"` + Url string `json:"url"` + Display string `json:"display"` + // 16- or 32-bit autonomous system number + Asn int64 `json:"asn"` + AdditionalProperties map[string]interface{} +} + +type _NestedASN NestedASN + +// NewNestedASN instantiates a new NestedASN object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNestedASN(id int32, url string, display string, asn int64) *NestedASN { + this := NestedASN{} + this.Id = id + this.Url = url + this.Display = display + this.Asn = asn + return &this +} + +// NewNestedASNWithDefaults instantiates a new NestedASN object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNestedASNWithDefaults() *NestedASN { + this := NestedASN{} + return &this +} + +// GetId returns the Id field value +func (o *NestedASN) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *NestedASN) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *NestedASN) SetId(v int32) { + o.Id = v +} + +// GetUrl returns the Url field value +func (o *NestedASN) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *NestedASN) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *NestedASN) SetUrl(v string) { + o.Url = v +} + +// GetDisplay returns the Display field value +func (o *NestedASN) GetDisplay() string { + if o == nil { + var ret string + return ret + } + + return o.Display +} + +// GetDisplayOk returns a tuple with the Display field value +// and a boolean to check if the value has been set. +func (o *NestedASN) GetDisplayOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Display, true +} + +// SetDisplay sets field value +func (o *NestedASN) SetDisplay(v string) { + o.Display = v +} + +// GetAsn returns the Asn field value +func (o *NestedASN) GetAsn() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *NestedASN) GetAsnOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *NestedASN) SetAsn(v int64) { + o.Asn = v +} + +func (o NestedASN) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NestedASN) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["url"] = o.Url + toSerialize["display"] = o.Display + toSerialize["asn"] = o.Asn + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NestedASN) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "url", + "display", + "asn", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNestedASN := _NestedASN{} + + err = json.Unmarshal(data, &varNestedASN) + + if err != nil { + return err + } + + *o = NestedASN(varNestedASN) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "url") + delete(additionalProperties, "display") + delete(additionalProperties, "asn") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNestedASN struct { + value *NestedASN + isSet bool +} + +func (v NullableNestedASN) Get() *NestedASN { + return v.value +} + +func (v *NullableNestedASN) Set(val *NestedASN) { + v.value = val + v.isSet = true +} + +func (v NullableNestedASN) IsSet() bool { + return v.isSet +} + +func (v *NullableNestedASN) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNestedASN(val *NestedASN) *NullableNestedASN { + return &NullableNestedASN{value: val, isSet: true} +} + +func (v NullableNestedASN) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNestedASN) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_site.go b/model_site.go index 9f805087d..9a684ca74 100644 --- a/model_site.go +++ b/model_site.go @@ -44,7 +44,7 @@ type Site struct { // GPS coordinate in decimal format (xx.yyyyyy) Longitude NullableFloat64 `json:"longitude,omitempty"` Comments *string `json:"comments,omitempty"` - Asns []int32 `json:"asns,omitempty"` + Asns []NestedASN `json:"asns,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` Created NullableTime `json:"created"` @@ -661,9 +661,9 @@ func (o *Site) SetComments(v string) { } // GetAsns returns the Asns field value if set, zero value otherwise. -func (o *Site) GetAsns() []int32 { +func (o *Site) GetAsns() []NestedASN { if o == nil || IsNil(o.Asns) { - var ret []int32 + var ret []NestedASN return ret } return o.Asns @@ -671,7 +671,7 @@ func (o *Site) GetAsns() []int32 { // GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Site) GetAsnsOk() ([]int32, bool) { +func (o *Site) GetAsnsOk() ([]NestedASN, bool) { if o == nil || IsNil(o.Asns) { return nil, false } @@ -687,8 +687,8 @@ func (o *Site) HasAsns() bool { return false } -// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. -func (o *Site) SetAsns(v []int32) { +// SetAsns gets a reference to the given []NestedASN and assigns it to the Asns field. +func (o *Site) SetAsns(v []NestedASN) { o.Asns = v } diff --git a/scripts/fix-spec.py b/scripts/fix-spec.py index 926763bdb..848d68627 100755 --- a/scripts/fix-spec.py +++ b/scripts/fix-spec.py @@ -29,6 +29,30 @@ if ntype in schema['properties']: schema['properties'][ntype]['nullable'] = True +data["components"]["schemas"]["Site"]["properties"]["asns"]["items"].pop("type") +data["components"]["schemas"]["Interface"]["properties"]["tagged_vlans"]["items"].pop("type") +data["components"]["schemas"]["Site"]["properties"]["asns"]["items"]["$ref"] = "#/components/schemas/NestedASN" +data["components"]["schemas"]["Interface"]["properties"]["tagged_vlans"]["items"]["$ref"] = "#/components/schemas/NestedVLAN" +data["components"]["schemas"]["NestedASN"] = { + "type": "object", + "description": """Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a + dictionary of attributes which can be used to uniquely identify the related object. This class should be + subclassed to return a full representation of the related object on read.""", + "properties": { + "id": {"type": "integer", "readOnly": True}, + "url": {"type": "string", "format": "uri", "readOnly": True}, + "display": {"type": "string", "readOnly": True}, + "asn": { + "type": "integer", + "maximum": 4294967295, + "minimum": 1, + "format": "int64", + "description": "16- or 32-bit autonomous system number", + }, + }, + "required": ["asn", "display", "id", "url"], +} + # Save the spec file with open(SPEC_PATH, 'w') as file: yaml.dump(data, file, Dumper=yaml.CDumper, sort_keys=False) From 9fd3ed3bf8da317e35df1149a9f0d497737baaab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COleksandr?= <90334925+olekgo@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:22:48 +0100 Subject: [PATCH 4/4] revert chnages to go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 809783e8f..77076688c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/olekgo/go-netbox/v3 +module github.com/netbox-community/go-netbox/v3 go 1.18