1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_content_hosting_configuration.go 6.36 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
M1_ContentHostingProvisioning
5GMS AF M1 Content Hosting Provisioning API © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 2.2.2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_M1_ContentHostingProvisioning
import (
"encoding/json"
"fmt"
)
// checks if the ContentHostingConfiguration type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContentHostingConfiguration{}
// ContentHostingConfiguration A representation of a Content Hosting Configuration resource.
type ContentHostingConfiguration struct {
Name string `json:"name"`
IngestConfiguration IngestConfiguration `json:"ingestConfiguration"`
DistributionConfigurations []DistributionConfiguration `json:"distributionConfigurations"`
}
type _ContentHostingConfiguration ContentHostingConfiguration
// NewContentHostingConfiguration instantiates a new ContentHostingConfiguration 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 NewContentHostingConfiguration(name string, ingestConfiguration IngestConfiguration, distributionConfigurations []DistributionConfiguration) *ContentHostingConfiguration {
this := ContentHostingConfiguration{}
this.Name = name
this.IngestConfiguration = ingestConfiguration
this.DistributionConfigurations = distributionConfigurations
return &this
}
// NewContentHostingConfigurationWithDefaults instantiates a new ContentHostingConfiguration 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 NewContentHostingConfigurationWithDefaults() *ContentHostingConfiguration {
this := ContentHostingConfiguration{}
return &this
}
// GetName returns the Name field value
func (o *ContentHostingConfiguration) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ContentHostingConfiguration) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ContentHostingConfiguration) SetName(v string) {
o.Name = v
}
// GetIngestConfiguration returns the IngestConfiguration field value
func (o *ContentHostingConfiguration) GetIngestConfiguration() IngestConfiguration {
if o == nil {
var ret IngestConfiguration
return ret
}
return o.IngestConfiguration
}
// GetIngestConfigurationOk returns a tuple with the IngestConfiguration field value
// and a boolean to check if the value has been set.
func (o *ContentHostingConfiguration) GetIngestConfigurationOk() (*IngestConfiguration, bool) {
if o == nil {
return nil, false
}
return &o.IngestConfiguration, true
}
// SetIngestConfiguration sets field value
func (o *ContentHostingConfiguration) SetIngestConfiguration(v IngestConfiguration) {
o.IngestConfiguration = v
}
// GetDistributionConfigurations returns the DistributionConfigurations field value
func (o *ContentHostingConfiguration) GetDistributionConfigurations() []DistributionConfiguration {
if o == nil {
var ret []DistributionConfiguration
return ret
}
return o.DistributionConfigurations
}
// GetDistributionConfigurationsOk returns a tuple with the DistributionConfigurations field value
// and a boolean to check if the value has been set.
func (o *ContentHostingConfiguration) GetDistributionConfigurationsOk() ([]DistributionConfiguration, bool) {
if o == nil {
return nil, false
}
return o.DistributionConfigurations, true
}
// SetDistributionConfigurations sets field value
func (o *ContentHostingConfiguration) SetDistributionConfigurations(v []DistributionConfiguration) {
o.DistributionConfigurations = v
}
func (o ContentHostingConfiguration) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContentHostingConfiguration) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["name"] = o.Name
toSerialize["ingestConfiguration"] = o.IngestConfiguration
toSerialize["distributionConfigurations"] = o.DistributionConfigurations
return toSerialize, nil
}
func (o *ContentHostingConfiguration) 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{
"name",
"ingestConfiguration",
"distributionConfigurations",
}
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)
}
}
varContentHostingConfiguration := _ContentHostingConfiguration{}
err = json.Unmarshal(bytes, &varContentHostingConfiguration)
if err != nil {
return err
}
*o = ContentHostingConfiguration(varContentHostingConfiguration)
return err
}
type NullableContentHostingConfiguration struct {
value *ContentHostingConfiguration
isSet bool
}
func (v NullableContentHostingConfiguration) Get() *ContentHostingConfiguration {
return v.value
}
func (v *NullableContentHostingConfiguration) Set(val *ContentHostingConfiguration) {
v.value = val
v.isSet = true
}
func (v NullableContentHostingConfiguration) IsSet() bool {
return v.isSet
}
func (v *NullableContentHostingConfiguration) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableContentHostingConfiguration(val *ContentHostingConfiguration) *NullableContentHostingConfiguration {
return &NullableContentHostingConfiguration{value: val, isSet: true}
}
func (v NullableContentHostingConfiguration) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableContentHostingConfiguration) 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

搜索帮助