Files
sdk/model_reference_reference_source.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 ReferenceReferenceSource type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReferenceReferenceSource{}
// ReferenceReferenceSource struct for ReferenceReferenceSource
type ReferenceReferenceSource struct {
// AsOf is when this publisher was current, RFC 3339.
AsOf *string `json:"asOf,omitempty"`
// Basis is the KIND of permission this publisher's data reaches you under: licence (an explicit grant), registry (the registry of record publishing for anyone to consult), operator (an operator's own machine-readable statement about its own network, published for third parties to filter by — not a licence, and not claimed as one), own (computed here), or none (nothing reaches you: the membership is held by the component that screens against it). It is on the wire so the licence position is an audit you can run.
Basis *string `json:"basis,omitempty"`
// Keys is how many members this publisher contributed.
Keys *int64 `json:"keys,omitempty"`
// Origin is exactly where it was taken from, so it can be taken again.
Origin *string `json:"origin,omitempty"`
// Refusal is why this publisher's last take failed, if it did. The set keeps its previous version of this source and ages out visibly rather than silently shrinking.
Refusal *string `json:"refusal,omitempty"`
// Source is the publisher.
Source *string `json:"source,omitempty"`
// Terms is the CITATION that basis points at — the licence identifier, the registry, or the operator publication. A source with no stated terms is not in the catalog.
Terms *string `json:"terms,omitempty"`
// Version is the content digest of what this publisher last supplied. Two refreshes that agree on it took the same data.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ReferenceReferenceSource ReferenceReferenceSource
// NewReferenceReferenceSource instantiates a new ReferenceReferenceSource 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 NewReferenceReferenceSource() *ReferenceReferenceSource {
this := ReferenceReferenceSource{}
return &this
}
// NewReferenceReferenceSourceWithDefaults instantiates a new ReferenceReferenceSource 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 NewReferenceReferenceSourceWithDefaults() *ReferenceReferenceSource {
this := ReferenceReferenceSource{}
return &this
}
// GetAsOf returns the AsOf field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetAsOf() string {
if o == nil || IsNil(o.AsOf) {
var ret string
return ret
}
return *o.AsOf
}
// GetAsOfOk returns a tuple with the AsOf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceSource) GetAsOfOk() (*string, bool) {
if o == nil || IsNil(o.AsOf) {
return nil, false
}
return o.AsOf, true
}
// HasAsOf returns a boolean if a field has been set.
func (o *ReferenceReferenceSource) HasAsOf() bool {
if o != nil && !IsNil(o.AsOf) {
return true
}
return false
}
// SetAsOf gets a reference to the given string and assigns it to the AsOf field.
func (o *ReferenceReferenceSource) SetAsOf(v string) {
o.AsOf = &v
}
// GetBasis returns the Basis field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetBasis() string {
if o == nil || IsNil(o.Basis) {
var ret string
return ret
}
return *o.Basis
}
// GetBasisOk returns a tuple with the Basis field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceSource) GetBasisOk() (*string, bool) {
if o == nil || IsNil(o.Basis) {
return nil, false
}
return o.Basis, true
}
// HasBasis returns a boolean if a field has been set.
func (o *ReferenceReferenceSource) HasBasis() bool {
if o != nil && !IsNil(o.Basis) {
return true
}
return false
}
// SetBasis gets a reference to the given string and assigns it to the Basis field.
func (o *ReferenceReferenceSource) SetBasis(v string) {
o.Basis = &v
}
// GetKeys returns the Keys field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetKeys() int64 {
if o == nil || IsNil(o.Keys) {
var ret int64
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 *ReferenceReferenceSource) GetKeysOk() (*int64, 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 *ReferenceReferenceSource) HasKeys() bool {
if o != nil && !IsNil(o.Keys) {
return true
}
return false
}
// SetKeys gets a reference to the given int64 and assigns it to the Keys field.
func (o *ReferenceReferenceSource) SetKeys(v int64) {
o.Keys = &v
}
// GetOrigin returns the Origin field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetOrigin() string {
if o == nil || IsNil(o.Origin) {
var ret string
return ret
}
return *o.Origin
}
// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceSource) GetOriginOk() (*string, bool) {
if o == nil || IsNil(o.Origin) {
return nil, false
}
return o.Origin, true
}
// HasOrigin returns a boolean if a field has been set.
func (o *ReferenceReferenceSource) HasOrigin() bool {
if o != nil && !IsNil(o.Origin) {
return true
}
return false
}
// SetOrigin gets a reference to the given string and assigns it to the Origin field.
func (o *ReferenceReferenceSource) SetOrigin(v string) {
o.Origin = &v
}
// GetRefusal returns the Refusal field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetRefusal() string {
if o == nil || IsNil(o.Refusal) {
var ret string
return ret
}
return *o.Refusal
}
// GetRefusalOk returns a tuple with the Refusal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceSource) GetRefusalOk() (*string, bool) {
if o == nil || IsNil(o.Refusal) {
return nil, false
}
return o.Refusal, true
}
// HasRefusal returns a boolean if a field has been set.
func (o *ReferenceReferenceSource) HasRefusal() bool {
if o != nil && !IsNil(o.Refusal) {
return true
}
return false
}
// SetRefusal gets a reference to the given string and assigns it to the Refusal field.
func (o *ReferenceReferenceSource) SetRefusal(v string) {
o.Refusal = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceSource) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *ReferenceReferenceSource) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *ReferenceReferenceSource) SetSource(v string) {
o.Source = &v
}
// GetTerms returns the Terms field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetTerms() string {
if o == nil || IsNil(o.Terms) {
var ret string
return ret
}
return *o.Terms
}
// GetTermsOk returns a tuple with the Terms field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceSource) GetTermsOk() (*string, bool) {
if o == nil || IsNil(o.Terms) {
return nil, false
}
return o.Terms, true
}
// HasTerms returns a boolean if a field has been set.
func (o *ReferenceReferenceSource) HasTerms() bool {
if o != nil && !IsNil(o.Terms) {
return true
}
return false
}
// SetTerms gets a reference to the given string and assigns it to the Terms field.
func (o *ReferenceReferenceSource) SetTerms(v string) {
o.Terms = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *ReferenceReferenceSource) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceSource) GetVersionOk() (*string, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *ReferenceReferenceSource) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *ReferenceReferenceSource) SetVersion(v string) {
o.Version = &v
}
func (o ReferenceReferenceSource) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReferenceReferenceSource) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AsOf) {
toSerialize["asOf"] = o.AsOf
}
if !IsNil(o.Basis) {
toSerialize["basis"] = o.Basis
}
if !IsNil(o.Keys) {
toSerialize["keys"] = o.Keys
}
if !IsNil(o.Origin) {
toSerialize["origin"] = o.Origin
}
if !IsNil(o.Refusal) {
toSerialize["refusal"] = o.Refusal
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Terms) {
toSerialize["terms"] = o.Terms
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ReferenceReferenceSource) UnmarshalJSON(data []byte) (err error) {
varReferenceReferenceSource := _ReferenceReferenceSource{}
err = json.Unmarshal(data, &varReferenceReferenceSource)
if err != nil {
return err
}
*o = ReferenceReferenceSource(varReferenceReferenceSource)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "asOf")
delete(additionalProperties, "basis")
delete(additionalProperties, "keys")
delete(additionalProperties, "origin")
delete(additionalProperties, "refusal")
delete(additionalProperties, "source")
delete(additionalProperties, "terms")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableReferenceReferenceSource struct {
value *ReferenceReferenceSource
isSet bool
}
func (v NullableReferenceReferenceSource) Get() *ReferenceReferenceSource {
return v.value
}
func (v *NullableReferenceReferenceSource) Set(val *ReferenceReferenceSource) {
v.value = val
v.isSet = true
}
func (v NullableReferenceReferenceSource) IsSet() bool {
return v.isSet
}
func (v *NullableReferenceReferenceSource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReferenceReferenceSource(val *ReferenceReferenceSource) *NullableReferenceReferenceSource {
return &NullableReferenceReferenceSource{value: val, isSet: true}
}
func (v NullableReferenceReferenceSource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReferenceReferenceSource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}