mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
421 lines
12 KiB
Go
421 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 ProvisioningProvisionedResource type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ProvisioningProvisionedResource{}
|
|
|
|
// ProvisioningProvisionedResource struct for ProvisioningProvisionedResource
|
|
type ProvisioningProvisionedResource struct {
|
|
// Database is the logical database, collection, index or bucket this resource resolves to on its backend.
|
|
Database *string `json:"database,omitempty"`
|
|
// Host is the address that actually routes to this resource — a dedicated instance's own in-cluster Service, or the public gateway for a shared one.
|
|
Host *string `json:"host,omitempty"`
|
|
// ID is the resource's server-minted handle, \"rs_\"-prefixed.
|
|
Id *string `json:"id,omitempty"`
|
|
// Kind is the product: sql, vector, datastore, kv, search, s3 or docdb.
|
|
Kind *string `json:"kind,omitempty"`
|
|
// Name is the org-unique slug the caller provisioned the resource under.
|
|
Name *string `json:"name,omitempty"`
|
|
// Port is the port a client connects to on Host.
|
|
Port *int64 `json:"port,omitempty"`
|
|
// Status is \"ready\", or \"provisioning\" while a dedicated instance is still being materialized. A dedicated resource's status is reconciled from the operator's live CR before this is answered, so it is never a stale ready.
|
|
Status *string `json:"status,omitempty"`
|
|
// Username is the credential's user, for the kinds that mint one per resource. Absent for a kind whose backend authenticates with a shared, out-of-band key.
|
|
Username *string `json:"username,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ProvisioningProvisionedResource ProvisioningProvisionedResource
|
|
|
|
// NewProvisioningProvisionedResource instantiates a new ProvisioningProvisionedResource 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 NewProvisioningProvisionedResource() *ProvisioningProvisionedResource {
|
|
this := ProvisioningProvisionedResource{}
|
|
return &this
|
|
}
|
|
|
|
// NewProvisioningProvisionedResourceWithDefaults instantiates a new ProvisioningProvisionedResource 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 NewProvisioningProvisionedResourceWithDefaults() *ProvisioningProvisionedResource {
|
|
this := ProvisioningProvisionedResource{}
|
|
return &this
|
|
}
|
|
|
|
// GetDatabase returns the Database field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetDatabase() string {
|
|
if o == nil || IsNil(o.Database) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Database
|
|
}
|
|
|
|
// GetDatabaseOk returns a tuple with the Database field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetDatabaseOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Database) {
|
|
return nil, false
|
|
}
|
|
return o.Database, true
|
|
}
|
|
|
|
// HasDatabase returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasDatabase() bool {
|
|
if o != nil && !IsNil(o.Database) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDatabase gets a reference to the given string and assigns it to the Database field.
|
|
func (o *ProvisioningProvisionedResource) SetDatabase(v string) {
|
|
o.Database = &v
|
|
}
|
|
|
|
// GetHost returns the Host field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetHost() string {
|
|
if o == nil || IsNil(o.Host) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Host
|
|
}
|
|
|
|
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetHostOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Host) {
|
|
return nil, false
|
|
}
|
|
return o.Host, true
|
|
}
|
|
|
|
// HasHost returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasHost() bool {
|
|
if o != nil && !IsNil(o.Host) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHost gets a reference to the given string and assigns it to the Host field.
|
|
func (o *ProvisioningProvisionedResource) SetHost(v string) {
|
|
o.Host = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *ProvisioningProvisionedResource) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetKind returns the Kind field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetKind() string {
|
|
if o == nil || IsNil(o.Kind) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Kind
|
|
}
|
|
|
|
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetKindOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Kind) {
|
|
return nil, false
|
|
}
|
|
return o.Kind, true
|
|
}
|
|
|
|
// HasKind returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasKind() bool {
|
|
if o != nil && !IsNil(o.Kind) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
|
func (o *ProvisioningProvisionedResource) SetKind(v string) {
|
|
o.Kind = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *ProvisioningProvisionedResource) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetPort returns the Port field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetPort() int64 {
|
|
if o == nil || IsNil(o.Port) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Port
|
|
}
|
|
|
|
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetPortOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Port) {
|
|
return nil, false
|
|
}
|
|
return o.Port, true
|
|
}
|
|
|
|
// HasPort returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasPort() bool {
|
|
if o != nil && !IsNil(o.Port) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPort gets a reference to the given int64 and assigns it to the Port field.
|
|
func (o *ProvisioningProvisionedResource) SetPort(v int64) {
|
|
o.Port = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetStatus() string {
|
|
if o == nil || IsNil(o.Status) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Status
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetStatusOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Status) {
|
|
return nil, false
|
|
}
|
|
return o.Status, true
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasStatus() bool {
|
|
if o != nil && !IsNil(o.Status) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *ProvisioningProvisionedResource) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetUsername returns the Username field value if set, zero value otherwise.
|
|
func (o *ProvisioningProvisionedResource) GetUsername() string {
|
|
if o == nil || IsNil(o.Username) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Username
|
|
}
|
|
|
|
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ProvisioningProvisionedResource) GetUsernameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Username) {
|
|
return nil, false
|
|
}
|
|
return o.Username, true
|
|
}
|
|
|
|
// HasUsername returns a boolean if a field has been set.
|
|
func (o *ProvisioningProvisionedResource) HasUsername() bool {
|
|
if o != nil && !IsNil(o.Username) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUsername gets a reference to the given string and assigns it to the Username field.
|
|
func (o *ProvisioningProvisionedResource) SetUsername(v string) {
|
|
o.Username = &v
|
|
}
|
|
|
|
func (o ProvisioningProvisionedResource) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ProvisioningProvisionedResource) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Database) {
|
|
toSerialize["database"] = o.Database
|
|
}
|
|
if !IsNil(o.Host) {
|
|
toSerialize["host"] = o.Host
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Kind) {
|
|
toSerialize["kind"] = o.Kind
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Port) {
|
|
toSerialize["port"] = o.Port
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.Username) {
|
|
toSerialize["username"] = o.Username
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ProvisioningProvisionedResource) UnmarshalJSON(data []byte) (err error) {
|
|
varProvisioningProvisionedResource := _ProvisioningProvisionedResource{}
|
|
|
|
err = json.Unmarshal(data, &varProvisioningProvisionedResource)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ProvisioningProvisionedResource(varProvisioningProvisionedResource)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "database")
|
|
delete(additionalProperties, "host")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "kind")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "port")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "username")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableProvisioningProvisionedResource struct {
|
|
value *ProvisioningProvisionedResource
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableProvisioningProvisionedResource) Get() *ProvisioningProvisionedResource {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableProvisioningProvisionedResource) Set(val *ProvisioningProvisionedResource) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableProvisioningProvisionedResource) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableProvisioningProvisionedResource) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableProvisioningProvisionedResource(val *ProvisioningProvisionedResource) *NullableProvisioningProvisionedResource {
|
|
return &NullableProvisioningProvisionedResource{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableProvisioningProvisionedResource) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableProvisioningProvisionedResource) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|