Files
sdk/model_licensing_verify_response.go

459 lines
12 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the LicensingVerifyResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LicensingVerifyResponse{}
// LicensingVerifyResponse struct for LicensingVerifyResponse
type LicensingVerifyResponse struct {
// AppID is the brand the token runs under.
AppId *string `json:"app_id,omitempty"`
// Exp is the token's expiry, Unix seconds.
Exp *int64 `json:"exp,omitempty"`
// Features are the capability grants the token carries.
Features []string `json:"features,omitempty"`
// Bound reports that the token carries a device binding.
FingerprintBound *bool `json:"fingerprint_bound,omitempty"`
// Holder is who the token was issued to.
Holder *string `json:"holder,omitempty"`
// Nonce uniquely identifies the token.
Nonce *string `json:"nonce,omitempty"`
// Reason says why an invalid token was rejected. Empty when Valid.
Reason *string `json:"reason,omitempty"`
// Revoked reports that the signature was good but the token has been revoked.
Revoked *bool `json:"revoked,omitempty"`
// Valid is the single answer: signature, schema, expiry, app and revocation all passed.
Valid *bool `json:"valid,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LicensingVerifyResponse LicensingVerifyResponse
// NewLicensingVerifyResponse instantiates a new LicensingVerifyResponse 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 NewLicensingVerifyResponse() *LicensingVerifyResponse {
this := LicensingVerifyResponse{}
return &this
}
// NewLicensingVerifyResponseWithDefaults instantiates a new LicensingVerifyResponse 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 NewLicensingVerifyResponseWithDefaults() *LicensingVerifyResponse {
this := LicensingVerifyResponse{}
return &this
}
// GetAppId returns the AppId field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetAppId() string {
if o == nil || IsNil(o.AppId) {
var ret string
return ret
}
return *o.AppId
}
// GetAppIdOk returns a tuple with the AppId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetAppIdOk() (*string, bool) {
if o == nil || IsNil(o.AppId) {
return nil, false
}
return o.AppId, true
}
// HasAppId returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasAppId() bool {
if o != nil && !IsNil(o.AppId) {
return true
}
return false
}
// SetAppId gets a reference to the given string and assigns it to the AppId field.
func (o *LicensingVerifyResponse) SetAppId(v string) {
o.AppId = &v
}
// GetExp returns the Exp field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetExp() int64 {
if o == nil || IsNil(o.Exp) {
var ret int64
return ret
}
return *o.Exp
}
// GetExpOk returns a tuple with the Exp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetExpOk() (*int64, bool) {
if o == nil || IsNil(o.Exp) {
return nil, false
}
return o.Exp, true
}
// HasExp returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasExp() bool {
if o != nil && !IsNil(o.Exp) {
return true
}
return false
}
// SetExp gets a reference to the given int64 and assigns it to the Exp field.
func (o *LicensingVerifyResponse) SetExp(v int64) {
o.Exp = &v
}
// GetFeatures returns the Features field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetFeatures() []string {
if o == nil || IsNil(o.Features) {
var ret []string
return ret
}
return o.Features
}
// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetFeaturesOk() ([]string, bool) {
if o == nil || IsNil(o.Features) {
return nil, false
}
return o.Features, true
}
// HasFeatures returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasFeatures() bool {
if o != nil && !IsNil(o.Features) {
return true
}
return false
}
// SetFeatures gets a reference to the given []string and assigns it to the Features field.
func (o *LicensingVerifyResponse) SetFeatures(v []string) {
o.Features = v
}
// GetFingerprintBound returns the FingerprintBound field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetFingerprintBound() bool {
if o == nil || IsNil(o.FingerprintBound) {
var ret bool
return ret
}
return *o.FingerprintBound
}
// GetFingerprintBoundOk returns a tuple with the FingerprintBound field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetFingerprintBoundOk() (*bool, bool) {
if o == nil || IsNil(o.FingerprintBound) {
return nil, false
}
return o.FingerprintBound, true
}
// HasFingerprintBound returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasFingerprintBound() bool {
if o != nil && !IsNil(o.FingerprintBound) {
return true
}
return false
}
// SetFingerprintBound gets a reference to the given bool and assigns it to the FingerprintBound field.
func (o *LicensingVerifyResponse) SetFingerprintBound(v bool) {
o.FingerprintBound = &v
}
// GetHolder returns the Holder field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetHolder() string {
if o == nil || IsNil(o.Holder) {
var ret string
return ret
}
return *o.Holder
}
// GetHolderOk returns a tuple with the Holder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetHolderOk() (*string, bool) {
if o == nil || IsNil(o.Holder) {
return nil, false
}
return o.Holder, true
}
// HasHolder returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasHolder() bool {
if o != nil && !IsNil(o.Holder) {
return true
}
return false
}
// SetHolder gets a reference to the given string and assigns it to the Holder field.
func (o *LicensingVerifyResponse) SetHolder(v string) {
o.Holder = &v
}
// GetNonce returns the Nonce field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetNonce() string {
if o == nil || IsNil(o.Nonce) {
var ret string
return ret
}
return *o.Nonce
}
// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetNonceOk() (*string, bool) {
if o == nil || IsNil(o.Nonce) {
return nil, false
}
return o.Nonce, true
}
// HasNonce returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasNonce() bool {
if o != nil && !IsNil(o.Nonce) {
return true
}
return false
}
// SetNonce gets a reference to the given string and assigns it to the Nonce field.
func (o *LicensingVerifyResponse) SetNonce(v string) {
o.Nonce = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetReason() string {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
return *o.Reason
}
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetReasonOk() (*string, bool) {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
}
// HasReason returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasReason() bool {
if o != nil && !IsNil(o.Reason) {
return true
}
return false
}
// SetReason gets a reference to the given string and assigns it to the Reason field.
func (o *LicensingVerifyResponse) SetReason(v string) {
o.Reason = &v
}
// GetRevoked returns the Revoked field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetRevoked() bool {
if o == nil || IsNil(o.Revoked) {
var ret bool
return ret
}
return *o.Revoked
}
// GetRevokedOk returns a tuple with the Revoked field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetRevokedOk() (*bool, bool) {
if o == nil || IsNil(o.Revoked) {
return nil, false
}
return o.Revoked, true
}
// HasRevoked returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasRevoked() bool {
if o != nil && !IsNil(o.Revoked) {
return true
}
return false
}
// SetRevoked gets a reference to the given bool and assigns it to the Revoked field.
func (o *LicensingVerifyResponse) SetRevoked(v bool) {
o.Revoked = &v
}
// GetValid returns the Valid field value if set, zero value otherwise.
func (o *LicensingVerifyResponse) GetValid() bool {
if o == nil || IsNil(o.Valid) {
var ret bool
return ret
}
return *o.Valid
}
// GetValidOk returns a tuple with the Valid field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingVerifyResponse) GetValidOk() (*bool, bool) {
if o == nil || IsNil(o.Valid) {
return nil, false
}
return o.Valid, true
}
// HasValid returns a boolean if a field has been set.
func (o *LicensingVerifyResponse) HasValid() bool {
if o != nil && !IsNil(o.Valid) {
return true
}
return false
}
// SetValid gets a reference to the given bool and assigns it to the Valid field.
func (o *LicensingVerifyResponse) SetValid(v bool) {
o.Valid = &v
}
func (o LicensingVerifyResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LicensingVerifyResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AppId) {
toSerialize["app_id"] = o.AppId
}
if !IsNil(o.Exp) {
toSerialize["exp"] = o.Exp
}
if !IsNil(o.Features) {
toSerialize["features"] = o.Features
}
if !IsNil(o.FingerprintBound) {
toSerialize["fingerprint_bound"] = o.FingerprintBound
}
if !IsNil(o.Holder) {
toSerialize["holder"] = o.Holder
}
if !IsNil(o.Nonce) {
toSerialize["nonce"] = o.Nonce
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
if !IsNil(o.Revoked) {
toSerialize["revoked"] = o.Revoked
}
if !IsNil(o.Valid) {
toSerialize["valid"] = o.Valid
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LicensingVerifyResponse) UnmarshalJSON(data []byte) (err error) {
varLicensingVerifyResponse := _LicensingVerifyResponse{}
err = json.Unmarshal(data, &varLicensingVerifyResponse)
if err != nil {
return err
}
*o = LicensingVerifyResponse(varLicensingVerifyResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "app_id")
delete(additionalProperties, "exp")
delete(additionalProperties, "features")
delete(additionalProperties, "fingerprint_bound")
delete(additionalProperties, "holder")
delete(additionalProperties, "nonce")
delete(additionalProperties, "reason")
delete(additionalProperties, "revoked")
delete(additionalProperties, "valid")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLicensingVerifyResponse struct {
value *LicensingVerifyResponse
isSet bool
}
func (v NullableLicensingVerifyResponse) Get() *LicensingVerifyResponse {
return v.value
}
func (v *NullableLicensingVerifyResponse) Set(val *LicensingVerifyResponse) {
v.value = val
v.isSet = true
}
func (v NullableLicensingVerifyResponse) IsSet() bool {
return v.isSet
}
func (v *NullableLicensingVerifyResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLicensingVerifyResponse(val *LicensingVerifyResponse) *NullableLicensingVerifyResponse {
return &NullableLicensingVerifyResponse{value: val, isSet: true}
}
func (v NullableLicensingVerifyResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLicensingVerifyResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}