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_bdt_patch.go 6.15 KB
Copy Edit Raw Blame History
MrCoder authored 2023-12-22 15:27 +08:00 . update
/*
3gpp-bdt
API for BDT resouce management. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.2.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_ResourceManagementOfBdt
import (
"encoding/json"
"fmt"
)
// checks if the BdtPatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BdtPatch{}
// BdtPatch Represents a Background Data Transfer subscription modification request.
type BdtPatch struct {
// Identity of the selected background data transfer policy.
SelectedPolicy int32 `json:"selectedPolicy"`
// Indicates whether the BDT warning notification is enabled (true) or not (false).
WarnNotifEnabled *bool `json:"warnNotifEnabled,omitempty"`
// string formatted according to IETF RFC 3986 identifying a referenced resource.
NotificationDestination *string `json:"notificationDestination,omitempty"`
}
type _BdtPatch BdtPatch
// NewBdtPatch instantiates a new BdtPatch 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 NewBdtPatch(selectedPolicy int32) *BdtPatch {
this := BdtPatch{}
this.SelectedPolicy = selectedPolicy
return &this
}
// NewBdtPatchWithDefaults instantiates a new BdtPatch 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 NewBdtPatchWithDefaults() *BdtPatch {
this := BdtPatch{}
return &this
}
// GetSelectedPolicy returns the SelectedPolicy field value
func (o *BdtPatch) GetSelectedPolicy() int32 {
if o == nil {
var ret int32
return ret
}
return o.SelectedPolicy
}
// GetSelectedPolicyOk returns a tuple with the SelectedPolicy field value
// and a boolean to check if the value has been set.
func (o *BdtPatch) GetSelectedPolicyOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.SelectedPolicy, true
}
// SetSelectedPolicy sets field value
func (o *BdtPatch) SetSelectedPolicy(v int32) {
o.SelectedPolicy = v
}
// GetWarnNotifEnabled returns the WarnNotifEnabled field value if set, zero value otherwise.
func (o *BdtPatch) GetWarnNotifEnabled() bool {
if o == nil || IsNil(o.WarnNotifEnabled) {
var ret bool
return ret
}
return *o.WarnNotifEnabled
}
// GetWarnNotifEnabledOk returns a tuple with the WarnNotifEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BdtPatch) GetWarnNotifEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.WarnNotifEnabled) {
return nil, false
}
return o.WarnNotifEnabled, true
}
// HasWarnNotifEnabled returns a boolean if a field has been set.
func (o *BdtPatch) HasWarnNotifEnabled() bool {
if o != nil && !IsNil(o.WarnNotifEnabled) {
return true
}
return false
}
// SetWarnNotifEnabled gets a reference to the given bool and assigns it to the WarnNotifEnabled field.
func (o *BdtPatch) SetWarnNotifEnabled(v bool) {
o.WarnNotifEnabled = &v
}
// GetNotificationDestination returns the NotificationDestination field value if set, zero value otherwise.
func (o *BdtPatch) GetNotificationDestination() string {
if o == nil || IsNil(o.NotificationDestination) {
var ret string
return ret
}
return *o.NotificationDestination
}
// GetNotificationDestinationOk returns a tuple with the NotificationDestination field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BdtPatch) GetNotificationDestinationOk() (*string, bool) {
if o == nil || IsNil(o.NotificationDestination) {
return nil, false
}
return o.NotificationDestination, true
}
// HasNotificationDestination returns a boolean if a field has been set.
func (o *BdtPatch) HasNotificationDestination() bool {
if o != nil && !IsNil(o.NotificationDestination) {
return true
}
return false
}
// SetNotificationDestination gets a reference to the given string and assigns it to the NotificationDestination field.
func (o *BdtPatch) SetNotificationDestination(v string) {
o.NotificationDestination = &v
}
func (o BdtPatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BdtPatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["selectedPolicy"] = o.SelectedPolicy
if !IsNil(o.WarnNotifEnabled) {
toSerialize["warnNotifEnabled"] = o.WarnNotifEnabled
}
if !IsNil(o.NotificationDestination) {
toSerialize["notificationDestination"] = o.NotificationDestination
}
return toSerialize, nil
}
func (o *BdtPatch) 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{
"selectedPolicy",
}
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)
}
}
varBdtPatch := _BdtPatch{}
err = json.Unmarshal(bytes, &varBdtPatch)
if err != nil {
return err
}
*o = BdtPatch(varBdtPatch)
return err
}
type NullableBdtPatch struct {
value *BdtPatch
isSet bool
}
func (v NullableBdtPatch) Get() *BdtPatch {
return v.value
}
func (v *NullableBdtPatch) Set(val *BdtPatch) {
v.value = val
v.isSet = true
}
func (v NullableBdtPatch) IsSet() bool {
return v.isSet
}
func (v *NullableBdtPatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBdtPatch(val *BdtPatch) *NullableBdtPatch {
return &NullableBdtPatch{value: val, isSet: true}
}
func (v NullableBdtPatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBdtPatch) 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