Fetch the repository succeeded.
/*
3gpp-mbs-session
API for MBS Session Management. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.1.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_MBSSession
import (
"encoding/json"
"fmt"
)
// checks if the PatchItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PatchItem{}
// PatchItem it contains information on data to be changed.
type PatchItem struct {
Op PatchOperation `json:"op"`
// contains a JSON pointer value (as defined in IETF RFC 6901) that references a location of a resource on which the patch operation shall be performed.
Path string `json:"path"`
// indicates the path of the source JSON element (according to JSON Pointer syntax) being moved or copied to the location indicated by the \"path\" attribute.
From *string `json:"from,omitempty"`
Value interface{} `json:"value,omitempty"`
}
type _PatchItem PatchItem
// NewPatchItem instantiates a new PatchItem 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 NewPatchItem(op PatchOperation, path string) *PatchItem {
this := PatchItem{}
this.Op = op
this.Path = path
return &this
}
// NewPatchItemWithDefaults instantiates a new PatchItem 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 NewPatchItemWithDefaults() *PatchItem {
this := PatchItem{}
return &this
}
// GetOp returns the Op field value
func (o *PatchItem) GetOp() PatchOperation {
if o == nil {
var ret PatchOperation
return ret
}
return o.Op
}
// GetOpOk returns a tuple with the Op field value
// and a boolean to check if the value has been set.
func (o *PatchItem) GetOpOk() (*PatchOperation, bool) {
if o == nil {
return nil, false
}
return &o.Op, true
}
// SetOp sets field value
func (o *PatchItem) SetOp(v PatchOperation) {
o.Op = v
}
// GetPath returns the Path field value
func (o *PatchItem) GetPath() string {
if o == nil {
var ret string
return ret
}
return o.Path
}
// GetPathOk returns a tuple with the Path field value
// and a boolean to check if the value has been set.
func (o *PatchItem) GetPathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Path, true
}
// SetPath sets field value
func (o *PatchItem) SetPath(v string) {
o.Path = v
}
// GetFrom returns the From field value if set, zero value otherwise.
func (o *PatchItem) GetFrom() string {
if o == nil || IsNil(o.From) {
var ret string
return ret
}
return *o.From
}
// GetFromOk returns a tuple with the From field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PatchItem) GetFromOk() (*string, bool) {
if o == nil || IsNil(o.From) {
return nil, false
}
return o.From, true
}
// HasFrom returns a boolean if a field has been set.
func (o *PatchItem) HasFrom() bool {
if o != nil && !IsNil(o.From) {
return true
}
return false
}
// SetFrom gets a reference to the given string and assigns it to the From field.
func (o *PatchItem) SetFrom(v string) {
o.From = &v
}
// GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PatchItem) GetValue() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PatchItem) GetValueOk() (*interface{}, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return &o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *PatchItem) HasValue() bool {
if o != nil && IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given interface{} and assigns it to the Value field.
func (o *PatchItem) SetValue(v interface{}) {
o.Value = v
}
func (o PatchItem) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PatchItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["op"] = o.Op
toSerialize["path"] = o.Path
if !IsNil(o.From) {
toSerialize["from"] = o.From
}
if o.Value != nil {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
func (o *PatchItem) 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{
"op",
"path",
}
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)
}
}
varPatchItem := _PatchItem{}
err = json.Unmarshal(bytes, &varPatchItem)
if err != nil {
return err
}
*o = PatchItem(varPatchItem)
return err
}
type NullablePatchItem struct {
value *PatchItem
isSet bool
}
func (v NullablePatchItem) Get() *PatchItem {
return v.value
}
func (v *NullablePatchItem) Set(val *PatchItem) {
v.value = val
v.isSet = true
}
func (v NullablePatchItem) IsSet() bool {
return v.isSet
}
func (v *NullablePatchItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePatchItem(val *PatchItem) *NullablePatchItem {
return &NullablePatchItem{value: val, isSet: true}
}
func (v NullablePatchItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePatchItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。