Files
sdk/model_webhook_delivery_row.go

459 lines
13 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 WebhookDeliveryRow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebhookDeliveryRow{}
// WebhookDeliveryRow struct for WebhookDeliveryRow
type WebhookDeliveryRow struct {
// Attempt is which try this row is, starting at 1. The ladder waits 1s, then 5s, then 25s before the next one.
Attempt *int64 `json:"attempt,omitempty"`
// Created is when the attempt was made, RFC3339 in UTC.
Created *string `json:"created,omitempty"`
// DeliveryID groups the attempts for ONE event to ONE endpoint. Rows sharing it are the same delivery being retried, not separate events.
Delivery *string `json:"delivery,omitempty"`
// DurationMs is how long this attempt took end to end, in MILLISECONDS.
DurationMs *int64 `json:"durationMs,omitempty"`
// EndpointID is which subscriber this attempt was for.
Endpoint *string `json:"endpoint,omitempty"`
// Error says what went wrong on a non-ok attempt. Empty on success.
Error *string `json:"error,omitempty"`
// HTTPStatus is what the subscriber answered. ZERO means it never answered — a refused connection, a DNS failure or a timeout — which is why a zero here is not a 200.
HttpStatus *int64 `json:"httpStatus,omitempty"`
// Status is \"ok\" when the subscriber accepted it, \"retrying\" while a further attempt will follow, and \"failed\" when none will. Exactly one row of a delivery is terminal.
Status *string `json:"status,omitempty"`
// Subject is the event that was delivered (\"commerce.order.created\"). A manual test send carries \"webhook.test\".
Subject *string `json:"subject,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WebhookDeliveryRow WebhookDeliveryRow
// NewWebhookDeliveryRow instantiates a new WebhookDeliveryRow 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 NewWebhookDeliveryRow() *WebhookDeliveryRow {
this := WebhookDeliveryRow{}
return &this
}
// NewWebhookDeliveryRowWithDefaults instantiates a new WebhookDeliveryRow 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 NewWebhookDeliveryRowWithDefaults() *WebhookDeliveryRow {
this := WebhookDeliveryRow{}
return &this
}
// GetAttempt returns the Attempt field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetAttempt() int64 {
if o == nil || IsNil(o.Attempt) {
var ret int64
return ret
}
return *o.Attempt
}
// GetAttemptOk returns a tuple with the Attempt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetAttemptOk() (*int64, bool) {
if o == nil || IsNil(o.Attempt) {
return nil, false
}
return o.Attempt, true
}
// HasAttempt returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasAttempt() bool {
if o != nil && !IsNil(o.Attempt) {
return true
}
return false
}
// SetAttempt gets a reference to the given int64 and assigns it to the Attempt field.
func (o *WebhookDeliveryRow) SetAttempt(v int64) {
o.Attempt = &v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetCreated() string {
if o == nil || IsNil(o.Created) {
var ret string
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetCreatedOk() (*string, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given string and assigns it to the Created field.
func (o *WebhookDeliveryRow) SetCreated(v string) {
o.Created = &v
}
// GetDelivery returns the Delivery field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetDelivery() string {
if o == nil || IsNil(o.Delivery) {
var ret string
return ret
}
return *o.Delivery
}
// GetDeliveryOk returns a tuple with the Delivery field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetDeliveryOk() (*string, bool) {
if o == nil || IsNil(o.Delivery) {
return nil, false
}
return o.Delivery, true
}
// HasDelivery returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasDelivery() bool {
if o != nil && !IsNil(o.Delivery) {
return true
}
return false
}
// SetDelivery gets a reference to the given string and assigns it to the Delivery field.
func (o *WebhookDeliveryRow) SetDelivery(v string) {
o.Delivery = &v
}
// GetDurationMs returns the DurationMs field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetDurationMs() int64 {
if o == nil || IsNil(o.DurationMs) {
var ret int64
return ret
}
return *o.DurationMs
}
// GetDurationMsOk returns a tuple with the DurationMs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetDurationMsOk() (*int64, bool) {
if o == nil || IsNil(o.DurationMs) {
return nil, false
}
return o.DurationMs, true
}
// HasDurationMs returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasDurationMs() bool {
if o != nil && !IsNil(o.DurationMs) {
return true
}
return false
}
// SetDurationMs gets a reference to the given int64 and assigns it to the DurationMs field.
func (o *WebhookDeliveryRow) SetDurationMs(v int64) {
o.DurationMs = &v
}
// GetEndpoint returns the Endpoint field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetEndpoint() string {
if o == nil || IsNil(o.Endpoint) {
var ret string
return ret
}
return *o.Endpoint
}
// GetEndpointOk returns a tuple with the Endpoint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetEndpointOk() (*string, bool) {
if o == nil || IsNil(o.Endpoint) {
return nil, false
}
return o.Endpoint, true
}
// HasEndpoint returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasEndpoint() bool {
if o != nil && !IsNil(o.Endpoint) {
return true
}
return false
}
// SetEndpoint gets a reference to the given string and assigns it to the Endpoint field.
func (o *WebhookDeliveryRow) SetEndpoint(v string) {
o.Endpoint = &v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *WebhookDeliveryRow) SetError(v string) {
o.Error = &v
}
// GetHttpStatus returns the HttpStatus field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetHttpStatus() int64 {
if o == nil || IsNil(o.HttpStatus) {
var ret int64
return ret
}
return *o.HttpStatus
}
// GetHttpStatusOk returns a tuple with the HttpStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetHttpStatusOk() (*int64, bool) {
if o == nil || IsNil(o.HttpStatus) {
return nil, false
}
return o.HttpStatus, true
}
// HasHttpStatus returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasHttpStatus() bool {
if o != nil && !IsNil(o.HttpStatus) {
return true
}
return false
}
// SetHttpStatus gets a reference to the given int64 and assigns it to the HttpStatus field.
func (o *WebhookDeliveryRow) SetHttpStatus(v int64) {
o.HttpStatus = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) 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 *WebhookDeliveryRow) 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 *WebhookDeliveryRow) 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 *WebhookDeliveryRow) SetStatus(v string) {
o.Status = &v
}
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *WebhookDeliveryRow) GetSubject() string {
if o == nil || IsNil(o.Subject) {
var ret string
return ret
}
return *o.Subject
}
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookDeliveryRow) GetSubjectOk() (*string, bool) {
if o == nil || IsNil(o.Subject) {
return nil, false
}
return o.Subject, true
}
// HasSubject returns a boolean if a field has been set.
func (o *WebhookDeliveryRow) HasSubject() bool {
if o != nil && !IsNil(o.Subject) {
return true
}
return false
}
// SetSubject gets a reference to the given string and assigns it to the Subject field.
func (o *WebhookDeliveryRow) SetSubject(v string) {
o.Subject = &v
}
func (o WebhookDeliveryRow) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebhookDeliveryRow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Attempt) {
toSerialize["attempt"] = o.Attempt
}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Delivery) {
toSerialize["delivery"] = o.Delivery
}
if !IsNil(o.DurationMs) {
toSerialize["durationMs"] = o.DurationMs
}
if !IsNil(o.Endpoint) {
toSerialize["endpoint"] = o.Endpoint
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.HttpStatus) {
toSerialize["httpStatus"] = o.HttpStatus
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Subject) {
toSerialize["subject"] = o.Subject
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WebhookDeliveryRow) UnmarshalJSON(data []byte) (err error) {
varWebhookDeliveryRow := _WebhookDeliveryRow{}
err = json.Unmarshal(data, &varWebhookDeliveryRow)
if err != nil {
return err
}
*o = WebhookDeliveryRow(varWebhookDeliveryRow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "attempt")
delete(additionalProperties, "created")
delete(additionalProperties, "delivery")
delete(additionalProperties, "durationMs")
delete(additionalProperties, "endpoint")
delete(additionalProperties, "error")
delete(additionalProperties, "httpStatus")
delete(additionalProperties, "status")
delete(additionalProperties, "subject")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWebhookDeliveryRow struct {
value *WebhookDeliveryRow
isSet bool
}
func (v NullableWebhookDeliveryRow) Get() *WebhookDeliveryRow {
return v.value
}
func (v *NullableWebhookDeliveryRow) Set(val *WebhookDeliveryRow) {
v.value = val
v.isSet = true
}
func (v NullableWebhookDeliveryRow) IsSet() bool {
return v.isSet
}
func (v *NullableWebhookDeliveryRow) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebhookDeliveryRow(val *WebhookDeliveryRow) *NullableWebhookDeliveryRow {
return &NullableWebhookDeliveryRow{value: val, isSet: true}
}
func (v NullableWebhookDeliveryRow) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebhookDeliveryRow) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}