/*
Management API

API version: 3
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package management

import (
	"encoding/json"

	"github.com/adyen/adyen-go-api-library/v21/src/common"
)

// checks if the ScheduleTerminalActionsRequest type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &ScheduleTerminalActionsRequest{}

// ScheduleTerminalActionsRequest struct for ScheduleTerminalActionsRequest
type ScheduleTerminalActionsRequest struct {
	ActionDetails *ScheduleTerminalActionsRequestActionDetails `json:"actionDetails,omitempty"`
	// The date and time when the action should happen.  Format: [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339), but without the **Z** before the time offset. For example, **2021-11-15T12:16:21+0100**  The action is sent with the first [maintenance call](https://docs.adyen.com/point-of-sale/automating-terminal-management/terminal-actions-api#when-actions-take-effect) after the specified date and time in the time zone of the terminal.  An empty value causes the action to be sent as soon as possible: at the next maintenance call.
	ScheduledAt *string `json:"scheduledAt,omitempty"`
	// The unique ID of the [store](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/stores). If present, all terminals in the `terminalIds` list must be assigned to this store.
	StoreId *string `json:"storeId,omitempty"`
	// A list of unique IDs of the terminals to apply the action to. You can extract the IDs from the [GET `/terminals`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/terminals) response. Maximum length: 100 IDs.
	TerminalIds []string `json:"terminalIds,omitempty"`
}

// NewScheduleTerminalActionsRequest instantiates a new ScheduleTerminalActionsRequest 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 NewScheduleTerminalActionsRequest() *ScheduleTerminalActionsRequest {
	this := ScheduleTerminalActionsRequest{}
	return &this
}

// NewScheduleTerminalActionsRequestWithDefaults instantiates a new ScheduleTerminalActionsRequest 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 NewScheduleTerminalActionsRequestWithDefaults() *ScheduleTerminalActionsRequest {
	this := ScheduleTerminalActionsRequest{}
	return &this
}

// GetActionDetails returns the ActionDetails field value if set, zero value otherwise.
func (o *ScheduleTerminalActionsRequest) GetActionDetails() ScheduleTerminalActionsRequestActionDetails {
	if o == nil || common.IsNil(o.ActionDetails) {
		var ret ScheduleTerminalActionsRequestActionDetails
		return ret
	}
	return *o.ActionDetails
}

// GetActionDetailsOk returns a tuple with the ActionDetails field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScheduleTerminalActionsRequest) GetActionDetailsOk() (*ScheduleTerminalActionsRequestActionDetails, bool) {
	if o == nil || common.IsNil(o.ActionDetails) {
		return nil, false
	}
	return o.ActionDetails, true
}

// HasActionDetails returns a boolean if a field has been set.
func (o *ScheduleTerminalActionsRequest) HasActionDetails() bool {
	if o != nil && !common.IsNil(o.ActionDetails) {
		return true
	}

	return false
}

// SetActionDetails gets a reference to the given ScheduleTerminalActionsRequestActionDetails and assigns it to the ActionDetails field.
func (o *ScheduleTerminalActionsRequest) SetActionDetails(v ScheduleTerminalActionsRequestActionDetails) {
	o.ActionDetails = &v
}

// GetScheduledAt returns the ScheduledAt field value if set, zero value otherwise.
func (o *ScheduleTerminalActionsRequest) GetScheduledAt() string {
	if o == nil || common.IsNil(o.ScheduledAt) {
		var ret string
		return ret
	}
	return *o.ScheduledAt
}

// GetScheduledAtOk returns a tuple with the ScheduledAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScheduleTerminalActionsRequest) GetScheduledAtOk() (*string, bool) {
	if o == nil || common.IsNil(o.ScheduledAt) {
		return nil, false
	}
	return o.ScheduledAt, true
}

// HasScheduledAt returns a boolean if a field has been set.
func (o *ScheduleTerminalActionsRequest) HasScheduledAt() bool {
	if o != nil && !common.IsNil(o.ScheduledAt) {
		return true
	}

	return false
}

// SetScheduledAt gets a reference to the given string and assigns it to the ScheduledAt field.
func (o *ScheduleTerminalActionsRequest) SetScheduledAt(v string) {
	o.ScheduledAt = &v
}

// GetStoreId returns the StoreId field value if set, zero value otherwise.
func (o *ScheduleTerminalActionsRequest) GetStoreId() string {
	if o == nil || common.IsNil(o.StoreId) {
		var ret string
		return ret
	}
	return *o.StoreId
}

// GetStoreIdOk returns a tuple with the StoreId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScheduleTerminalActionsRequest) GetStoreIdOk() (*string, bool) {
	if o == nil || common.IsNil(o.StoreId) {
		return nil, false
	}
	return o.StoreId, true
}

// HasStoreId returns a boolean if a field has been set.
func (o *ScheduleTerminalActionsRequest) HasStoreId() bool {
	if o != nil && !common.IsNil(o.StoreId) {
		return true
	}

	return false
}

// SetStoreId gets a reference to the given string and assigns it to the StoreId field.
func (o *ScheduleTerminalActionsRequest) SetStoreId(v string) {
	o.StoreId = &v
}

// GetTerminalIds returns the TerminalIds field value if set, zero value otherwise.
func (o *ScheduleTerminalActionsRequest) GetTerminalIds() []string {
	if o == nil || common.IsNil(o.TerminalIds) {
		var ret []string
		return ret
	}
	return o.TerminalIds
}

// GetTerminalIdsOk returns a tuple with the TerminalIds field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ScheduleTerminalActionsRequest) GetTerminalIdsOk() ([]string, bool) {
	if o == nil || common.IsNil(o.TerminalIds) {
		return nil, false
	}
	return o.TerminalIds, true
}

// HasTerminalIds returns a boolean if a field has been set.
func (o *ScheduleTerminalActionsRequest) HasTerminalIds() bool {
	if o != nil && !common.IsNil(o.TerminalIds) {
		return true
	}

	return false
}

// SetTerminalIds gets a reference to the given []string and assigns it to the TerminalIds field.
func (o *ScheduleTerminalActionsRequest) SetTerminalIds(v []string) {
	o.TerminalIds = v
}

func (o ScheduleTerminalActionsRequest) MarshalJSON() ([]byte, error) {
	toSerialize, err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o ScheduleTerminalActionsRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.ActionDetails) {
		toSerialize["actionDetails"] = o.ActionDetails
	}
	if !common.IsNil(o.ScheduledAt) {
		toSerialize["scheduledAt"] = o.ScheduledAt
	}
	if !common.IsNil(o.StoreId) {
		toSerialize["storeId"] = o.StoreId
	}
	if !common.IsNil(o.TerminalIds) {
		toSerialize["terminalIds"] = o.TerminalIds
	}
	return toSerialize, nil
}

type NullableScheduleTerminalActionsRequest struct {
	value *ScheduleTerminalActionsRequest
	isSet bool
}

func (v NullableScheduleTerminalActionsRequest) Get() *ScheduleTerminalActionsRequest {
	return v.value
}

func (v *NullableScheduleTerminalActionsRequest) Set(val *ScheduleTerminalActionsRequest) {
	v.value = val
	v.isSet = true
}

func (v NullableScheduleTerminalActionsRequest) IsSet() bool {
	return v.isSet
}

func (v *NullableScheduleTerminalActionsRequest) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableScheduleTerminalActionsRequest(val *ScheduleTerminalActionsRequest) *NullableScheduleTerminalActionsRequest {
	return &NullableScheduleTerminalActionsRequest{value: val, isSet: true}
}

func (v NullableScheduleTerminalActionsRequest) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableScheduleTerminalActionsRequest) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}
