mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
11 KiB
Go
383 lines
11 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 LicensingIssueResponse type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LicensingIssueResponse{}
|
|
|
|
// LicensingIssueResponse struct for LicensingIssueResponse
|
|
type LicensingIssueResponse struct {
|
|
// AppID is the brand this token runs under (\"hanzo\" | \"lux\" | \"zoo\"). The engine refuses a token whose app_id is not the one it was built for.
|
|
AppId *string `json:"app_id,omitempty"`
|
|
// Exp is the token's expiry, Unix seconds.
|
|
Exp *int64 `json:"exp,omitempty"`
|
|
// Features are the capability grants copied verbatim from the plan the org bought. The engine enforces exactly these.
|
|
Features []string `json:"features,omitempty"`
|
|
// Bound reports whether a device fingerprint was folded into the token. An unbound token runs on any machine; a bound one runs only on the machine it was bound to.
|
|
FingerprintBound *bool `json:"fingerprint_bound,omitempty"`
|
|
// Holder is who the token was issued to.
|
|
Holder *string `json:"holder,omitempty"`
|
|
// Nonce uniquely identifies this token, and is what a per-token revocation names.
|
|
Nonce *string `json:"nonce,omitempty"`
|
|
// Token is the signed license, `base64url(payload).base64url(ed25519_sig)`. It is the credential the engine runs on — treat it as a secret.
|
|
Token *string `json:"token,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _LicensingIssueResponse LicensingIssueResponse
|
|
|
|
// NewLicensingIssueResponse instantiates a new LicensingIssueResponse 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 NewLicensingIssueResponse() *LicensingIssueResponse {
|
|
this := LicensingIssueResponse{}
|
|
return &this
|
|
}
|
|
|
|
// NewLicensingIssueResponseWithDefaults instantiates a new LicensingIssueResponse 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 NewLicensingIssueResponseWithDefaults() *LicensingIssueResponse {
|
|
this := LicensingIssueResponse{}
|
|
return &this
|
|
}
|
|
|
|
// GetAppId returns the AppId field value if set, zero value otherwise.
|
|
func (o *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) SetAppId(v string) {
|
|
o.AppId = &v
|
|
}
|
|
|
|
// GetExp returns the Exp field value if set, zero value otherwise.
|
|
func (o *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) SetExp(v int64) {
|
|
o.Exp = &v
|
|
}
|
|
|
|
// GetFeatures returns the Features field value if set, zero value otherwise.
|
|
func (o *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) SetFeatures(v []string) {
|
|
o.Features = v
|
|
}
|
|
|
|
// GetFingerprintBound returns the FingerprintBound field value if set, zero value otherwise.
|
|
func (o *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) SetFingerprintBound(v bool) {
|
|
o.FingerprintBound = &v
|
|
}
|
|
|
|
// GetHolder returns the Holder field value if set, zero value otherwise.
|
|
func (o *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) SetHolder(v string) {
|
|
o.Holder = &v
|
|
}
|
|
|
|
// GetNonce returns the Nonce field value if set, zero value otherwise.
|
|
func (o *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) 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 *LicensingIssueResponse) SetNonce(v string) {
|
|
o.Nonce = &v
|
|
}
|
|
|
|
// GetToken returns the Token field value if set, zero value otherwise.
|
|
func (o *LicensingIssueResponse) GetToken() string {
|
|
if o == nil || IsNil(o.Token) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Token
|
|
}
|
|
|
|
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LicensingIssueResponse) GetTokenOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Token) {
|
|
return nil, false
|
|
}
|
|
return o.Token, true
|
|
}
|
|
|
|
// HasToken returns a boolean if a field has been set.
|
|
func (o *LicensingIssueResponse) HasToken() bool {
|
|
if o != nil && !IsNil(o.Token) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken gets a reference to the given string and assigns it to the Token field.
|
|
func (o *LicensingIssueResponse) SetToken(v string) {
|
|
o.Token = &v
|
|
}
|
|
|
|
func (o LicensingIssueResponse) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LicensingIssueResponse) 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.Token) {
|
|
toSerialize["token"] = o.Token
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LicensingIssueResponse) UnmarshalJSON(data []byte) (err error) {
|
|
varLicensingIssueResponse := _LicensingIssueResponse{}
|
|
|
|
err = json.Unmarshal(data, &varLicensingIssueResponse)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LicensingIssueResponse(varLicensingIssueResponse)
|
|
|
|
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, "token")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLicensingIssueResponse struct {
|
|
value *LicensingIssueResponse
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLicensingIssueResponse) Get() *LicensingIssueResponse {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLicensingIssueResponse) Set(val *LicensingIssueResponse) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLicensingIssueResponse) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLicensingIssueResponse) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLicensingIssueResponse(val *LicensingIssueResponse) *NullableLicensingIssueResponse {
|
|
return &NullableLicensingIssueResponse{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLicensingIssueResponse) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLicensingIssueResponse) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|