Files
sdk/model_provider_github_import_in.go

193 lines
5.5 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 ProviderGithubImportIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGithubImportIn{}
// ProviderGithubImportIn struct for ProviderGithubImportIn
type ProviderGithubImportIn struct {
// All imports every repository the installation grants, instead of naming them. Archived and disabled repositories are skipped either way — they cannot be fetched.
All *bool `json:"all,omitempty"`
// Repos names the repositories to import, either owner-qualified (\"hanzo-apps/ai\") or as a bare name (\"ai\"); a trailing \".git\" is stripped. A bare name that matches more than one granted repository is an error rather than a guess, because one Hanzo org may hold several GitHub installations and a name is only unique within an owner. Ignored when all is true.
Repos []string `json:"repos,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGithubImportIn ProviderGithubImportIn
// NewProviderGithubImportIn instantiates a new ProviderGithubImportIn 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 NewProviderGithubImportIn() *ProviderGithubImportIn {
this := ProviderGithubImportIn{}
return &this
}
// NewProviderGithubImportInWithDefaults instantiates a new ProviderGithubImportIn 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 NewProviderGithubImportInWithDefaults() *ProviderGithubImportIn {
this := ProviderGithubImportIn{}
return &this
}
// GetAll returns the All field value if set, zero value otherwise.
func (o *ProviderGithubImportIn) GetAll() bool {
if o == nil || IsNil(o.All) {
var ret bool
return ret
}
return *o.All
}
// GetAllOk returns a tuple with the All field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubImportIn) GetAllOk() (*bool, bool) {
if o == nil || IsNil(o.All) {
return nil, false
}
return o.All, true
}
// HasAll returns a boolean if a field has been set.
func (o *ProviderGithubImportIn) HasAll() bool {
if o != nil && !IsNil(o.All) {
return true
}
return false
}
// SetAll gets a reference to the given bool and assigns it to the All field.
func (o *ProviderGithubImportIn) SetAll(v bool) {
o.All = &v
}
// GetRepos returns the Repos field value if set, zero value otherwise.
func (o *ProviderGithubImportIn) GetRepos() []string {
if o == nil || IsNil(o.Repos) {
var ret []string
return ret
}
return o.Repos
}
// GetReposOk returns a tuple with the Repos field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubImportIn) GetReposOk() ([]string, bool) {
if o == nil || IsNil(o.Repos) {
return nil, false
}
return o.Repos, true
}
// HasRepos returns a boolean if a field has been set.
func (o *ProviderGithubImportIn) HasRepos() bool {
if o != nil && !IsNil(o.Repos) {
return true
}
return false
}
// SetRepos gets a reference to the given []string and assigns it to the Repos field.
func (o *ProviderGithubImportIn) SetRepos(v []string) {
o.Repos = v
}
func (o ProviderGithubImportIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGithubImportIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.All) {
toSerialize["all"] = o.All
}
if !IsNil(o.Repos) {
toSerialize["repos"] = o.Repos
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGithubImportIn) UnmarshalJSON(data []byte) (err error) {
varProviderGithubImportIn := _ProviderGithubImportIn{}
err = json.Unmarshal(data, &varProviderGithubImportIn)
if err != nil {
return err
}
*o = ProviderGithubImportIn(varProviderGithubImportIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "all")
delete(additionalProperties, "repos")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGithubImportIn struct {
value *ProviderGithubImportIn
isSet bool
}
func (v NullableProviderGithubImportIn) Get() *ProviderGithubImportIn {
return v.value
}
func (v *NullableProviderGithubImportIn) Set(val *ProviderGithubImportIn) {
v.value = val
v.isSet = true
}
func (v NullableProviderGithubImportIn) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGithubImportIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGithubImportIn(val *ProviderGithubImportIn) *NullableProviderGithubImportIn {
return &NullableProviderGithubImportIn{value: val, isSet: true}
}
func (v NullableProviderGithubImportIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGithubImportIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}