Files
sdk/model_webhook_create_endpoint_in.go

269 lines
7.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 WebhookCreateEndpointIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebhookCreateEndpointIn{}
// WebhookCreateEndpointIn struct for WebhookCreateEndpointIn
type WebhookCreateEndpointIn 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 (e.g. \"commerce.order.>\"). An empty or omitted list means EVERY event on the platform bus. Max 64 patterns, each max 256 bytes.
Events []string `json:"events,omitempty"`
// Status is \"active\" or \"disabled\". Empty defaults to active. A disabled endpoint receives no bus deliveries, but can still be exercised with POST /v1/webhook/{id}/test.
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, because a webhook carries signed event data and must not travel in the clear.
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WebhookCreateEndpointIn WebhookCreateEndpointIn
// NewWebhookCreateEndpointIn instantiates a new WebhookCreateEndpointIn 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 NewWebhookCreateEndpointIn() *WebhookCreateEndpointIn {
this := WebhookCreateEndpointIn{}
return &this
}
// NewWebhookCreateEndpointInWithDefaults instantiates a new WebhookCreateEndpointIn 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 NewWebhookCreateEndpointInWithDefaults() *WebhookCreateEndpointIn {
this := WebhookCreateEndpointIn{}
return &this
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) SetDescription(v string) {
o.Description = &v
}
// GetEvents returns the Events field value if set, zero value otherwise.
func (o *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) SetEvents(v []string) {
o.Events = v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) SetStatus(v string) {
o.Status = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) SetUrl(v string) {
o.Url = &v
}
func (o WebhookCreateEndpointIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebhookCreateEndpointIn) 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 *WebhookCreateEndpointIn) UnmarshalJSON(data []byte) (err error) {
varWebhookCreateEndpointIn := _WebhookCreateEndpointIn{}
err = json.Unmarshal(data, &varWebhookCreateEndpointIn)
if err != nil {
return err
}
*o = WebhookCreateEndpointIn(varWebhookCreateEndpointIn)
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 NullableWebhookCreateEndpointIn struct {
value *WebhookCreateEndpointIn
isSet bool
}
func (v NullableWebhookCreateEndpointIn) Get() *WebhookCreateEndpointIn {
return v.value
}
func (v *NullableWebhookCreateEndpointIn) Set(val *WebhookCreateEndpointIn) {
v.value = val
v.isSet = true
}
func (v NullableWebhookCreateEndpointIn) IsSet() bool {
return v.isSet
}
func (v *NullableWebhookCreateEndpointIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebhookCreateEndpointIn(val *WebhookCreateEndpointIn) *NullableWebhookCreateEndpointIn {
return &NullableWebhookCreateEndpointIn{value: val, isSet: true}
}
func (v NullableWebhookCreateEndpointIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebhookCreateEndpointIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}