Files
sdk/model_graph_graph_community.go

231 lines
6.1 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 GraphGraphCommunity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GraphGraphCommunity{}
// GraphGraphCommunity struct for GraphGraphCommunity
type GraphGraphCommunity struct {
// ID numbers the community by size, largest first, then by its lowest key. The same graph at the same instant and level numbers it the same way every time; another instant may not.
Id *int64 `json:"id,omitempty"`
// Members are the entities in it, in key order.
Members []string `json:"members,omitempty"`
// Size is how many entities belong to it, whether or not all are listed.
Size *int64 `json:"size,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GraphGraphCommunity GraphGraphCommunity
// NewGraphGraphCommunity instantiates a new GraphGraphCommunity 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 NewGraphGraphCommunity() *GraphGraphCommunity {
this := GraphGraphCommunity{}
return &this
}
// NewGraphGraphCommunityWithDefaults instantiates a new GraphGraphCommunity 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 NewGraphGraphCommunityWithDefaults() *GraphGraphCommunity {
this := GraphGraphCommunity{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *GraphGraphCommunity) GetId() int64 {
if o == nil || IsNil(o.Id) {
var ret int64
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 *GraphGraphCommunity) GetIdOk() (*int64, 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 *GraphGraphCommunity) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given int64 and assigns it to the Id field.
func (o *GraphGraphCommunity) SetId(v int64) {
o.Id = &v
}
// GetMembers returns the Members field value if set, zero value otherwise.
func (o *GraphGraphCommunity) GetMembers() []string {
if o == nil || IsNil(o.Members) {
var ret []string
return ret
}
return o.Members
}
// GetMembersOk returns a tuple with the Members field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphCommunity) GetMembersOk() ([]string, bool) {
if o == nil || IsNil(o.Members) {
return nil, false
}
return o.Members, true
}
// HasMembers returns a boolean if a field has been set.
func (o *GraphGraphCommunity) HasMembers() bool {
if o != nil && !IsNil(o.Members) {
return true
}
return false
}
// SetMembers gets a reference to the given []string and assigns it to the Members field.
func (o *GraphGraphCommunity) SetMembers(v []string) {
o.Members = v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *GraphGraphCommunity) GetSize() int64 {
if o == nil || IsNil(o.Size) {
var ret int64
return ret
}
return *o.Size
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GraphGraphCommunity) GetSizeOk() (*int64, bool) {
if o == nil || IsNil(o.Size) {
return nil, false
}
return o.Size, true
}
// HasSize returns a boolean if a field has been set.
func (o *GraphGraphCommunity) HasSize() bool {
if o != nil && !IsNil(o.Size) {
return true
}
return false
}
// SetSize gets a reference to the given int64 and assigns it to the Size field.
func (o *GraphGraphCommunity) SetSize(v int64) {
o.Size = &v
}
func (o GraphGraphCommunity) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GraphGraphCommunity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Members) {
toSerialize["members"] = o.Members
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GraphGraphCommunity) UnmarshalJSON(data []byte) (err error) {
varGraphGraphCommunity := _GraphGraphCommunity{}
err = json.Unmarshal(data, &varGraphGraphCommunity)
if err != nil {
return err
}
*o = GraphGraphCommunity(varGraphGraphCommunity)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "members")
delete(additionalProperties, "size")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGraphGraphCommunity struct {
value *GraphGraphCommunity
isSet bool
}
func (v NullableGraphGraphCommunity) Get() *GraphGraphCommunity {
return v.value
}
func (v *NullableGraphGraphCommunity) Set(val *GraphGraphCommunity) {
v.value = val
v.isSet = true
}
func (v NullableGraphGraphCommunity) IsSet() bool {
return v.isSet
}
func (v *NullableGraphGraphCommunity) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGraphGraphCommunity(val *GraphGraphCommunity) *NullableGraphGraphCommunity {
return &NullableGraphGraphCommunity{value: val, isSet: true}
}
func (v NullableGraphGraphCommunity) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGraphGraphCommunity) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}