mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
9.4 KiB
Go
345 lines
9.4 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 LicensingPubkeyView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LicensingPubkeyView{}
|
|
|
|
// LicensingPubkeyView struct for LicensingPubkeyView
|
|
type LicensingPubkeyView struct {
|
|
// Alg is always \"Ed25519\".
|
|
Alg *string `json:"alg,omitempty"`
|
|
// Keys is the same key as a single-entry JWKS (OKP/Ed25519), for JWKS-shaped consumers.
|
|
Keys []LicensingJWK `json:"keys,omitempty"`
|
|
// Provider names where the private half lives: \"kms\" (production) or \"local\" (a development key — never trust it in production).
|
|
Provider *string `json:"provider,omitempty"`
|
|
// PublicKey is the 32-byte Ed25519 public key, standard base64. This is the form the engine embeds for offline verification.
|
|
PublicKey *string `json:"public_key,omitempty"`
|
|
// Schema is the license payload schema version this key signs.
|
|
Schema *int32 `json:"schema,omitempty"`
|
|
// TokenFormat states the wire layout so an implementer can verify a token without this service's source.
|
|
TokenFormat *string `json:"token_format,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _LicensingPubkeyView LicensingPubkeyView
|
|
|
|
// NewLicensingPubkeyView instantiates a new LicensingPubkeyView 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 NewLicensingPubkeyView() *LicensingPubkeyView {
|
|
this := LicensingPubkeyView{}
|
|
return &this
|
|
}
|
|
|
|
// NewLicensingPubkeyViewWithDefaults instantiates a new LicensingPubkeyView 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 NewLicensingPubkeyViewWithDefaults() *LicensingPubkeyView {
|
|
this := LicensingPubkeyView{}
|
|
return &this
|
|
}
|
|
|
|
// GetAlg returns the Alg field value if set, zero value otherwise.
|
|
func (o *LicensingPubkeyView) GetAlg() string {
|
|
if o == nil || IsNil(o.Alg) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Alg
|
|
}
|
|
|
|
// GetAlgOk returns a tuple with the Alg field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LicensingPubkeyView) GetAlgOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Alg) {
|
|
return nil, false
|
|
}
|
|
return o.Alg, true
|
|
}
|
|
|
|
// HasAlg returns a boolean if a field has been set.
|
|
func (o *LicensingPubkeyView) HasAlg() bool {
|
|
if o != nil && !IsNil(o.Alg) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAlg gets a reference to the given string and assigns it to the Alg field.
|
|
func (o *LicensingPubkeyView) SetAlg(v string) {
|
|
o.Alg = &v
|
|
}
|
|
|
|
// GetKeys returns the Keys field value if set, zero value otherwise.
|
|
func (o *LicensingPubkeyView) GetKeys() []LicensingJWK {
|
|
if o == nil || IsNil(o.Keys) {
|
|
var ret []LicensingJWK
|
|
return ret
|
|
}
|
|
return o.Keys
|
|
}
|
|
|
|
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LicensingPubkeyView) GetKeysOk() ([]LicensingJWK, bool) {
|
|
if o == nil || IsNil(o.Keys) {
|
|
return nil, false
|
|
}
|
|
return o.Keys, true
|
|
}
|
|
|
|
// HasKeys returns a boolean if a field has been set.
|
|
func (o *LicensingPubkeyView) HasKeys() bool {
|
|
if o != nil && !IsNil(o.Keys) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKeys gets a reference to the given []LicensingJWK and assigns it to the Keys field.
|
|
func (o *LicensingPubkeyView) SetKeys(v []LicensingJWK) {
|
|
o.Keys = v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *LicensingPubkeyView) GetProvider() string {
|
|
if o == nil || IsNil(o.Provider) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Provider
|
|
}
|
|
|
|
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LicensingPubkeyView) GetProviderOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Provider) {
|
|
return nil, false
|
|
}
|
|
return o.Provider, true
|
|
}
|
|
|
|
// HasProvider returns a boolean if a field has been set.
|
|
func (o *LicensingPubkeyView) HasProvider() bool {
|
|
if o != nil && !IsNil(o.Provider) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
|
func (o *LicensingPubkeyView) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetPublicKey returns the PublicKey field value if set, zero value otherwise.
|
|
func (o *LicensingPubkeyView) GetPublicKey() string {
|
|
if o == nil || IsNil(o.PublicKey) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.PublicKey
|
|
}
|
|
|
|
// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LicensingPubkeyView) GetPublicKeyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.PublicKey) {
|
|
return nil, false
|
|
}
|
|
return o.PublicKey, true
|
|
}
|
|
|
|
// HasPublicKey returns a boolean if a field has been set.
|
|
func (o *LicensingPubkeyView) HasPublicKey() bool {
|
|
if o != nil && !IsNil(o.PublicKey) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field.
|
|
func (o *LicensingPubkeyView) SetPublicKey(v string) {
|
|
o.PublicKey = &v
|
|
}
|
|
|
|
// GetSchema returns the Schema field value if set, zero value otherwise.
|
|
func (o *LicensingPubkeyView) GetSchema() int32 {
|
|
if o == nil || IsNil(o.Schema) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Schema
|
|
}
|
|
|
|
// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LicensingPubkeyView) GetSchemaOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Schema) {
|
|
return nil, false
|
|
}
|
|
return o.Schema, true
|
|
}
|
|
|
|
// HasSchema returns a boolean if a field has been set.
|
|
func (o *LicensingPubkeyView) HasSchema() bool {
|
|
if o != nil && !IsNil(o.Schema) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSchema gets a reference to the given int32 and assigns it to the Schema field.
|
|
func (o *LicensingPubkeyView) SetSchema(v int32) {
|
|
o.Schema = &v
|
|
}
|
|
|
|
// GetTokenFormat returns the TokenFormat field value if set, zero value otherwise.
|
|
func (o *LicensingPubkeyView) GetTokenFormat() string {
|
|
if o == nil || IsNil(o.TokenFormat) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.TokenFormat
|
|
}
|
|
|
|
// GetTokenFormatOk returns a tuple with the TokenFormat field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LicensingPubkeyView) GetTokenFormatOk() (*string, bool) {
|
|
if o == nil || IsNil(o.TokenFormat) {
|
|
return nil, false
|
|
}
|
|
return o.TokenFormat, true
|
|
}
|
|
|
|
// HasTokenFormat returns a boolean if a field has been set.
|
|
func (o *LicensingPubkeyView) HasTokenFormat() bool {
|
|
if o != nil && !IsNil(o.TokenFormat) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTokenFormat gets a reference to the given string and assigns it to the TokenFormat field.
|
|
func (o *LicensingPubkeyView) SetTokenFormat(v string) {
|
|
o.TokenFormat = &v
|
|
}
|
|
|
|
func (o LicensingPubkeyView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LicensingPubkeyView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Alg) {
|
|
toSerialize["alg"] = o.Alg
|
|
}
|
|
if !IsNil(o.Keys) {
|
|
toSerialize["keys"] = o.Keys
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.PublicKey) {
|
|
toSerialize["public_key"] = o.PublicKey
|
|
}
|
|
if !IsNil(o.Schema) {
|
|
toSerialize["schema"] = o.Schema
|
|
}
|
|
if !IsNil(o.TokenFormat) {
|
|
toSerialize["token_format"] = o.TokenFormat
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LicensingPubkeyView) UnmarshalJSON(data []byte) (err error) {
|
|
varLicensingPubkeyView := _LicensingPubkeyView{}
|
|
|
|
err = json.Unmarshal(data, &varLicensingPubkeyView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LicensingPubkeyView(varLicensingPubkeyView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "alg")
|
|
delete(additionalProperties, "keys")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "public_key")
|
|
delete(additionalProperties, "schema")
|
|
delete(additionalProperties, "token_format")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLicensingPubkeyView struct {
|
|
value *LicensingPubkeyView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLicensingPubkeyView) Get() *LicensingPubkeyView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLicensingPubkeyView) Set(val *LicensingPubkeyView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLicensingPubkeyView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLicensingPubkeyView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLicensingPubkeyView(val *LicensingPubkeyView) *NullableLicensingPubkeyView {
|
|
return &NullableLicensingPubkeyView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLicensingPubkeyView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLicensingPubkeyView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|