Files
sdk/model_git_subscribe_req.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 GitSubscribeReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GitSubscribeReq{}
// GitSubscribeReq struct for GitSubscribeReq
type GitSubscribeReq struct {
// Channel is the Slack channel the notifier posts to — an id (C…/G…), a #name, or a bare name. Required.
Channel *string `json:"channel,omitempty"`
// Events narrows delivery to these lifecycle kinds (push.landed, deploy.live, deploy.failed). Omit it to receive every deliverable kind; a kind that is never posted to Slack is refused rather than silently dropped.
Events []string `json:"events,omitempty"`
// Name is the repo to subscribe, from the :name path segment.
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GitSubscribeReq GitSubscribeReq
// NewGitSubscribeReq instantiates a new GitSubscribeReq 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 NewGitSubscribeReq() *GitSubscribeReq {
this := GitSubscribeReq{}
return &this
}
// NewGitSubscribeReqWithDefaults instantiates a new GitSubscribeReq 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 NewGitSubscribeReqWithDefaults() *GitSubscribeReq {
this := GitSubscribeReq{}
return &this
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *GitSubscribeReq) 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 *GitSubscribeReq) 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 *GitSubscribeReq) 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 *GitSubscribeReq) SetChannel(v string) {
o.Channel = &v
}
// GetEvents returns the Events field value if set, zero value otherwise.
func (o *GitSubscribeReq) 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 *GitSubscribeReq) 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 *GitSubscribeReq) 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 *GitSubscribeReq) SetEvents(v []string) {
o.Events = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *GitSubscribeReq) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GitSubscribeReq) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *GitSubscribeReq) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *GitSubscribeReq) SetName(v string) {
o.Name = &v
}
func (o GitSubscribeReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GitSubscribeReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if !IsNil(o.Events) {
toSerialize["events"] = o.Events
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GitSubscribeReq) UnmarshalJSON(data []byte) (err error) {
varGitSubscribeReq := _GitSubscribeReq{}
err = json.Unmarshal(data, &varGitSubscribeReq)
if err != nil {
return err
}
*o = GitSubscribeReq(varGitSubscribeReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "channel")
delete(additionalProperties, "events")
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGitSubscribeReq struct {
value *GitSubscribeReq
isSet bool
}
func (v NullableGitSubscribeReq) Get() *GitSubscribeReq {
return v.value
}
func (v *NullableGitSubscribeReq) Set(val *GitSubscribeReq) {
v.value = val
v.isSet = true
}
func (v NullableGitSubscribeReq) IsSet() bool {
return v.isSet
}
func (v *NullableGitSubscribeReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGitSubscribeReq(val *GitSubscribeReq) *NullableGitSubscribeReq {
return &NullableGitSubscribeReq{value: val, isSet: true}
}
func (v NullableGitSubscribeReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGitSubscribeReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}