mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
8.1 KiB
Go
307 lines
8.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 GitSubscriptionView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitSubscriptionView{}
|
|
|
|
// GitSubscriptionView struct for GitSubscriptionView
|
|
type GitSubscriptionView struct {
|
|
// Channel is the Slack channel id or name the notifier posts to.
|
|
Channel *string `json:"channel,omitempty"`
|
|
// CreatedAt is RFC 3339 UTC.
|
|
CreatedAt *string `json:"createdAt,omitempty"`
|
|
// Events is the kind filter; absent means every deliverable kind.
|
|
Events []string `json:"events,omitempty"`
|
|
// ID is the subscription's identifier (\"sub_…\"), the handle to delete it by.
|
|
Id *string `json:"id,omitempty"`
|
|
// Repo is the repo whose lifecycle events are delivered.
|
|
Repo *string `json:"repo,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitSubscriptionView GitSubscriptionView
|
|
|
|
// NewGitSubscriptionView instantiates a new GitSubscriptionView 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 NewGitSubscriptionView() *GitSubscriptionView {
|
|
this := GitSubscriptionView{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitSubscriptionViewWithDefaults instantiates a new GitSubscriptionView 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 NewGitSubscriptionViewWithDefaults() *GitSubscriptionView {
|
|
this := GitSubscriptionView{}
|
|
return &this
|
|
}
|
|
|
|
// GetChannel returns the Channel field value if set, zero value otherwise.
|
|
func (o *GitSubscriptionView) GetChannel() string {
|
|
if o == nil || IsNil(o.Channel) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Channel
|
|
}
|
|
|
|
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitSubscriptionView) GetChannelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Channel) {
|
|
return nil, false
|
|
}
|
|
return o.Channel, true
|
|
}
|
|
|
|
// HasChannel returns a boolean if a field has been set.
|
|
func (o *GitSubscriptionView) HasChannel() bool {
|
|
if o != nil && !IsNil(o.Channel) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetChannel gets a reference to the given string and assigns it to the Channel field.
|
|
func (o *GitSubscriptionView) SetChannel(v string) {
|
|
o.Channel = &v
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *GitSubscriptionView) GetCreatedAt() string {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CreatedAt
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitSubscriptionView) GetCreatedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CreatedAt) {
|
|
return nil, false
|
|
}
|
|
return o.CreatedAt, true
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *GitSubscriptionView) HasCreatedAt() bool {
|
|
if o != nil && !IsNil(o.CreatedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
|
|
func (o *GitSubscriptionView) SetCreatedAt(v string) {
|
|
o.CreatedAt = &v
|
|
}
|
|
|
|
// GetEvents returns the Events field value if set, zero value otherwise.
|
|
func (o *GitSubscriptionView) GetEvents() []string {
|
|
if o == nil || IsNil(o.Events) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Events
|
|
}
|
|
|
|
// GetEventsOk returns a tuple with the Events field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitSubscriptionView) GetEventsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Events) {
|
|
return nil, false
|
|
}
|
|
return o.Events, true
|
|
}
|
|
|
|
// HasEvents returns a boolean if a field has been set.
|
|
func (o *GitSubscriptionView) HasEvents() bool {
|
|
if o != nil && !IsNil(o.Events) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEvents gets a reference to the given []string and assigns it to the Events field.
|
|
func (o *GitSubscriptionView) SetEvents(v []string) {
|
|
o.Events = v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *GitSubscriptionView) GetId() string {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret string
|
|
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 *GitSubscriptionView) GetIdOk() (*string, 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 *GitSubscriptionView) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *GitSubscriptionView) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetRepo returns the Repo field value if set, zero value otherwise.
|
|
func (o *GitSubscriptionView) GetRepo() string {
|
|
if o == nil || IsNil(o.Repo) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Repo
|
|
}
|
|
|
|
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitSubscriptionView) GetRepoOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Repo) {
|
|
return nil, false
|
|
}
|
|
return o.Repo, true
|
|
}
|
|
|
|
// HasRepo returns a boolean if a field has been set.
|
|
func (o *GitSubscriptionView) HasRepo() bool {
|
|
if o != nil && !IsNil(o.Repo) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRepo gets a reference to the given string and assigns it to the Repo field.
|
|
func (o *GitSubscriptionView) SetRepo(v string) {
|
|
o.Repo = &v
|
|
}
|
|
|
|
func (o GitSubscriptionView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitSubscriptionView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Channel) {
|
|
toSerialize["channel"] = o.Channel
|
|
}
|
|
if !IsNil(o.CreatedAt) {
|
|
toSerialize["createdAt"] = o.CreatedAt
|
|
}
|
|
if !IsNil(o.Events) {
|
|
toSerialize["events"] = o.Events
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Repo) {
|
|
toSerialize["repo"] = o.Repo
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitSubscriptionView) UnmarshalJSON(data []byte) (err error) {
|
|
varGitSubscriptionView := _GitSubscriptionView{}
|
|
|
|
err = json.Unmarshal(data, &varGitSubscriptionView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitSubscriptionView(varGitSubscriptionView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "channel")
|
|
delete(additionalProperties, "createdAt")
|
|
delete(additionalProperties, "events")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "repo")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitSubscriptionView struct {
|
|
value *GitSubscriptionView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitSubscriptionView) Get() *GitSubscriptionView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitSubscriptionView) Set(val *GitSubscriptionView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitSubscriptionView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitSubscriptionView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitSubscriptionView(val *GitSubscriptionView) *NullableGitSubscriptionView {
|
|
return &NullableGitSubscriptionView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitSubscriptionView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitSubscriptionView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|