Files
sdk/model_licensing_jwk.go

269 lines
6.3 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 LicensingJWK type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LicensingJWK{}
// LicensingJWK struct for LicensingJWK
type LicensingJWK struct {
// Crv is always \"Ed25519\".
Crv *string `json:"crv,omitempty"`
// Kty is always \"OKP\".
Kty *string `json:"kty,omitempty"`
// Use is always \"sig\".
Use *string `json:"use,omitempty"`
// X is the public key, base64url (the JWK convention).
X *string `json:"x,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LicensingJWK LicensingJWK
// NewLicensingJWK instantiates a new LicensingJWK 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 NewLicensingJWK() *LicensingJWK {
this := LicensingJWK{}
return &this
}
// NewLicensingJWKWithDefaults instantiates a new LicensingJWK 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 NewLicensingJWKWithDefaults() *LicensingJWK {
this := LicensingJWK{}
return &this
}
// GetCrv returns the Crv field value if set, zero value otherwise.
func (o *LicensingJWK) GetCrv() string {
if o == nil || IsNil(o.Crv) {
var ret string
return ret
}
return *o.Crv
}
// GetCrvOk returns a tuple with the Crv field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingJWK) GetCrvOk() (*string, bool) {
if o == nil || IsNil(o.Crv) {
return nil, false
}
return o.Crv, true
}
// HasCrv returns a boolean if a field has been set.
func (o *LicensingJWK) HasCrv() bool {
if o != nil && !IsNil(o.Crv) {
return true
}
return false
}
// SetCrv gets a reference to the given string and assigns it to the Crv field.
func (o *LicensingJWK) SetCrv(v string) {
o.Crv = &v
}
// GetKty returns the Kty field value if set, zero value otherwise.
func (o *LicensingJWK) GetKty() string {
if o == nil || IsNil(o.Kty) {
var ret string
return ret
}
return *o.Kty
}
// GetKtyOk returns a tuple with the Kty field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingJWK) GetKtyOk() (*string, bool) {
if o == nil || IsNil(o.Kty) {
return nil, false
}
return o.Kty, true
}
// HasKty returns a boolean if a field has been set.
func (o *LicensingJWK) HasKty() bool {
if o != nil && !IsNil(o.Kty) {
return true
}
return false
}
// SetKty gets a reference to the given string and assigns it to the Kty field.
func (o *LicensingJWK) SetKty(v string) {
o.Kty = &v
}
// GetUse returns the Use field value if set, zero value otherwise.
func (o *LicensingJWK) GetUse() string {
if o == nil || IsNil(o.Use) {
var ret string
return ret
}
return *o.Use
}
// GetUseOk returns a tuple with the Use field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingJWK) GetUseOk() (*string, bool) {
if o == nil || IsNil(o.Use) {
return nil, false
}
return o.Use, true
}
// HasUse returns a boolean if a field has been set.
func (o *LicensingJWK) HasUse() bool {
if o != nil && !IsNil(o.Use) {
return true
}
return false
}
// SetUse gets a reference to the given string and assigns it to the Use field.
func (o *LicensingJWK) SetUse(v string) {
o.Use = &v
}
// GetX returns the X field value if set, zero value otherwise.
func (o *LicensingJWK) GetX() string {
if o == nil || IsNil(o.X) {
var ret string
return ret
}
return *o.X
}
// GetXOk returns a tuple with the X field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LicensingJWK) GetXOk() (*string, bool) {
if o == nil || IsNil(o.X) {
return nil, false
}
return o.X, true
}
// HasX returns a boolean if a field has been set.
func (o *LicensingJWK) HasX() bool {
if o != nil && !IsNil(o.X) {
return true
}
return false
}
// SetX gets a reference to the given string and assigns it to the X field.
func (o *LicensingJWK) SetX(v string) {
o.X = &v
}
func (o LicensingJWK) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LicensingJWK) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Crv) {
toSerialize["crv"] = o.Crv
}
if !IsNil(o.Kty) {
toSerialize["kty"] = o.Kty
}
if !IsNil(o.Use) {
toSerialize["use"] = o.Use
}
if !IsNil(o.X) {
toSerialize["x"] = o.X
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LicensingJWK) UnmarshalJSON(data []byte) (err error) {
varLicensingJWK := _LicensingJWK{}
err = json.Unmarshal(data, &varLicensingJWK)
if err != nil {
return err
}
*o = LicensingJWK(varLicensingJWK)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "crv")
delete(additionalProperties, "kty")
delete(additionalProperties, "use")
delete(additionalProperties, "x")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLicensingJWK struct {
value *LicensingJWK
isSet bool
}
func (v NullableLicensingJWK) Get() *LicensingJWK {
return v.value
}
func (v *NullableLicensingJWK) Set(val *LicensingJWK) {
v.value = val
v.isSet = true
}
func (v NullableLicensingJWK) IsSet() bool {
return v.isSet
}
func (v *NullableLicensingJWK) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLicensingJWK(val *LicensingJWK) *NullableLicensingJWK {
return &NullableLicensingJWK{value: val, isSet: true}
}
func (v NullableLicensingJWK) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLicensingJWK) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}