1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_flat_jws_json.go 6.25 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2年前 . update
/*
JOSE Protected Message Forwarding API
N32-f Message Forwarding Service. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.2.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_JOSEProtectedMessageForwarding
import (
"encoding/json"
"fmt"
)
// checks if the FlatJwsJson type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlatJwsJson{}
// FlatJwsJson Contains the modification from IPXes on path
type FlatJwsJson struct {
Payload string `json:"payload"`
Protected *string `json:"protected,omitempty"`
Header map[string]interface{} `json:"header,omitempty"`
Signature string `json:"signature"`
}
type _FlatJwsJson FlatJwsJson
// NewFlatJwsJson instantiates a new FlatJwsJson 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 NewFlatJwsJson(payload string, signature string) *FlatJwsJson {
this := FlatJwsJson{}
this.Payload = payload
this.Signature = signature
return &this
}
// NewFlatJwsJsonWithDefaults instantiates a new FlatJwsJson 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 NewFlatJwsJsonWithDefaults() *FlatJwsJson {
this := FlatJwsJson{}
return &this
}
// GetPayload returns the Payload field value
func (o *FlatJwsJson) GetPayload() string {
if o == nil {
var ret string
return ret
}
return o.Payload
}
// GetPayloadOk returns a tuple with the Payload field value
// and a boolean to check if the value has been set.
func (o *FlatJwsJson) GetPayloadOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Payload, true
}
// SetPayload sets field value
func (o *FlatJwsJson) SetPayload(v string) {
o.Payload = v
}
// GetProtected returns the Protected field value if set, zero value otherwise.
func (o *FlatJwsJson) GetProtected() string {
if o == nil || IsNil(o.Protected) {
var ret string
return ret
}
return *o.Protected
}
// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlatJwsJson) GetProtectedOk() (*string, bool) {
if o == nil || IsNil(o.Protected) {
return nil, false
}
return o.Protected, true
}
// HasProtected returns a boolean if a field has been set.
func (o *FlatJwsJson) HasProtected() bool {
if o != nil && !IsNil(o.Protected) {
return true
}
return false
}
// SetProtected gets a reference to the given string and assigns it to the Protected field.
func (o *FlatJwsJson) SetProtected(v string) {
o.Protected = &v
}
// GetHeader returns the Header field value if set, zero value otherwise.
func (o *FlatJwsJson) GetHeader() map[string]interface{} {
if o == nil || IsNil(o.Header) {
var ret map[string]interface{}
return ret
}
return o.Header
}
// GetHeaderOk returns a tuple with the Header field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlatJwsJson) GetHeaderOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Header) {
return map[string]interface{}{}, false
}
return o.Header, true
}
// HasHeader returns a boolean if a field has been set.
func (o *FlatJwsJson) HasHeader() bool {
if o != nil && !IsNil(o.Header) {
return true
}
return false
}
// SetHeader gets a reference to the given map[string]interface{} and assigns it to the Header field.
func (o *FlatJwsJson) SetHeader(v map[string]interface{}) {
o.Header = v
}
// GetSignature returns the Signature field value
func (o *FlatJwsJson) GetSignature() string {
if o == nil {
var ret string
return ret
}
return o.Signature
}
// GetSignatureOk returns a tuple with the Signature field value
// and a boolean to check if the value has been set.
func (o *FlatJwsJson) GetSignatureOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Signature, true
}
// SetSignature sets field value
func (o *FlatJwsJson) SetSignature(v string) {
o.Signature = v
}
func (o FlatJwsJson) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlatJwsJson) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["payload"] = o.Payload
if !IsNil(o.Protected) {
toSerialize["protected"] = o.Protected
}
if !IsNil(o.Header) {
toSerialize["header"] = o.Header
}
toSerialize["signature"] = o.Signature
return toSerialize, nil
}
func (o *FlatJwsJson) 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{
"payload",
"signature",
}
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)
}
}
varFlatJwsJson := _FlatJwsJson{}
err = json.Unmarshal(bytes, &varFlatJwsJson)
if err != nil {
return err
}
*o = FlatJwsJson(varFlatJwsJson)
return err
}
type NullableFlatJwsJson struct {
value *FlatJwsJson
isSet bool
}
func (v NullableFlatJwsJson) Get() *FlatJwsJson {
return v.value
}
func (v *NullableFlatJwsJson) Set(val *FlatJwsJson) {
v.value = val
v.isSet = true
}
func (v NullableFlatJwsJson) IsSet() bool {
return v.isSet
}
func (v *NullableFlatJwsJson) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFlatJwsJson(val *FlatJwsJson) *NullableFlatJwsJson {
return &NullableFlatJwsJson{value: val, isSet: true}
}
func (v NullableFlatJwsJson) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFlatJwsJson) 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

搜索帮助