Files
sdk/model_webhook_test_result.go

269 lines
7.3 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 WebhookTestResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebhookTestResult{}
// WebhookTestResult struct for WebhookTestResult
type WebhookTestResult struct {
// Delivered is whether the subscriber accepted the test POST. It is the whole answer: the send is synchronous and is not retried.
Delivered *bool `json:"delivered,omitempty"`
// DurationMs is how long the single attempt took, in MILLISECONDS.
DurationMs *int64 `json:"durationMs,omitempty"`
// Error says what stopped it. Empty when delivered.
Error *string `json:"error,omitempty"`
// HTTPStatus is what the subscriber answered, or 0 if it never answered.
HttpStatus *int64 `json:"httpStatus,omitempty"`
AdditionalProperties map[string]interface{}
}
type _WebhookTestResult WebhookTestResult
// NewWebhookTestResult instantiates a new WebhookTestResult 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 NewWebhookTestResult() *WebhookTestResult {
this := WebhookTestResult{}
return &this
}
// NewWebhookTestResultWithDefaults instantiates a new WebhookTestResult 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 NewWebhookTestResultWithDefaults() *WebhookTestResult {
this := WebhookTestResult{}
return &this
}
// GetDelivered returns the Delivered field value if set, zero value otherwise.
func (o *WebhookTestResult) GetDelivered() bool {
if o == nil || IsNil(o.Delivered) {
var ret bool
return ret
}
return *o.Delivered
}
// GetDeliveredOk returns a tuple with the Delivered field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WebhookTestResult) GetDeliveredOk() (*bool, bool) {
if o == nil || IsNil(o.Delivered) {
return nil, false
}
return o.Delivered, true
}
// HasDelivered returns a boolean if a field has been set.
func (o *WebhookTestResult) HasDelivered() bool {
if o != nil && !IsNil(o.Delivered) {
return true
}
return false
}
// SetDelivered gets a reference to the given bool and assigns it to the Delivered field.
func (o *WebhookTestResult) SetDelivered(v bool) {
o.Delivered = &v
}
// GetDurationMs returns the DurationMs field value if set, zero value otherwise.
func (o *WebhookTestResult) 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 *WebhookTestResult) 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 *WebhookTestResult) 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 *WebhookTestResult) SetDurationMs(v int64) {
o.DurationMs = &v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *WebhookTestResult) 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 *WebhookTestResult) 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 *WebhookTestResult) 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 *WebhookTestResult) SetError(v string) {
o.Error = &v
}
// GetHttpStatus returns the HttpStatus field value if set, zero value otherwise.
func (o *WebhookTestResult) 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 *WebhookTestResult) 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 *WebhookTestResult) 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 *WebhookTestResult) SetHttpStatus(v int64) {
o.HttpStatus = &v
}
func (o WebhookTestResult) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebhookTestResult) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Delivered) {
toSerialize["delivered"] = o.Delivered
}
if !IsNil(o.DurationMs) {
toSerialize["durationMs"] = o.DurationMs
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.HttpStatus) {
toSerialize["httpStatus"] = o.HttpStatus
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WebhookTestResult) UnmarshalJSON(data []byte) (err error) {
varWebhookTestResult := _WebhookTestResult{}
err = json.Unmarshal(data, &varWebhookTestResult)
if err != nil {
return err
}
*o = WebhookTestResult(varWebhookTestResult)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "delivered")
delete(additionalProperties, "durationMs")
delete(additionalProperties, "error")
delete(additionalProperties, "httpStatus")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWebhookTestResult struct {
value *WebhookTestResult
isSet bool
}
func (v NullableWebhookTestResult) Get() *WebhookTestResult {
return v.value
}
func (v *NullableWebhookTestResult) Set(val *WebhookTestResult) {
v.value = val
v.isSet = true
}
func (v NullableWebhookTestResult) IsSet() bool {
return v.isSet
}
func (v *NullableWebhookTestResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebhookTestResult(val *WebhookTestResult) *NullableWebhookTestResult {
return &NullableWebhookTestResult{value: val, isSet: true}
}
func (v NullableWebhookTestResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebhookTestResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}