Files
sdk/model_webhook_update_endpoint_in.go

269 lines
7.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 WebhookUpdateEndpointIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebhookUpdateEndpointIn{}
// WebhookUpdateEndpointIn struct for WebhookUpdateEndpointIn
type WebhookUpdateEndpointIn struct {
// Description is a free-text label for the console. Optional, clipped to 1024 bytes.
Description *string `json:"description,omitempty"`
// Events are NATS subject patterns to subscribe to. An empty or omitted list means EVERY event. Max 64 patterns, each max 256 bytes.
Events []string `json:"events,omitempty"`
// Status is \"active\" or \"disabled\". Empty defaults to active.
Status *string `json:"status,omitempty"`
// URL is the https:// address each matching event is POSTed to. Required, max 2048 bytes; http:// and every other scheme is refused.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WebhookUpdateEndpointIn WebhookUpdateEndpointIn
// NewWebhookUpdateEndpointIn instantiates a new WebhookUpdateEndpointIn 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 NewWebhookUpdateEndpointIn() *WebhookUpdateEndpointIn {
this := WebhookUpdateEndpointIn{}
return &this
}
// NewWebhookUpdateEndpointInWithDefaults instantiates a new WebhookUpdateEndpointIn 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 NewWebhookUpdateEndpointInWithDefaults() *WebhookUpdateEndpointIn {
this := WebhookUpdateEndpointIn{}
return &this
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *WebhookUpdateEndpointIn) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookUpdateEndpointIn) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *WebhookUpdateEndpointIn) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *WebhookUpdateEndpointIn) SetDescription(v string) {
o.Description = &v
}
// GetEvents returns the Events field value if set, zero value otherwise.
func (o *WebhookUpdateEndpointIn) 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 *WebhookUpdateEndpointIn) 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 *WebhookUpdateEndpointIn) 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 *WebhookUpdateEndpointIn) SetEvents(v []string) {
o.Events = v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *WebhookUpdateEndpointIn) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookUpdateEndpointIn) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *WebhookUpdateEndpointIn) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *WebhookUpdateEndpointIn) SetStatus(v string) {
o.Status = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *WebhookUpdateEndpointIn) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookUpdateEndpointIn) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *WebhookUpdateEndpointIn) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *WebhookUpdateEndpointIn) SetUrl(v string) {
o.Url = &v
}
func (o WebhookUpdateEndpointIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebhookUpdateEndpointIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Events) {
toSerialize["events"] = o.Events
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WebhookUpdateEndpointIn) UnmarshalJSON(data []byte) (err error) {
varWebhookUpdateEndpointIn := _WebhookUpdateEndpointIn{}
err = json.Unmarshal(data, &varWebhookUpdateEndpointIn)
if err != nil {
return err
}
*o = WebhookUpdateEndpointIn(varWebhookUpdateEndpointIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "description")
delete(additionalProperties, "events")
delete(additionalProperties, "status")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWebhookUpdateEndpointIn struct {
value *WebhookUpdateEndpointIn
isSet bool
}
func (v NullableWebhookUpdateEndpointIn) Get() *WebhookUpdateEndpointIn {
return v.value
}
func (v *NullableWebhookUpdateEndpointIn) Set(val *WebhookUpdateEndpointIn) {
v.value = val
v.isSet = true
}
func (v NullableWebhookUpdateEndpointIn) IsSet() bool {
return v.isSet
}
func (v *NullableWebhookUpdateEndpointIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebhookUpdateEndpointIn(val *WebhookUpdateEndpointIn) *NullableWebhookUpdateEndpointIn {
return &NullableWebhookUpdateEndpointIn{value: val, isSet: true}
}
func (v NullableWebhookUpdateEndpointIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebhookUpdateEndpointIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}