Files
sdk/model_provider_github_installation_view.go

307 lines
8.8 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 ProviderGithubInstallationView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProviderGithubInstallationView{}
// ProviderGithubInstallationView struct for ProviderGithubInstallationView
type ProviderGithubInstallationView struct {
// Connected reports whether THIS org has already bound this account.
Connected *bool `json:"connected,omitempty"`
// Grant is \"all\" or \"selected\" — how many of the account's repositories the install covers. A reader deciding what to import needs the reach, not just the name.
Grant *string `json:"grant,omitempty"`
// HTMLURL is the account's page on GitHub.
HtmlUrl *string `json:"htmlUrl,omitempty"`
// Login is the GitHub account name — the org or user the App is installed on.
Login *string `json:"login,omitempty"`
// Type is \"Organization\" or \"User\".
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProviderGithubInstallationView ProviderGithubInstallationView
// NewProviderGithubInstallationView instantiates a new ProviderGithubInstallationView 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 NewProviderGithubInstallationView() *ProviderGithubInstallationView {
this := ProviderGithubInstallationView{}
return &this
}
// NewProviderGithubInstallationViewWithDefaults instantiates a new ProviderGithubInstallationView 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 NewProviderGithubInstallationViewWithDefaults() *ProviderGithubInstallationView {
this := ProviderGithubInstallationView{}
return &this
}
// GetConnected returns the Connected field value if set, zero value otherwise.
func (o *ProviderGithubInstallationView) GetConnected() bool {
if o == nil || IsNil(o.Connected) {
var ret bool
return ret
}
return *o.Connected
}
// GetConnectedOk returns a tuple with the Connected field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubInstallationView) GetConnectedOk() (*bool, bool) {
if o == nil || IsNil(o.Connected) {
return nil, false
}
return o.Connected, true
}
// HasConnected returns a boolean if a field has been set.
func (o *ProviderGithubInstallationView) HasConnected() bool {
if o != nil && !IsNil(o.Connected) {
return true
}
return false
}
// SetConnected gets a reference to the given bool and assigns it to the Connected field.
func (o *ProviderGithubInstallationView) SetConnected(v bool) {
o.Connected = &v
}
// GetGrant returns the Grant field value if set, zero value otherwise.
func (o *ProviderGithubInstallationView) GetGrant() string {
if o == nil || IsNil(o.Grant) {
var ret string
return ret
}
return *o.Grant
}
// GetGrantOk returns a tuple with the Grant field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubInstallationView) GetGrantOk() (*string, bool) {
if o == nil || IsNil(o.Grant) {
return nil, false
}
return o.Grant, true
}
// HasGrant returns a boolean if a field has been set.
func (o *ProviderGithubInstallationView) HasGrant() bool {
if o != nil && !IsNil(o.Grant) {
return true
}
return false
}
// SetGrant gets a reference to the given string and assigns it to the Grant field.
func (o *ProviderGithubInstallationView) SetGrant(v string) {
o.Grant = &v
}
// GetHtmlUrl returns the HtmlUrl field value if set, zero value otherwise.
func (o *ProviderGithubInstallationView) GetHtmlUrl() string {
if o == nil || IsNil(o.HtmlUrl) {
var ret string
return ret
}
return *o.HtmlUrl
}
// GetHtmlUrlOk returns a tuple with the HtmlUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubInstallationView) GetHtmlUrlOk() (*string, bool) {
if o == nil || IsNil(o.HtmlUrl) {
return nil, false
}
return o.HtmlUrl, true
}
// HasHtmlUrl returns a boolean if a field has been set.
func (o *ProviderGithubInstallationView) HasHtmlUrl() bool {
if o != nil && !IsNil(o.HtmlUrl) {
return true
}
return false
}
// SetHtmlUrl gets a reference to the given string and assigns it to the HtmlUrl field.
func (o *ProviderGithubInstallationView) SetHtmlUrl(v string) {
o.HtmlUrl = &v
}
// GetLogin returns the Login field value if set, zero value otherwise.
func (o *ProviderGithubInstallationView) GetLogin() string {
if o == nil || IsNil(o.Login) {
var ret string
return ret
}
return *o.Login
}
// GetLoginOk returns a tuple with the Login field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubInstallationView) GetLoginOk() (*string, bool) {
if o == nil || IsNil(o.Login) {
return nil, false
}
return o.Login, true
}
// HasLogin returns a boolean if a field has been set.
func (o *ProviderGithubInstallationView) HasLogin() bool {
if o != nil && !IsNil(o.Login) {
return true
}
return false
}
// SetLogin gets a reference to the given string and assigns it to the Login field.
func (o *ProviderGithubInstallationView) SetLogin(v string) {
o.Login = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *ProviderGithubInstallationView) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProviderGithubInstallationView) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *ProviderGithubInstallationView) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *ProviderGithubInstallationView) SetType(v string) {
o.Type = &v
}
func (o ProviderGithubInstallationView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProviderGithubInstallationView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Connected) {
toSerialize["connected"] = o.Connected
}
if !IsNil(o.Grant) {
toSerialize["grant"] = o.Grant
}
if !IsNil(o.HtmlUrl) {
toSerialize["htmlUrl"] = o.HtmlUrl
}
if !IsNil(o.Login) {
toSerialize["login"] = o.Login
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProviderGithubInstallationView) UnmarshalJSON(data []byte) (err error) {
varProviderGithubInstallationView := _ProviderGithubInstallationView{}
err = json.Unmarshal(data, &varProviderGithubInstallationView)
if err != nil {
return err
}
*o = ProviderGithubInstallationView(varProviderGithubInstallationView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "connected")
delete(additionalProperties, "grant")
delete(additionalProperties, "htmlUrl")
delete(additionalProperties, "login")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProviderGithubInstallationView struct {
value *ProviderGithubInstallationView
isSet bool
}
func (v NullableProviderGithubInstallationView) Get() *ProviderGithubInstallationView {
return v.value
}
func (v *NullableProviderGithubInstallationView) Set(val *ProviderGithubInstallationView) {
v.value = val
v.isSet = true
}
func (v NullableProviderGithubInstallationView) IsSet() bool {
return v.isSet
}
func (v *NullableProviderGithubInstallationView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProviderGithubInstallationView(val *ProviderGithubInstallationView) *NullableProviderGithubInstallationView {
return &NullableProviderGithubInstallationView{value: val, isSet: true}
}
func (v NullableProviderGithubInstallationView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProviderGithubInstallationView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}