model_action_pager_duty_destination.go•4.7 kB
/*
Metoro API
API for managing Metoro environments, alerts, and dashboards.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package model
import (
"encoding/json"
)
// checks if the ActionPagerDutyDestination type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ActionPagerDutyDestination{}
// ActionPagerDutyDestination struct for ActionPagerDutyDestination
type ActionPagerDutyDestination struct {
// PagerDuty service ID
ServiceId *string `json:"serviceId,omitempty"`
// PagerDuty service name
ServiceName *string `json:"serviceName,omitempty"`
}
// NewActionPagerDutyDestination instantiates a new ActionPagerDutyDestination 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 NewActionPagerDutyDestination() *ActionPagerDutyDestination {
this := ActionPagerDutyDestination{}
return &this
}
// NewActionPagerDutyDestinationWithDefaults instantiates a new ActionPagerDutyDestination 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 NewActionPagerDutyDestinationWithDefaults() *ActionPagerDutyDestination {
this := ActionPagerDutyDestination{}
return &this
}
// GetServiceId returns the ServiceId field value if set, zero value otherwise.
func (o *ActionPagerDutyDestination) GetServiceId() string {
if o == nil || IsNil(o.ServiceId) {
var ret string
return ret
}
return *o.ServiceId
}
// GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ActionPagerDutyDestination) GetServiceIdOk() (*string, bool) {
if o == nil || IsNil(o.ServiceId) {
return nil, false
}
return o.ServiceId, true
}
// HasServiceId returns a boolean if a field has been set.
func (o *ActionPagerDutyDestination) HasServiceId() bool {
if o != nil && !IsNil(o.ServiceId) {
return true
}
return false
}
// SetServiceId gets a reference to the given string and assigns it to the ServiceId field.
func (o *ActionPagerDutyDestination) SetServiceId(v string) {
o.ServiceId = &v
}
// GetServiceName returns the ServiceName field value if set, zero value otherwise.
func (o *ActionPagerDutyDestination) GetServiceName() string {
if o == nil || IsNil(o.ServiceName) {
var ret string
return ret
}
return *o.ServiceName
}
// GetServiceNameOk returns a tuple with the ServiceName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ActionPagerDutyDestination) GetServiceNameOk() (*string, bool) {
if o == nil || IsNil(o.ServiceName) {
return nil, false
}
return o.ServiceName, true
}
// HasServiceName returns a boolean if a field has been set.
func (o *ActionPagerDutyDestination) HasServiceName() bool {
if o != nil && !IsNil(o.ServiceName) {
return true
}
return false
}
// SetServiceName gets a reference to the given string and assigns it to the ServiceName field.
func (o *ActionPagerDutyDestination) SetServiceName(v string) {
o.ServiceName = &v
}
func (o ActionPagerDutyDestination) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ActionPagerDutyDestination) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ServiceId) {
toSerialize["serviceId"] = o.ServiceId
}
if !IsNil(o.ServiceName) {
toSerialize["serviceName"] = o.ServiceName
}
return toSerialize, nil
}
type NullableActionPagerDutyDestination struct {
value *ActionPagerDutyDestination
isSet bool
}
func (v NullableActionPagerDutyDestination) Get() *ActionPagerDutyDestination {
return v.value
}
func (v *NullableActionPagerDutyDestination) Set(val *ActionPagerDutyDestination) {
v.value = val
v.isSet = true
}
func (v NullableActionPagerDutyDestination) IsSet() bool {
return v.isSet
}
func (v *NullableActionPagerDutyDestination) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableActionPagerDutyDestination(val *ActionPagerDutyDestination) *NullableActionPagerDutyDestination {
return &NullableActionPagerDutyDestination{value: val, isSet: true}
}
func (v NullableActionPagerDutyDestination) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableActionPagerDutyDestination) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}