1 Star 0 Fork 0

MrCoder / openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model_resource.go 8.12 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 . update
/*
CAPIF_Events_API
API for event subscription management. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.2.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_CAPIF_Events_API
import (
"encoding/json"
"fmt"
)
// checks if the Resource type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Resource{}
// Resource Represents the API resource data.
type Resource struct {
// Resource name
ResourceName string `json:"resourceName"`
CommType CommunicationType `json:"commType"`
// Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122.
Uri string `json:"uri"`
// it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122.
CustOpName *string `json:"custOpName,omitempty"`
// Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP.
Operations []Operation `json:"operations,omitempty"`
// Text description of the API resource
Description *string `json:"description,omitempty"`
}
type _Resource Resource
// NewResource instantiates a new Resource 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 NewResource(resourceName string, commType CommunicationType, uri string) *Resource {
this := Resource{}
this.ResourceName = resourceName
this.CommType = commType
this.Uri = uri
return &this
}
// NewResourceWithDefaults instantiates a new Resource 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 NewResourceWithDefaults() *Resource {
this := Resource{}
return &this
}
// GetResourceName returns the ResourceName field value
func (o *Resource) GetResourceName() string {
if o == nil {
var ret string
return ret
}
return o.ResourceName
}
// GetResourceNameOk returns a tuple with the ResourceName field value
// and a boolean to check if the value has been set.
func (o *Resource) GetResourceNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ResourceName, true
}
// SetResourceName sets field value
func (o *Resource) SetResourceName(v string) {
o.ResourceName = v
}
// GetCommType returns the CommType field value
func (o *Resource) GetCommType() CommunicationType {
if o == nil {
var ret CommunicationType
return ret
}
return o.CommType
}
// GetCommTypeOk returns a tuple with the CommType field value
// and a boolean to check if the value has been set.
func (o *Resource) GetCommTypeOk() (*CommunicationType, bool) {
if o == nil {
return nil, false
}
return &o.CommType, true
}
// SetCommType sets field value
func (o *Resource) SetCommType(v CommunicationType) {
o.CommType = v
}
// GetUri returns the Uri field value
func (o *Resource) GetUri() string {
if o == nil {
var ret string
return ret
}
return o.Uri
}
// GetUriOk returns a tuple with the Uri field value
// and a boolean to check if the value has been set.
func (o *Resource) GetUriOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Uri, true
}
// SetUri sets field value
func (o *Resource) SetUri(v string) {
o.Uri = v
}
// GetCustOpName returns the CustOpName field value if set, zero value otherwise.
func (o *Resource) GetCustOpName() string {
if o == nil || IsNil(o.CustOpName) {
var ret string
return ret
}
return *o.CustOpName
}
// GetCustOpNameOk returns a tuple with the CustOpName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Resource) GetCustOpNameOk() (*string, bool) {
if o == nil || IsNil(o.CustOpName) {
return nil, false
}
return o.CustOpName, true
}
// HasCustOpName returns a boolean if a field has been set.
func (o *Resource) HasCustOpName() bool {
if o != nil && !IsNil(o.CustOpName) {
return true
}
return false
}
// SetCustOpName gets a reference to the given string and assigns it to the CustOpName field.
func (o *Resource) SetCustOpName(v string) {
o.CustOpName = &v
}
// GetOperations returns the Operations field value if set, zero value otherwise.
func (o *Resource) GetOperations() []Operation {
if o == nil || IsNil(o.Operations) {
var ret []Operation
return ret
}
return o.Operations
}
// GetOperationsOk returns a tuple with the Operations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Resource) GetOperationsOk() ([]Operation, bool) {
if o == nil || IsNil(o.Operations) {
return nil, false
}
return o.Operations, true
}
// HasOperations returns a boolean if a field has been set.
func (o *Resource) HasOperations() bool {
if o != nil && !IsNil(o.Operations) {
return true
}
return false
}
// SetOperations gets a reference to the given []Operation and assigns it to the Operations field.
func (o *Resource) SetOperations(v []Operation) {
o.Operations = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Resource) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Resource) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *Resource) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *Resource) SetDescription(v string) {
o.Description = &v
}
func (o Resource) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Resource) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["resourceName"] = o.ResourceName
toSerialize["commType"] = o.CommType
toSerialize["uri"] = o.Uri
if !IsNil(o.CustOpName) {
toSerialize["custOpName"] = o.CustOpName
}
if !IsNil(o.Operations) {
toSerialize["operations"] = o.Operations
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
return toSerialize, nil
}
func (o *Resource) 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{
"resourceName",
"commType",
"uri",
}
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)
}
}
varResource := _Resource{}
err = json.Unmarshal(bytes, &varResource)
if err != nil {
return err
}
*o = Resource(varResource)
return err
}
type NullableResource struct {
value *Resource
isSet bool
}
func (v NullableResource) Get() *Resource {
return v.value
}
func (v *NullableResource) Set(val *Resource) {
v.value = val
v.isSet = true
}
func (v NullableResource) IsSet() bool {
return v.isSet
}
func (v *NullableResource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableResource(val *Resource) *NullableResource {
return &NullableResource{value: val, isSet: true}
}
func (v NullableResource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableResource) 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

搜索帮助