/* Hindsight HTTP API HTTP API for Hindsight API version: 0.5.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package hindsight import ( "encoding/json" ) // checks if the WebhookHttpConfig type satisfies the MappedNullable interface at compile time var _ MappedNullable = &WebhookHttpConfig{} // WebhookHttpConfig HTTP delivery configuration for a webhook. type WebhookHttpConfig struct { // HTTP method: GET or POST Method *string `json:"method,omitempty"` // HTTP request timeout in seconds TimeoutSeconds *int32 `json:"timeout_seconds,omitempty"` // Custom HTTP headers Headers map[string]string `json:"headers,omitempty"` // Custom HTTP query parameters Params map[string]string `json:"params,omitempty"` } // NewWebhookHttpConfig instantiates a new WebhookHttpConfig 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 NewWebhookHttpConfig() *WebhookHttpConfig { this := WebhookHttpConfig{} var method string = "POST" this.Method = &method var timeoutSeconds int32 = 30 this.TimeoutSeconds = &timeoutSeconds return &this } // NewWebhookHttpConfigWithDefaults instantiates a new WebhookHttpConfig 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 NewWebhookHttpConfigWithDefaults() *WebhookHttpConfig { this := WebhookHttpConfig{} var method string = "POST" this.Method = &method var timeoutSeconds int32 = 30 this.TimeoutSeconds = &timeoutSeconds return &this } // GetMethod returns the Method field value if set, zero value otherwise. func (o *WebhookHttpConfig) GetMethod() string { if o == nil || IsNil(o.Method) { var ret string return ret } return *o.Method } // GetMethodOk returns a tuple with the Method field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *WebhookHttpConfig) GetMethodOk() (*string, bool) { if o == nil || IsNil(o.Method) { return nil, false } return o.Method, true } // HasMethod returns a boolean if a field has been set. func (o *WebhookHttpConfig) HasMethod() bool { if o != nil && !IsNil(o.Method) { return true } return false } // SetMethod gets a reference to the given string and assigns it to the Method field. func (o *WebhookHttpConfig) SetMethod(v string) { o.Method = &v } // GetTimeoutSeconds returns the TimeoutSeconds field value if set, zero value otherwise. func (o *WebhookHttpConfig) GetTimeoutSeconds() int32 { if o == nil || IsNil(o.TimeoutSeconds) { var ret int32 return ret } return *o.TimeoutSeconds } // GetTimeoutSecondsOk returns a tuple with the TimeoutSeconds field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *WebhookHttpConfig) GetTimeoutSecondsOk() (*int32, bool) { if o == nil || IsNil(o.TimeoutSeconds) { return nil, false } return o.TimeoutSeconds, true } // HasTimeoutSeconds returns a boolean if a field has been set. func (o *WebhookHttpConfig) HasTimeoutSeconds() bool { if o != nil && !IsNil(o.TimeoutSeconds) { return true } return false } // SetTimeoutSeconds gets a reference to the given int32 and assigns it to the TimeoutSeconds field. func (o *WebhookHttpConfig) SetTimeoutSeconds(v int32) { o.TimeoutSeconds = &v } // GetHeaders returns the Headers field value if set, zero value otherwise. func (o *WebhookHttpConfig) GetHeaders() map[string]string { if o == nil || IsNil(o.Headers) { var ret map[string]string return ret } return o.Headers } // GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *WebhookHttpConfig) GetHeadersOk() (map[string]string, bool) { if o == nil || IsNil(o.Headers) { return map[string]string{}, false } return o.Headers, true } // HasHeaders returns a boolean if a field has been set. func (o *WebhookHttpConfig) HasHeaders() bool { if o != nil && !IsNil(o.Headers) { return true } return false } // SetHeaders gets a reference to the given map[string]string and assigns it to the Headers field. func (o *WebhookHttpConfig) SetHeaders(v map[string]string) { o.Headers = v } // GetParams returns the Params field value if set, zero value otherwise. func (o *WebhookHttpConfig) GetParams() map[string]string { if o == nil || IsNil(o.Params) { var ret map[string]string return ret } return o.Params } // GetParamsOk returns a tuple with the Params field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *WebhookHttpConfig) GetParamsOk() (map[string]string, bool) { if o == nil || IsNil(o.Params) { return map[string]string{}, false } return o.Params, true } // HasParams returns a boolean if a field has been set. func (o *WebhookHttpConfig) HasParams() bool { if o != nil && !IsNil(o.Params) { return true } return false } // SetParams gets a reference to the given map[string]string and assigns it to the Params field. func (o *WebhookHttpConfig) SetParams(v map[string]string) { o.Params = v } func (o WebhookHttpConfig) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o WebhookHttpConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Method) { toSerialize["method"] = o.Method } if !IsNil(o.TimeoutSeconds) { toSerialize["timeout_seconds"] = o.TimeoutSeconds } if !IsNil(o.Headers) { toSerialize["headers"] = o.Headers } if !IsNil(o.Params) { toSerialize["params"] = o.Params } return toSerialize, nil } type NullableWebhookHttpConfig struct { value *WebhookHttpConfig isSet bool } func (v NullableWebhookHttpConfig) Get() *WebhookHttpConfig { return v.value } func (v *NullableWebhookHttpConfig) Set(val *WebhookHttpConfig) { v.value = val v.isSet = true } func (v NullableWebhookHttpConfig) IsSet() bool { return v.isSet } func (v *NullableWebhookHttpConfig) Unset() { v.value = nil v.isSet = false } func NewNullableWebhookHttpConfig(val *WebhookHttpConfig) *NullableWebhookHttpConfig { return &NullableWebhookHttpConfig{value: val, isSet: true} } func (v NullableWebhookHttpConfig) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableWebhookHttpConfig) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }