Files
sdk/model_provider_github_installations_out.go

193 lines
6.2 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 ProviderGithubInstallationsOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGithubInstallationsOut{}
// ProviderGithubInstallationsOut struct for ProviderGithubInstallationsOut
type ProviderGithubInstallationsOut struct {
// InstallURL is where to grant a new account, so a UI with an empty list has somewhere to send the reader instead of a dead end.
InstallUrl *string `json:"installUrl,omitempty"`
// Installations is every account the caller may see: the ones its own org has bound, or — for a super admin — every account the App is installed on. Never null; [] when none.
Installations []ProviderGithubInstallationView `json:"installations,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGithubInstallationsOut ProviderGithubInstallationsOut
// NewProviderGithubInstallationsOut instantiates a new ProviderGithubInstallationsOut 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 NewProviderGithubInstallationsOut() *ProviderGithubInstallationsOut {
this := ProviderGithubInstallationsOut{}
return &this
}
// NewProviderGithubInstallationsOutWithDefaults instantiates a new ProviderGithubInstallationsOut 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 NewProviderGithubInstallationsOutWithDefaults() *ProviderGithubInstallationsOut {
this := ProviderGithubInstallationsOut{}
return &this
}
// GetInstallUrl returns the InstallUrl field value if set, zero value otherwise.
func (o *ProviderGithubInstallationsOut) GetInstallUrl() string {
if o == nil || IsNil(o.InstallUrl) {
var ret string
return ret
}
return *o.InstallUrl
}
// GetInstallUrlOk returns a tuple with the InstallUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubInstallationsOut) GetInstallUrlOk() (*string, bool) {
if o == nil || IsNil(o.InstallUrl) {
return nil, false
}
return o.InstallUrl, true
}
// HasInstallUrl returns a boolean if a field has been set.
func (o *ProviderGithubInstallationsOut) HasInstallUrl() bool {
if o != nil && !IsNil(o.InstallUrl) {
return true
}
return false
}
// SetInstallUrl gets a reference to the given string and assigns it to the InstallUrl field.
func (o *ProviderGithubInstallationsOut) SetInstallUrl(v string) {
o.InstallUrl = &v
}
// GetInstallations returns the Installations field value if set, zero value otherwise.
func (o *ProviderGithubInstallationsOut) GetInstallations() []ProviderGithubInstallationView {
if o == nil || IsNil(o.Installations) {
var ret []ProviderGithubInstallationView
return ret
}
return o.Installations
}
// GetInstallationsOk returns a tuple with the Installations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubInstallationsOut) GetInstallationsOk() ([]ProviderGithubInstallationView, bool) {
if o == nil || IsNil(o.Installations) {
return nil, false
}
return o.Installations, true
}
// HasInstallations returns a boolean if a field has been set.
func (o *ProviderGithubInstallationsOut) HasInstallations() bool {
if o != nil && !IsNil(o.Installations) {
return true
}
return false
}
// SetInstallations gets a reference to the given []ProviderGithubInstallationView and assigns it to the Installations field.
func (o *ProviderGithubInstallationsOut) SetInstallations(v []ProviderGithubInstallationView) {
o.Installations = v
}
func (o ProviderGithubInstallationsOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGithubInstallationsOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.InstallUrl) {
toSerialize["installUrl"] = o.InstallUrl
}
if !IsNil(o.Installations) {
toSerialize["installations"] = o.Installations
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGithubInstallationsOut) UnmarshalJSON(data []byte) (err error) {
varProviderGithubInstallationsOut := _ProviderGithubInstallationsOut{}
err = json.Unmarshal(data, &varProviderGithubInstallationsOut)
if err != nil {
return err
}
*o = ProviderGithubInstallationsOut(varProviderGithubInstallationsOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "installUrl")
delete(additionalProperties, "installations")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGithubInstallationsOut struct {
value *ProviderGithubInstallationsOut
isSet bool
}
func (v NullableProviderGithubInstallationsOut) Get() *ProviderGithubInstallationsOut {
return v.value
}
func (v *NullableProviderGithubInstallationsOut) Set(val *ProviderGithubInstallationsOut) {
v.value = val
v.isSet = true
}
func (v NullableProviderGithubInstallationsOut) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGithubInstallationsOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGithubInstallationsOut(val *ProviderGithubInstallationsOut) *NullableProviderGithubInstallationsOut {
return &NullableProviderGithubInstallationsOut{value: val, isSet: true}
}
func (v NullableProviderGithubInstallationsOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGithubInstallationsOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}