1 Star 0 Fork 0

MrCoder / openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model_search_condition.go 5.35 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 . update
/*
Nudsf_Timer
Nudsf Timer Service. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Nudsf_Timer
import (
"encoding/json"
"fmt"
)
// checks if the SearchCondition type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SearchCondition{}
// SearchCondition A logical condition
type SearchCondition struct {
Cond ConditionOperator `json:"cond"`
Units []SearchExpression `json:"units"`
// Represents the Identifier of a Meta schema.
SchemaId *string `json:"schemaId,omitempty"`
}
type _SearchCondition SearchCondition
// NewSearchCondition instantiates a new SearchCondition 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 NewSearchCondition(cond ConditionOperator, units []SearchExpression) *SearchCondition {
this := SearchCondition{}
this.Cond = cond
this.Units = units
return &this
}
// NewSearchConditionWithDefaults instantiates a new SearchCondition 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 NewSearchConditionWithDefaults() *SearchCondition {
this := SearchCondition{}
return &this
}
// GetCond returns the Cond field value
func (o *SearchCondition) GetCond() ConditionOperator {
if o == nil {
var ret ConditionOperator
return ret
}
return o.Cond
}
// GetCondOk returns a tuple with the Cond field value
// and a boolean to check if the value has been set.
func (o *SearchCondition) GetCondOk() (*ConditionOperator, bool) {
if o == nil {
return nil, false
}
return &o.Cond, true
}
// SetCond sets field value
func (o *SearchCondition) SetCond(v ConditionOperator) {
o.Cond = v
}
// GetUnits returns the Units field value
func (o *SearchCondition) GetUnits() []SearchExpression {
if o == nil {
var ret []SearchExpression
return ret
}
return o.Units
}
// GetUnitsOk returns a tuple with the Units field value
// and a boolean to check if the value has been set.
func (o *SearchCondition) GetUnitsOk() ([]SearchExpression, bool) {
if o == nil {
return nil, false
}
return o.Units, true
}
// SetUnits sets field value
func (o *SearchCondition) SetUnits(v []SearchExpression) {
o.Units = v
}
// GetSchemaId returns the SchemaId field value if set, zero value otherwise.
func (o *SearchCondition) GetSchemaId() string {
if o == nil || IsNil(o.SchemaId) {
var ret string
return ret
}
return *o.SchemaId
}
// GetSchemaIdOk returns a tuple with the SchemaId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SearchCondition) GetSchemaIdOk() (*string, bool) {
if o == nil || IsNil(o.SchemaId) {
return nil, false
}
return o.SchemaId, true
}
// HasSchemaId returns a boolean if a field has been set.
func (o *SearchCondition) HasSchemaId() bool {
if o != nil && !IsNil(o.SchemaId) {
return true
}
return false
}
// SetSchemaId gets a reference to the given string and assigns it to the SchemaId field.
func (o *SearchCondition) SetSchemaId(v string) {
o.SchemaId = &v
}
func (o SearchCondition) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SearchCondition) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["cond"] = o.Cond
toSerialize["units"] = o.Units
if !IsNil(o.SchemaId) {
toSerialize["schemaId"] = o.SchemaId
}
return toSerialize, nil
}
func (o *SearchCondition) 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{
"cond",
"units",
}
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)
}
}
varSearchCondition := _SearchCondition{}
err = json.Unmarshal(bytes, &varSearchCondition)
if err != nil {
return err
}
*o = SearchCondition(varSearchCondition)
return err
}
type NullableSearchCondition struct {
value *SearchCondition
isSet bool
}
func (v NullableSearchCondition) Get() *SearchCondition {
return v.value
}
func (v *NullableSearchCondition) Set(val *SearchCondition) {
v.value = val
v.isSet = true
}
func (v NullableSearchCondition) IsSet() bool {
return v.isSet
}
func (v *NullableSearchCondition) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSearchCondition(val *SearchCondition) *NullableSearchCondition {
return &NullableSearchCondition{value: val, isSet: true}
}
func (v NullableSearchCondition) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSearchCondition) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
Go
1
https://gitee.com/konglinglong/openapi.git
git@gitee.com:konglinglong/openapi.git
konglinglong
openapi
openapi
e403a3c726a4

搜索帮助