// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"

	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)

// APIIftttIntegration api ifttt integration
//
// swagger:model apiIftttIntegration
type APIIftttIntegration struct {

	// Application ID (UUID).
	ApplicationID string `json:"applicationId,omitempty"`

	// Arbitrary JSON.
	// If set to true, ChirpStack events will be sent as-is as arbitrary JSON
	// payload. If set to false (default), the 3 JSON values format will be used.
	ArbitraryJSON bool `json:"arbitraryJson,omitempty"`

	// Event prefix.
	// If set, the event name will be PREFIX_EVENT. For example if event_prefix
	// is set to weatherstation, and uplink event will be sent as
	// weatherstation_up to the IFTTT listener.
	// Note: Only characters in the A-Z, a-z and 0-9 range are allowed.
	EventPrefix string `json:"eventPrefix,omitempty"`

	// Key.
	// This key can be obtained from the IFTTT Webhooks documentation page.
	Key string `json:"key,omitempty"`

	// Values.
	// Up to 2 values can be forwarded to IFTTT. These values must map to the
	// decoded payload keys. For example:
	// {
	//   "batteryLevel": 75.3,
	//   "buttons": [{"pressed": false}, {"pressed": true}]
	// }
	// You would specify the following fields:
	// uplink_values = ["batteryLevel", "buttons_0_pressed"]
	UplinkValues []string `json:"uplinkValues"`
}

// Validate validates this api ifttt integration
func (m *APIIftttIntegration) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this api ifttt integration based on context it is used
func (m *APIIftttIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (m *APIIftttIntegration) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *APIIftttIntegration) UnmarshalBinary(b []byte) error {
	var res APIIftttIntegration
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
