// 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"
)

// APIDevice api device
//
// swagger:model apiDevice
type APIDevice struct {

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

	// Description.
	Description string `json:"description,omitempty"`

	// DevEUI (EUI64).
	DevEui string `json:"devEui,omitempty"`

	// Device-profile ID (UUID).
	DeviceProfileID string `json:"deviceProfileId,omitempty"`

	// Device is disabled.
	IsDisabled bool `json:"isDisabled,omitempty"`

	// JoinEUI (optional, EUI64).
	// This field will be automatically set / updated on OTAA. However, in some
	// cases it must be pre-configured. For example to allow OTAA using a Relay.
	// In this case the Relay needs to know the JoinEUI + DevEUI combinations
	// of the devices for which it needs to forward uplinks.
	JoinEui string `json:"joinEui,omitempty"`

	// Name.
	Name string `json:"name,omitempty"`

	// Skip frame-counter checks (this is insecure, but could be helpful for
	// debugging).
	SkipFcntCheck bool `json:"skipFcntCheck,omitempty"`

	// Tags (user defined).
	// These tags can be used to add additional information to the device.
	// These tags are exposed in all the integration events.
	Tags map[string]string `json:"tags,omitempty"`

	// Variables (user defined).
	// These variables can be used together with integrations to store tokens /
	// secrets that must be configured per device. These variables are not
	// exposed in the event payloads.
	Variables map[string]string `json:"variables,omitempty"`
}

// Validate validates this api device
func (m *APIDevice) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

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