1 Star 0 Fork 0

MrCoder/openapi

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
model_nf_service_version.go 5.67 KB
Copy Edit Raw Blame History
MrCoder authored 2023-12-22 15:27 +08:00 . update
/*
NRF NFDiscovery Service
NRF NFDiscovery Service. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.2.5
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Nnrf_NFDiscovery
import (
"encoding/json"
"fmt"
"time"
)
// checks if the NFServiceVersion type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NFServiceVersion{}
// NFServiceVersion Contains the version details of an NF service
type NFServiceVersion struct {
ApiVersionInUri string `json:"apiVersionInUri"`
ApiFullVersion string `json:"apiFullVersion"`
// string with format 'date-time' as defined in OpenAPI.
Expiry *time.Time `json:"expiry,omitempty"`
}
type _NFServiceVersion NFServiceVersion
// NewNFServiceVersion instantiates a new NFServiceVersion 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 NewNFServiceVersion(apiVersionInUri string, apiFullVersion string) *NFServiceVersion {
this := NFServiceVersion{}
this.ApiVersionInUri = apiVersionInUri
this.ApiFullVersion = apiFullVersion
return &this
}
// NewNFServiceVersionWithDefaults instantiates a new NFServiceVersion 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 NewNFServiceVersionWithDefaults() *NFServiceVersion {
this := NFServiceVersion{}
return &this
}
// GetApiVersionInUri returns the ApiVersionInUri field value
func (o *NFServiceVersion) GetApiVersionInUri() string {
if o == nil {
var ret string
return ret
}
return o.ApiVersionInUri
}
// GetApiVersionInUriOk returns a tuple with the ApiVersionInUri field value
// and a boolean to check if the value has been set.
func (o *NFServiceVersion) GetApiVersionInUriOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ApiVersionInUri, true
}
// SetApiVersionInUri sets field value
func (o *NFServiceVersion) SetApiVersionInUri(v string) {
o.ApiVersionInUri = v
}
// GetApiFullVersion returns the ApiFullVersion field value
func (o *NFServiceVersion) GetApiFullVersion() string {
if o == nil {
var ret string
return ret
}
return o.ApiFullVersion
}
// GetApiFullVersionOk returns a tuple with the ApiFullVersion field value
// and a boolean to check if the value has been set.
func (o *NFServiceVersion) GetApiFullVersionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ApiFullVersion, true
}
// SetApiFullVersion sets field value
func (o *NFServiceVersion) SetApiFullVersion(v string) {
o.ApiFullVersion = v
}
// GetExpiry returns the Expiry field value if set, zero value otherwise.
func (o *NFServiceVersion) GetExpiry() time.Time {
if o == nil || IsNil(o.Expiry) {
var ret time.Time
return ret
}
return *o.Expiry
}
// GetExpiryOk returns a tuple with the Expiry field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NFServiceVersion) GetExpiryOk() (*time.Time, bool) {
if o == nil || IsNil(o.Expiry) {
return nil, false
}
return o.Expiry, true
}
// HasExpiry returns a boolean if a field has been set.
func (o *NFServiceVersion) HasExpiry() bool {
if o != nil && !IsNil(o.Expiry) {
return true
}
return false
}
// SetExpiry gets a reference to the given time.Time and assigns it to the Expiry field.
func (o *NFServiceVersion) SetExpiry(v time.Time) {
o.Expiry = &v
}
func (o NFServiceVersion) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NFServiceVersion) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["apiVersionInUri"] = o.ApiVersionInUri
toSerialize["apiFullVersion"] = o.ApiFullVersion
if !IsNil(o.Expiry) {
toSerialize["expiry"] = o.Expiry
}
return toSerialize, nil
}
func (o *NFServiceVersion) UnmarshalJSON(bytes []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{
"apiVersionInUri",
"apiFullVersion",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(bytes, &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)
}
}
varNFServiceVersion := _NFServiceVersion{}
err = json.Unmarshal(bytes, &varNFServiceVersion)
if err != nil {
return err
}
*o = NFServiceVersion(varNFServiceVersion)
return err
}
type NullableNFServiceVersion struct {
value *NFServiceVersion
isSet bool
}
func (v NullableNFServiceVersion) Get() *NFServiceVersion {
return v.value
}
func (v *NullableNFServiceVersion) Set(val *NFServiceVersion) {
v.value = val
v.isSet = true
}
func (v NullableNFServiceVersion) IsSet() bool {
return v.isSet
}
func (v *NullableNFServiceVersion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNFServiceVersion(val *NFServiceVersion) *NullableNFServiceVersion {
return &NullableNFServiceVersion{value: val, isSet: true}
}
func (v NullableNFServiceVersion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNFServiceVersion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/konglinglong/openapi.git
git@gitee.com:konglinglong/openapi.git
konglinglong
openapi
openapi
e403a3c726a4

Search