1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_path_rewrite_rule.go 4.67 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2年前 . 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 PathRewriteRule type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PathRewriteRule{}
// PathRewriteRule A rule to manipulate URL paths.
type PathRewriteRule struct {
RequestPathPattern string `json:"requestPathPattern"`
MappedPath string `json:"mappedPath"`
}
type _PathRewriteRule PathRewriteRule
// NewPathRewriteRule instantiates a new PathRewriteRule 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 NewPathRewriteRule(requestPathPattern string, mappedPath string) *PathRewriteRule {
this := PathRewriteRule{}
this.RequestPathPattern = requestPathPattern
this.MappedPath = mappedPath
return &this
}
// NewPathRewriteRuleWithDefaults instantiates a new PathRewriteRule 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 NewPathRewriteRuleWithDefaults() *PathRewriteRule {
this := PathRewriteRule{}
return &this
}
// GetRequestPathPattern returns the RequestPathPattern field value
func (o *PathRewriteRule) GetRequestPathPattern() string {
if o == nil {
var ret string
return ret
}
return o.RequestPathPattern
}
// GetRequestPathPatternOk returns a tuple with the RequestPathPattern field value
// and a boolean to check if the value has been set.
func (o *PathRewriteRule) GetRequestPathPatternOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RequestPathPattern, true
}
// SetRequestPathPattern sets field value
func (o *PathRewriteRule) SetRequestPathPattern(v string) {
o.RequestPathPattern = v
}
// GetMappedPath returns the MappedPath field value
func (o *PathRewriteRule) GetMappedPath() string {
if o == nil {
var ret string
return ret
}
return o.MappedPath
}
// GetMappedPathOk returns a tuple with the MappedPath field value
// and a boolean to check if the value has been set.
func (o *PathRewriteRule) GetMappedPathOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MappedPath, true
}
// SetMappedPath sets field value
func (o *PathRewriteRule) SetMappedPath(v string) {
o.MappedPath = v
}
func (o PathRewriteRule) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PathRewriteRule) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["requestPathPattern"] = o.RequestPathPattern
toSerialize["mappedPath"] = o.MappedPath
return toSerialize, nil
}
func (o *PathRewriteRule) 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{
"requestPathPattern",
"mappedPath",
}
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)
}
}
varPathRewriteRule := _PathRewriteRule{}
err = json.Unmarshal(bytes, &varPathRewriteRule)
if err != nil {
return err
}
*o = PathRewriteRule(varPathRewriteRule)
return err
}
type NullablePathRewriteRule struct {
value *PathRewriteRule
isSet bool
}
func (v NullablePathRewriteRule) Get() *PathRewriteRule {
return v.value
}
func (v *NullablePathRewriteRule) Set(val *PathRewriteRule) {
v.value = val
v.isSet = true
}
func (v NullablePathRewriteRule) IsSet() bool {
return v.isSet
}
func (v *NullablePathRewriteRule) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePathRewriteRule(val *PathRewriteRule) *NullablePathRewriteRule {
return &NullablePathRewriteRule{value: val, isSet: true}
}
func (v NullablePathRewriteRule) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePathRewriteRule) 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

搜索帮助