移动代码位置

This commit is contained in:
2025-09-15 18:02:10 +08:00
parent d42ca300d3
commit 3876162f1d
376 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
// 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"
)
// APIAdrAlgorithmListItem api adr algorithm list item
//
// swagger:model apiAdrAlgorithmListItem
type APIAdrAlgorithmListItem struct {
// Algorithm ID.
ID string `json:"id,omitempty"`
// Algorithm name.
Name string `json:"name,omitempty"`
}
// Validate validates this api adr algorithm list item
func (m *APIAdrAlgorithmListItem) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api adr algorithm list item based on context it is used
func (m *APIAdrAlgorithmListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIAdrAlgorithmListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIAdrAlgorithmListItem) UnmarshalBinary(b []byte) error {
var res APIAdrAlgorithmListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,220 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIAppLayerParams api app layer params
//
// swagger:model apiAppLayerParams
type APIAppLayerParams struct {
// TS003 fPort.
Ts003FPort int64 `json:"ts003FPort,omitempty"`
// TS003 version (Application Layer Clock Sync).
Ts003Version *APITs003Version `json:"ts003Version,omitempty"`
// TS004 fPort.
Ts004FPort int64 `json:"ts004FPort,omitempty"`
// TS004 version (Fragmented Data Block Transport).
Ts004Version *APITs004Version `json:"ts004Version,omitempty"`
// TS005 fPort.
Ts005FPort int64 `json:"ts005FPort,omitempty"`
// TS005 version (Remote Multicast Setup).
Ts005Version *APITs005Version `json:"ts005Version,omitempty"`
}
// Validate validates this api app layer params
func (m *APIAppLayerParams) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateTs003Version(formats); err != nil {
res = append(res, err)
}
if err := m.validateTs004Version(formats); err != nil {
res = append(res, err)
}
if err := m.validateTs005Version(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIAppLayerParams) validateTs003Version(formats strfmt.Registry) error {
if swag.IsZero(m.Ts003Version) { // not required
return nil
}
if m.Ts003Version != nil {
if err := m.Ts003Version.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ts003Version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ts003Version")
}
return err
}
}
return nil
}
func (m *APIAppLayerParams) validateTs004Version(formats strfmt.Registry) error {
if swag.IsZero(m.Ts004Version) { // not required
return nil
}
if m.Ts004Version != nil {
if err := m.Ts004Version.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ts004Version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ts004Version")
}
return err
}
}
return nil
}
func (m *APIAppLayerParams) validateTs005Version(formats strfmt.Registry) error {
if swag.IsZero(m.Ts005Version) { // not required
return nil
}
if m.Ts005Version != nil {
if err := m.Ts005Version.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ts005Version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ts005Version")
}
return err
}
}
return nil
}
// ContextValidate validate this api app layer params based on the context it is used
func (m *APIAppLayerParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTs003Version(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTs004Version(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTs005Version(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIAppLayerParams) contextValidateTs003Version(ctx context.Context, formats strfmt.Registry) error {
if m.Ts003Version != nil {
if swag.IsZero(m.Ts003Version) { // not required
return nil
}
if err := m.Ts003Version.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ts003Version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ts003Version")
}
return err
}
}
return nil
}
func (m *APIAppLayerParams) contextValidateTs004Version(ctx context.Context, formats strfmt.Registry) error {
if m.Ts004Version != nil {
if swag.IsZero(m.Ts004Version) { // not required
return nil
}
if err := m.Ts004Version.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ts004Version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ts004Version")
}
return err
}
}
return nil
}
func (m *APIAppLayerParams) contextValidateTs005Version(ctx context.Context, formats strfmt.Registry) error {
if m.Ts005Version != nil {
if swag.IsZero(m.Ts005Version) { // not required
return nil
}
if err := m.Ts005Version.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ts005Version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ts005Version")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIAppLayerParams) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIAppLayerParams) UnmarshalBinary(b []byte) error {
var res APIAppLayerParams
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,66 @@
// 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"
)
// APIApplication api application
//
// swagger:model apiApplication
type APIApplication struct {
// Application description.
Description string `json:"description,omitempty"`
// Application ID (UUID).
// Note: on create this will be automatically generated.
ID string `json:"id,omitempty"`
// Application name.
Name string `json:"name,omitempty"`
// Tags (user defined).
// These tags can be used to add additional information to the application.
// These tags are exposed in all the integration events of devices under
// this application.
Tags map[string]string `json:"tags,omitempty"`
// Tenant ID (UUID).
TenantID string `json:"tenantId,omitempty"`
}
// Validate validates this api application
func (m *APIApplication) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api application based on context it is used
func (m *APIApplication) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIApplication) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIApplication) UnmarshalBinary(b []byte) error {
var res APIApplication
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,53 @@
// 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"
)
// APIApplicationDeviceProfileListItem api application device profile list item
//
// swagger:model apiApplicationDeviceProfileListItem
type APIApplicationDeviceProfileListItem struct {
// Device-profile ID (UUID).
ID string `json:"id,omitempty"`
// Name.
Name string `json:"name,omitempty"`
}
// Validate validates this api application device profile list item
func (m *APIApplicationDeviceProfileListItem) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api application device profile list item based on context it is used
func (m *APIApplicationDeviceProfileListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIApplicationDeviceProfileListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIApplicationDeviceProfileListItem) UnmarshalBinary(b []byte) error {
var res APIApplicationDeviceProfileListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,53 @@
// 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"
)
// APIApplicationDeviceTagListItem api application device tag list item
//
// swagger:model apiApplicationDeviceTagListItem
type APIApplicationDeviceTagListItem struct {
// Tag key.
Key string `json:"key,omitempty"`
// Used values.
Values []string `json:"values"`
}
// Validate validates this api application device tag list item
func (m *APIApplicationDeviceTagListItem) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api application device tag list item based on context it is used
func (m *APIApplicationDeviceTagListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIApplicationDeviceTagListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIApplicationDeviceTagListItem) UnmarshalBinary(b []byte) error {
var res APIApplicationDeviceTagListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,103 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIApplicationListItem api application list item
//
// swagger:model apiApplicationListItem
type APIApplicationListItem struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Application description.
Description string `json:"description,omitempty"`
// Application ID (UUID).
ID string `json:"id,omitempty"`
// Application name.
Name string `json:"name,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api application list item
func (m *APIApplicationListItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIApplicationListItem) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIApplicationListItem) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this api application list item based on context it is used
func (m *APIApplicationListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIApplicationListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIApplicationListItem) UnmarshalBinary(b []byte) error {
var res APIApplicationListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIAwsSnsIntegration api aws sns integration
//
// swagger:model apiAwsSnsIntegration
type APIAwsSnsIntegration struct {
// AWS Access Key ID.
AccessKeyID string `json:"accessKeyId,omitempty"`
// Application ID (UUID).
ApplicationID string `json:"applicationId,omitempty"`
// Encoding.
Encoding *APIEncoding `json:"encoding,omitempty"`
// AWS region.
Region string `json:"region,omitempty"`
// AWS Secret Access Key.
SecretAccessKey string `json:"secretAccessKey,omitempty"`
// Topic ARN.
TopicArn string `json:"topicArn,omitempty"`
}
// Validate validates this api aws sns integration
func (m *APIAwsSnsIntegration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEncoding(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIAwsSnsIntegration) validateEncoding(formats strfmt.Registry) error {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if m.Encoding != nil {
if err := m.Encoding.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// ContextValidate validate this api aws sns integration based on the context it is used
func (m *APIAwsSnsIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEncoding(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIAwsSnsIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error {
if m.Encoding != nil {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if err := m.Encoding.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIAwsSnsIntegration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIAwsSnsIntegration) UnmarshalBinary(b []byte) error {
var res APIAwsSnsIntegration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,119 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIAzureServiceBusIntegration api azure service bus integration
//
// swagger:model apiAzureServiceBusIntegration
type APIAzureServiceBusIntegration struct {
// Application ID (UUID).
ApplicationID string `json:"applicationId,omitempty"`
// Connection string.
ConnectionString string `json:"connectionString,omitempty"`
// Encoding.
Encoding *APIEncoding `json:"encoding,omitempty"`
// Publish name.
// This is the name of the topic or queue.
PublishName string `json:"publishName,omitempty"`
}
// Validate validates this api azure service bus integration
func (m *APIAzureServiceBusIntegration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEncoding(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIAzureServiceBusIntegration) validateEncoding(formats strfmt.Registry) error {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if m.Encoding != nil {
if err := m.Encoding.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// ContextValidate validate this api azure service bus integration based on the context it is used
func (m *APIAzureServiceBusIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEncoding(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIAzureServiceBusIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error {
if m.Encoding != nil {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if err := m.Encoding.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIAzureServiceBusIntegration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIAzureServiceBusIntegration) UnmarshalBinary(b []byte) error {
var res APIAzureServiceBusIntegration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,95 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APICadPeriodicity - SEC_1: 1 second.
// - MS_500: 500 milliseconds
// - MS_250: 250 milliseconds
// - MS_100: 100 milliseconds
// - MS_50: 50 milliseconds
// - MS_20: 20 milliseconds
//
// swagger:model apiCadPeriodicity
type APICadPeriodicity string
func NewAPICadPeriodicity(value APICadPeriodicity) *APICadPeriodicity {
return &value
}
// Pointer returns a pointer to a freshly-allocated APICadPeriodicity.
func (m APICadPeriodicity) Pointer() *APICadPeriodicity {
return &m
}
const (
// APICadPeriodicitySEC1 captures enum value "SEC_1"
APICadPeriodicitySEC1 APICadPeriodicity = "SEC_1"
// APICadPeriodicityMS500 captures enum value "MS_500"
APICadPeriodicityMS500 APICadPeriodicity = "MS_500"
// APICadPeriodicityMS250 captures enum value "MS_250"
APICadPeriodicityMS250 APICadPeriodicity = "MS_250"
// APICadPeriodicityMS100 captures enum value "MS_100"
APICadPeriodicityMS100 APICadPeriodicity = "MS_100"
// APICadPeriodicityMS50 captures enum value "MS_50"
APICadPeriodicityMS50 APICadPeriodicity = "MS_50"
// APICadPeriodicityMS20 captures enum value "MS_20"
APICadPeriodicityMS20 APICadPeriodicity = "MS_20"
)
// for schema
var apiCadPeriodicityEnum []interface{}
func init() {
var res []APICadPeriodicity
if err := json.Unmarshal([]byte(`["SEC_1","MS_500","MS_250","MS_100","MS_50","MS_20"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiCadPeriodicityEnum = append(apiCadPeriodicityEnum, v)
}
}
func (m APICadPeriodicity) validateAPICadPeriodicityEnum(path, location string, value APICadPeriodicity) error {
if err := validate.EnumCase(path, location, value, apiCadPeriodicityEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api cad periodicity
func (m APICadPeriodicity) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPICadPeriodicityEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api cad periodicity based on context it is used
func (m APICadPeriodicity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,83 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APICodecRuntime - NONE: None.
// - CAYENNE_LPP: Cayenne LPP.
// - JS: JavaScript.
//
// swagger:model apiCodecRuntime
type APICodecRuntime string
func NewAPICodecRuntime(value APICodecRuntime) *APICodecRuntime {
return &value
}
// Pointer returns a pointer to a freshly-allocated APICodecRuntime.
func (m APICodecRuntime) Pointer() *APICodecRuntime {
return &m
}
const (
// APICodecRuntimeNONE captures enum value "NONE"
APICodecRuntimeNONE APICodecRuntime = "NONE"
// APICodecRuntimeCAYENNELPP captures enum value "CAYENNE_LPP"
APICodecRuntimeCAYENNELPP APICodecRuntime = "CAYENNE_LPP"
// APICodecRuntimeJS captures enum value "JS"
APICodecRuntimeJS APICodecRuntime = "JS"
)
// for schema
var apiCodecRuntimeEnum []interface{}
func init() {
var res []APICodecRuntime
if err := json.Unmarshal([]byte(`["NONE","CAYENNE_LPP","JS"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiCodecRuntimeEnum = append(apiCodecRuntimeEnum, v)
}
}
func (m APICodecRuntime) validateAPICodecRuntimeEnum(path, location string, value APICodecRuntime) error {
if err := validate.EnumCase(path, location, value, apiCodecRuntimeEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api codec runtime
func (m APICodecRuntime) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPICodecRuntimeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api codec runtime based on context it is used
func (m APICodecRuntime) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateApplicationRequest api create application request
//
// swagger:model apiCreateApplicationRequest
type APICreateApplicationRequest struct {
// Application object to create.
Application *APIApplication `json:"application,omitempty"`
}
// Validate validates this api create application request
func (m *APICreateApplicationRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateApplication(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateApplicationRequest) validateApplication(formats strfmt.Registry) error {
if swag.IsZero(m.Application) { // not required
return nil
}
if m.Application != nil {
if err := m.Application.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("application")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("application")
}
return err
}
}
return nil
}
// ContextValidate validate this api create application request based on the context it is used
func (m *APICreateApplicationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateApplication(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateApplicationRequest) contextValidateApplication(ctx context.Context, formats strfmt.Registry) error {
if m.Application != nil {
if swag.IsZero(m.Application) { // not required
return nil
}
if err := m.Application.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("application")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("application")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateApplicationRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateApplicationRequest) UnmarshalBinary(b []byte) error {
var res APICreateApplicationRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APICreateApplicationResponse api create application response
//
// swagger:model apiCreateApplicationResponse
type APICreateApplicationResponse struct {
// Application ID (UUID).
ID string `json:"id,omitempty"`
}
// Validate validates this api create application response
func (m *APICreateApplicationResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api create application response based on context it is used
func (m *APICreateApplicationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APICreateApplicationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateApplicationResponse) UnmarshalBinary(b []byte) error {
var res APICreateApplicationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateDeviceProfileRequest api create device profile request
//
// swagger:model apiCreateDeviceProfileRequest
type APICreateDeviceProfileRequest struct {
// Object to create.
DeviceProfile *APIDeviceProfile `json:"deviceProfile,omitempty"`
}
// Validate validates this api create device profile request
func (m *APICreateDeviceProfileRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDeviceProfile(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateDeviceProfileRequest) validateDeviceProfile(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceProfile) { // not required
return nil
}
if m.DeviceProfile != nil {
if err := m.DeviceProfile.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfile")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfile")
}
return err
}
}
return nil
}
// ContextValidate validate this api create device profile request based on the context it is used
func (m *APICreateDeviceProfileRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDeviceProfile(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateDeviceProfileRequest) contextValidateDeviceProfile(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceProfile != nil {
if swag.IsZero(m.DeviceProfile) { // not required
return nil
}
if err := m.DeviceProfile.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfile")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfile")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateDeviceProfileRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateDeviceProfileRequest) UnmarshalBinary(b []byte) error {
var res APICreateDeviceProfileRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APICreateDeviceProfileResponse api create device profile response
//
// swagger:model apiCreateDeviceProfileResponse
type APICreateDeviceProfileResponse struct {
// ID (UUID).
ID string `json:"id,omitempty"`
}
// Validate validates this api create device profile response
func (m *APICreateDeviceProfileResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api create device profile response based on context it is used
func (m *APICreateDeviceProfileResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APICreateDeviceProfileResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateDeviceProfileResponse) UnmarshalBinary(b []byte) error {
var res APICreateDeviceProfileResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateDeviceProfileTemplateRequest api create device profile template request
//
// swagger:model apiCreateDeviceProfileTemplateRequest
type APICreateDeviceProfileTemplateRequest struct {
// Object to create.
DeviceProfileTemplate *APIDeviceProfileTemplate `json:"deviceProfileTemplate,omitempty"`
}
// Validate validates this api create device profile template request
func (m *APICreateDeviceProfileTemplateRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDeviceProfileTemplate(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateDeviceProfileTemplateRequest) validateDeviceProfileTemplate(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceProfileTemplate) { // not required
return nil
}
if m.DeviceProfileTemplate != nil {
if err := m.DeviceProfileTemplate.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfileTemplate")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfileTemplate")
}
return err
}
}
return nil
}
// ContextValidate validate this api create device profile template request based on the context it is used
func (m *APICreateDeviceProfileTemplateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDeviceProfileTemplate(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateDeviceProfileTemplateRequest) contextValidateDeviceProfileTemplate(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceProfileTemplate != nil {
if swag.IsZero(m.DeviceProfileTemplate) { // not required
return nil
}
if err := m.DeviceProfileTemplate.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfileTemplate")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfileTemplate")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateDeviceProfileTemplateRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateDeviceProfileTemplateRequest) UnmarshalBinary(b []byte) error {
var res APICreateDeviceProfileTemplateRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateDeviceRequest api create device request
//
// swagger:model apiCreateDeviceRequest
type APICreateDeviceRequest struct {
// Device object.
Device *APIDevice `json:"device,omitempty"`
}
// Validate validates this api create device request
func (m *APICreateDeviceRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDevice(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateDeviceRequest) validateDevice(formats strfmt.Registry) error {
if swag.IsZero(m.Device) { // not required
return nil
}
if m.Device != nil {
if err := m.Device.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("device")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("device")
}
return err
}
}
return nil
}
// ContextValidate validate this api create device request based on the context it is used
func (m *APICreateDeviceRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDevice(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateDeviceRequest) contextValidateDevice(ctx context.Context, formats strfmt.Registry) error {
if m.Device != nil {
if swag.IsZero(m.Device) { // not required
return nil
}
if err := m.Device.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("device")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("device")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateDeviceRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateDeviceRequest) UnmarshalBinary(b []byte) error {
var res APICreateDeviceRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateGatewayRequest api create gateway request
//
// swagger:model apiCreateGatewayRequest
type APICreateGatewayRequest struct {
// Gateway object.
Gateway *APIGateway `json:"gateway,omitempty"`
}
// Validate validates this api create gateway request
func (m *APICreateGatewayRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateGateway(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateGatewayRequest) validateGateway(formats strfmt.Registry) error {
if swag.IsZero(m.Gateway) { // not required
return nil
}
if m.Gateway != nil {
if err := m.Gateway.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gateway")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gateway")
}
return err
}
}
return nil
}
// ContextValidate validate this api create gateway request based on the context it is used
func (m *APICreateGatewayRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateGateway(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateGatewayRequest) contextValidateGateway(ctx context.Context, formats strfmt.Registry) error {
if m.Gateway != nil {
if swag.IsZero(m.Gateway) { // not required
return nil
}
if err := m.Gateway.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gateway")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gateway")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateGatewayRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateGatewayRequest) UnmarshalBinary(b []byte) error {
var res APICreateGatewayRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateMulticastGroupRequest api create multicast group request
//
// swagger:model apiCreateMulticastGroupRequest
type APICreateMulticastGroupRequest struct {
// Multicast group to create.
MulticastGroup *APIMulticastGroup `json:"multicastGroup,omitempty"`
}
// Validate validates this api create multicast group request
func (m *APICreateMulticastGroupRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMulticastGroup(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateMulticastGroupRequest) validateMulticastGroup(formats strfmt.Registry) error {
if swag.IsZero(m.MulticastGroup) { // not required
return nil
}
if m.MulticastGroup != nil {
if err := m.MulticastGroup.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("multicastGroup")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("multicastGroup")
}
return err
}
}
return nil
}
// ContextValidate validate this api create multicast group request based on the context it is used
func (m *APICreateMulticastGroupRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMulticastGroup(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateMulticastGroupRequest) contextValidateMulticastGroup(ctx context.Context, formats strfmt.Registry) error {
if m.MulticastGroup != nil {
if swag.IsZero(m.MulticastGroup) { // not required
return nil
}
if err := m.MulticastGroup.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("multicastGroup")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("multicastGroup")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateMulticastGroupRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateMulticastGroupRequest) UnmarshalBinary(b []byte) error {
var res APICreateMulticastGroupRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APICreateMulticastGroupResponse api create multicast group response
//
// swagger:model apiCreateMulticastGroupResponse
type APICreateMulticastGroupResponse struct {
// ID of created multicast group (UUID).
ID string `json:"id,omitempty"`
}
// Validate validates this api create multicast group response
func (m *APICreateMulticastGroupResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api create multicast group response based on context it is used
func (m *APICreateMulticastGroupResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APICreateMulticastGroupResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateMulticastGroupResponse) UnmarshalBinary(b []byte) error {
var res APICreateMulticastGroupResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateTenantRequest api create tenant request
//
// swagger:model apiCreateTenantRequest
type APICreateTenantRequest struct {
// Tenant object to create.
Tenant *APITenant `json:"tenant,omitempty"`
}
// Validate validates this api create tenant request
func (m *APICreateTenantRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateTenant(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateTenantRequest) validateTenant(formats strfmt.Registry) error {
if swag.IsZero(m.Tenant) { // not required
return nil
}
if m.Tenant != nil {
if err := m.Tenant.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenant")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenant")
}
return err
}
}
return nil
}
// ContextValidate validate this api create tenant request based on the context it is used
func (m *APICreateTenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTenant(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateTenantRequest) contextValidateTenant(ctx context.Context, formats strfmt.Registry) error {
if m.Tenant != nil {
if swag.IsZero(m.Tenant) { // not required
return nil
}
if err := m.Tenant.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenant")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenant")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateTenantRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateTenantRequest) UnmarshalBinary(b []byte) error {
var res APICreateTenantRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APICreateTenantResponse api create tenant response
//
// swagger:model apiCreateTenantResponse
type APICreateTenantResponse struct {
// Tenant ID.
ID string `json:"id,omitempty"`
}
// Validate validates this api create tenant response
func (m *APICreateTenantResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api create tenant response based on context it is used
func (m *APICreateTenantResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APICreateTenantResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateTenantResponse) UnmarshalBinary(b []byte) error {
var res APICreateTenantResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,175 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APICreateUserRequest api create user request
//
// swagger:model apiCreateUserRequest
type APICreateUserRequest struct {
// Password to set for the user.
Password string `json:"password,omitempty"`
// Add the user to the following tenants.
Tenants []*APIUserTenant `json:"tenants"`
// User object to create.
User *APIUser `json:"user,omitempty"`
}
// Validate validates this api create user request
func (m *APICreateUserRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateTenants(formats); err != nil {
res = append(res, err)
}
if err := m.validateUser(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateUserRequest) validateTenants(formats strfmt.Registry) error {
if swag.IsZero(m.Tenants) { // not required
return nil
}
for i := 0; i < len(m.Tenants); i++ {
if swag.IsZero(m.Tenants[i]) { // not required
continue
}
if m.Tenants[i] != nil {
if err := m.Tenants[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenants" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenants" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *APICreateUserRequest) validateUser(formats strfmt.Registry) error {
if swag.IsZero(m.User) { // not required
return nil
}
if m.User != nil {
if err := m.User.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("user")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("user")
}
return err
}
}
return nil
}
// ContextValidate validate this api create user request based on the context it is used
func (m *APICreateUserRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTenants(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateUser(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APICreateUserRequest) contextValidateTenants(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Tenants); i++ {
if m.Tenants[i] != nil {
if swag.IsZero(m.Tenants[i]) { // not required
return nil
}
if err := m.Tenants[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenants" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenants" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *APICreateUserRequest) contextValidateUser(ctx context.Context, formats strfmt.Registry) error {
if m.User != nil {
if swag.IsZero(m.User) { // not required
return nil
}
if err := m.User.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("user")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("user")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APICreateUserRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateUserRequest) UnmarshalBinary(b []byte) error {
var res APICreateUserRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APICreateUserResponse api create user response
//
// swagger:model apiCreateUserResponse
type APICreateUserResponse struct {
// User ID.
ID string `json:"id,omitempty"`
}
// Validate validates this api create user response
func (m *APICreateUserResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api create user response based on context it is used
func (m *APICreateUserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APICreateUserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APICreateUserResponse) UnmarshalBinary(b []byte) error {
var res APICreateUserResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,87 @@
// 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
}

View File

@@ -0,0 +1,77 @@
// 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"
)
// APIDeviceActivation api device activation
//
// swagger:model apiDeviceActivation
type APIDeviceActivation struct {
// Downlink application frame-counter.
AFCntDown int64 `json:"aFCntDown,omitempty"`
// Application session key (HEX encoded).
AppSKey string `json:"appSKey,omitempty"`
// Device address (HEX encoded).
DevAddr string `json:"devAddr,omitempty"`
// Device EUI (EUI64).
DevEui string `json:"devEui,omitempty"`
// Uplink frame-counter.
FCntUp int64 `json:"fCntUp,omitempty"`
// Forwarding network session integrity key (HEX encoded).
// Note: For LoRaWAN 1.0.x devices, set this to the NwkSKey.
FNwkSIntKey string `json:"fNwkSIntKey,omitempty"`
// Downlink network frame-counter.
NFCntDown int64 `json:"nFCntDown,omitempty"`
// Network session encryption key (HEX encoded).
// Note: For LoRaWAN 1.0.x devices, set this to the NwkSKey.
NwkSEncKey string `json:"nwkSEncKey,omitempty"`
// Serving network session integrity key (HEX encoded).
// Note: For LoRaWAN 1.0.x devices, set this to the NwkSKey.
SNwkSIntKey string `json:"sNwkSIntKey,omitempty"`
}
// Validate validates this api device activation
func (m *APIDeviceActivation) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api device activation based on context it is used
func (m *APIDeviceActivation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceActivation) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceActivation) UnmarshalBinary(b []byte) error {
var res APIDeviceActivation
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,63 @@
// 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"
)
// APIDeviceKeys api device keys
//
// swagger:model apiDeviceKeys
type APIDeviceKeys struct {
// Application root key (128 bit).
// Note: This field only needs to be set for LoRaWAN 1.1.x devices!
AppKey string `json:"appKey,omitempty"`
// DevEUI (EUI64).
DevEui string `json:"devEui,omitempty"`
// Gen App Key (128 bit).
// Note: This field only needs to be set for LoRaWAN 1.0.x devices that
// implement TS005 (remote multicast setup).
GenAppKey string `json:"genAppKey,omitempty"`
// Network root key (128 bit).
// Note: For LoRaWAN 1.0.x, use this field for the LoRaWAN 1.0.x 'AppKey`!
NwkKey string `json:"nwkKey,omitempty"`
}
// Validate validates this api device keys
func (m *APIDeviceKeys) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api device keys based on context it is used
func (m *APIDeviceKeys) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceKeys) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceKeys) UnmarshalBinary(b []byte) error {
var res APIDeviceKeys
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,188 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIDeviceListItem api device list item
//
// swagger:model apiDeviceListItem
type APIDeviceListItem struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Description.
Description string `json:"description,omitempty"`
// DevEUI (EUI64).
DevEui string `json:"devEui,omitempty"`
// Device-profile ID (UUID).
DeviceProfileID string `json:"deviceProfileId,omitempty"`
// Device-profile name.
DeviceProfileName string `json:"deviceProfileName,omitempty"`
// Device status.
DeviceStatus *APIDeviceStatus `json:"deviceStatus,omitempty"`
// Last seen at timestamp.
// Format: date-time
LastSeenAt strfmt.DateTime `json:"lastSeenAt,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Device tags.
Tags map[string]string `json:"tags,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api device list item
func (m *APIDeviceListItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeviceStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateLastSeenAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceListItem) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIDeviceListItem) validateDeviceStatus(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceStatus) { // not required
return nil
}
if m.DeviceStatus != nil {
if err := m.DeviceStatus.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceStatus")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceStatus")
}
return err
}
}
return nil
}
func (m *APIDeviceListItem) validateLastSeenAt(formats strfmt.Registry) error {
if swag.IsZero(m.LastSeenAt) { // not required
return nil
}
if err := validate.FormatOf("lastSeenAt", "body", "date-time", m.LastSeenAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIDeviceListItem) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api device list item based on the context it is used
func (m *APIDeviceListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDeviceStatus(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceListItem) contextValidateDeviceStatus(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceStatus != nil {
if swag.IsZero(m.DeviceStatus) { // not required
return nil
}
if err := m.DeviceStatus.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceStatus")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceStatus")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceListItem) UnmarshalBinary(b []byte) error {
var res APIDeviceListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,773 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIDeviceProfile api device profile
//
// swagger:model apiDeviceProfile
type APIDeviceProfile struct {
// RX1 delay (for ABP).
AbpRx1Delay int64 `json:"abpRx1Delay,omitempty"`
// RX1 DR offset (for ABP).
AbpRx1DrOffset int64 `json:"abpRx1DrOffset,omitempty"`
// RX2 DR (for ABP).
AbpRx2Dr int64 `json:"abpRx2Dr,omitempty"`
// RX2 frequency (for ABP, Hz).
AbpRx2Freq int64 `json:"abpRx2Freq,omitempty"`
// ADR algorithm ID.
AdrAlgorithmID string `json:"adrAlgorithmId,omitempty"`
// Allow roaming.
//
// If set to true, it means that the device is allowed to use roaming.
AllowRoaming bool `json:"allowRoaming,omitempty"`
// Application Layer parameters.
AppLayerParams *APIAppLayerParams `json:"appLayerParams,omitempty"`
// Auto-detect measurements.
// If set to true, measurements will be automatically added based on the
// keys of the decoded payload. In cases where the decoded payload contains
// random keys in the data, you want to set this to false.
AutoDetectMeasurements bool `json:"autoDetectMeasurements,omitempty"`
// Class-B ping-slot DR.
ClassBPingSlotDr int64 `json:"classBPingSlotDr,omitempty"`
// Class-B ping-slot freq (Hz).
ClassBPingSlotFreq int64 `json:"classBPingSlotFreq,omitempty"`
// Class-B ping-slot periodicity.
// Valid options are: 0 - 7.
//
// Number of ping-slots per beacon-period:
// pingNb = 2^(7-periodicity)
//
// Periodicity: 0 = 128 ping-slots per beacon period = ~ every 1 sec
// Periodicity: 7 = 1 ping-slot per beacon period = ~ every 128 sec
ClassBPingSlotPeriodicity int64 `json:"classBPingSlotPeriodicity,omitempty"`
// Class-B timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement
// from the device (if requested).
ClassBTimeout int64 `json:"classBTimeout,omitempty"`
// Class-C timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement
// from the device (if requested).
ClassCTimeout int64 `json:"classCTimeout,omitempty"`
// Description.
Description string `json:"description,omitempty"`
// Device-status request interval (times / day).
// This defines the times per day that ChirpStack will request the
// device-status from the device.
DeviceStatusReqInterval int64 `json:"deviceStatusReqInterval,omitempty"`
// Flush queue on device activation.
FlushQueueOnActivate bool `json:"flushQueueOnActivate,omitempty"`
// Device-profile ID (UUID).
// Note: on create this will be automatically generated.
ID string `json:"id,omitempty"`
// Device is a Relay device.
// Enable this in case the device is a Relay. A Relay device implements TS011
// and is able to relay data from relay capable devices.
// See for more information the TS011 specification.
IsRelay bool `json:"isRelay,omitempty"`
// Device is a Relay end-device.
// Enable this in case the device is an end-device that can operate under a
// Relay. Please refer to the TS011 specification for more information.
IsRelayEd bool `json:"isRelayEd,omitempty"`
// LoRaWAN mac-version.
MacVersion *CommonMacVersion `json:"macVersion,omitempty"`
// Measurements.
// If defined, ChirpStack will visualize these metrics in the web-interface.
Measurements map[string]APIMeasurement `json:"measurements,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Payload codec runtime.
PayloadCodecRuntime *APICodecRuntime `json:"payloadCodecRuntime,omitempty"`
// Payload codec script.
PayloadCodecScript string `json:"payloadCodecScript,omitempty"`
// Regional parameters revision.
RegParamsRevision *CommonRegParamsRevision `json:"regParamsRevision,omitempty"`
// Region.
Region *CommonRegion `json:"region,omitempty"`
// Region configuration ID.
// If set, devices will only use the associated region. If let blank, then
// devices will use all regions matching the selected common-name. Note
// that multiple region configurations can exist for the same common-name,
// e.g. to provide an 8 channel and 16 channel configuration for the US915
// band.
RegionConfigID string `json:"regionConfigId,omitempty"`
// Relay CAD periodicity.
RelayCadPeriodicity *APICadPeriodicity `json:"relayCadPeriodicity,omitempty"`
// Relay default channel index.
// Valid values are 0 and 1, please refer to the RP002 specification for
// the meaning of these values.
RelayDefaultChannelIndex int64 `json:"relayDefaultChannelIndex,omitempty"`
// Relay end-device activation mode.
RelayEdActivationMode *APIRelayModeActivation `json:"relayEdActivationMode,omitempty"`
// Relay end-device back-off (in case it does not receive WOR ACK frame).
// 0 = Always send a LoRaWAN uplink
// 1..63 = Send a LoRaWAN uplink after X WOR frames without a WOR ACK
RelayEdBackOff int64 `json:"relayEdBackOff,omitempty"`
// End-device only accept data through relay.
// Only accept data for this device through a relay. This setting is useful
// for testing as in case of a test-setup, the end-device is usually within
// range of the gateway.
RelayEdRelayOnly bool `json:"relayEdRelayOnly,omitempty"`
// Relay end-device smart-enable level.
RelayEdSmartEnableLevel int64 `json:"relayEdSmartEnableLevel,omitempty"`
// Relay end-device uplink limit bucket size.
//
// This field indicates the multiplier to determine the bucket size
// according to the following formula:
// BucketSize TOKEN = _reload_rate x _bucket_size
//
// Valid values (0 - 3):
// 0 = 1
// 1 = 2
// 2 = 4
// 3 = 12
RelayEdUplinkLimitBucketSize int64 `json:"relayEdUplinkLimitBucketSize,omitempty"`
// Relay end-device uplink limit reload rate.
//
// Valid values:
// * 0 - 62 = X tokens every hour
// * 63 = no limitation
RelayEdUplinkLimitReloadRate int64 `json:"relayEdUplinkLimitReloadRate,omitempty"`
// Relay must be enabled.
RelayEnabled bool `json:"relayEnabled,omitempty"`
// Relay globak uplink limit bucket size.
//
// This field indicates the multiplier to determine the bucket size
// according to the following formula:
// BucketSize TOKEN = _reload_rate x _bucket_size
//
// Valid values (0 - 3):
// 0 = 1
// 1 = 2
// 2 = 4
// 3 = 12
RelayGlobalUplinkLimitBucketSize int64 `json:"relayGlobalUplinkLimitBucketSize,omitempty"`
// Relay global uplink limit reload rate.
//
// Valid values:
// * 0 - 126 = X tokens every hour
// * 127 = no limitation
RelayGlobalUplinkLimitReloadRate int64 `json:"relayGlobalUplinkLimitReloadRate,omitempty"`
// Relay join-request limit bucket size.
//
// This field indicates the multiplier to determine the bucket size
// according to the following formula:
// BucketSize TOKEN = _reload_rate x _bucket_size
//
// Valid values (0 - 3):
// 0 = 1
// 1 = 2
// 2 = 4
// 3 = 12
RelayJoinReqLimitBucketSize int64 `json:"relayJoinReqLimitBucketSize,omitempty"`
// Relay join-request limit reload rate.
//
// Valid values:
// * 0 - 126 = X tokens every hour
// * 127 = no limitation
RelayJoinReqLimitReloadRate int64 `json:"relayJoinReqLimitReloadRate,omitempty"`
// Relay notify limit bucket size.
//
// This field indicates the multiplier to determine the bucket size
// according to the following formula:
// BucketSize TOKEN = _reload_rate x _bucket_size
//
// Valid values (0 - 3):
// 0 = 1
// 1 = 2
// 2 = 4
// 3 = 12
RelayNotifyLimitBucketSize int64 `json:"relayNotifyLimitBucketSize,omitempty"`
// Relay notify limit reload rate.
//
// Valid values:
// * 0 - 126 = X tokens every hour
// * 127 = no limitation
RelayNotifyLimitReloadRate int64 `json:"relayNotifyLimitReloadRate,omitempty"`
// Relay overall limit bucket size.
//
// This field indicates the multiplier to determine the bucket size
// according to the following formula:
// BucketSize TOKEN = _reload_rate x _bucket_size
//
// Valid values (0 - 3):
// 0 = 1
// 1 = 2
// 2 = 4
// 3 = 12
RelayOverallLimitBucketSize int64 `json:"relayOverallLimitBucketSize,omitempty"`
// Relay overall limit reload rate.
//
// Valid values:
// * 0 - 126 = X tokens every hour
// * 127 = no limitation
RelayOverallLimitReloadRate int64 `json:"relayOverallLimitReloadRate,omitempty"`
// Relay second channel ACK offset.
RelaySecondChannelAckOffset *APISecondChAckOffset `json:"relaySecondChannelAckOffset,omitempty"`
// Relay second channel DR.
RelaySecondChannelDr int64 `json:"relaySecondChannelDr,omitempty"`
// Relay second channel frequency (Hz).
RelaySecondChannelFreq int64 `json:"relaySecondChannelFreq,omitempty"`
// RX1 Delay.
//
// This makes it possible to override the system RX1 Delay. Please note that
// this values only has effect in case it is higher than the system value.
// In other words, it can be used to increase the RX1 Delay but not to decrease
// it.
// Valid options are 1 - 15 (0 = always use system RX1 Delay).
Rx1Delay int64 `json:"rx1Delay,omitempty"`
// Supports Class B.
SupportsClassB bool `json:"supportsClassB,omitempty"`
// Supports Class-C.
SupportsClassC bool `json:"supportsClassC,omitempty"`
// Supports OTAA.
SupportsOtaa bool `json:"supportsOtaa,omitempty"`
// Tags (user defined).
// These tags can be used to add additional information the the
// device-profile. These tags are exposed in all the integration events of
// devices using this device-profile.
Tags map[string]string `json:"tags,omitempty"`
// Tenant ID (UUID).
TenantID string `json:"tenantId,omitempty"`
// Uplink interval (seconds).
// This defines the expected uplink interval which the device uses for
// communication. If the uplink interval has expired and no uplink has
// been received, the device is considered inactive.
UplinkInterval int64 `json:"uplinkInterval,omitempty"`
}
// Validate validates this api device profile
func (m *APIDeviceProfile) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAppLayerParams(formats); err != nil {
res = append(res, err)
}
if err := m.validateMacVersion(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeasurements(formats); err != nil {
res = append(res, err)
}
if err := m.validatePayloadCodecRuntime(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegParamsRevision(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegion(formats); err != nil {
res = append(res, err)
}
if err := m.validateRelayCadPeriodicity(formats); err != nil {
res = append(res, err)
}
if err := m.validateRelayEdActivationMode(formats); err != nil {
res = append(res, err)
}
if err := m.validateRelaySecondChannelAckOffset(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfile) validateAppLayerParams(formats strfmt.Registry) error {
if swag.IsZero(m.AppLayerParams) { // not required
return nil
}
if m.AppLayerParams != nil {
if err := m.AppLayerParams.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("appLayerParams")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("appLayerParams")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) validateMacVersion(formats strfmt.Registry) error {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if m.MacVersion != nil {
if err := m.MacVersion.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) validateMeasurements(formats strfmt.Registry) error {
if swag.IsZero(m.Measurements) { // not required
return nil
}
for k := range m.Measurements {
if err := validate.Required("measurements"+"."+k, "body", m.Measurements[k]); err != nil {
return err
}
if val, ok := m.Measurements[k]; ok {
if err := val.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("measurements" + "." + k)
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("measurements" + "." + k)
}
return err
}
}
}
return nil
}
func (m *APIDeviceProfile) validatePayloadCodecRuntime(formats strfmt.Registry) error {
if swag.IsZero(m.PayloadCodecRuntime) { // not required
return nil
}
if m.PayloadCodecRuntime != nil {
if err := m.PayloadCodecRuntime.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("payloadCodecRuntime")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("payloadCodecRuntime")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) validateRegParamsRevision(formats strfmt.Registry) error {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if m.RegParamsRevision != nil {
if err := m.RegParamsRevision.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) validateRegion(formats strfmt.Registry) error {
if swag.IsZero(m.Region) { // not required
return nil
}
if m.Region != nil {
if err := m.Region.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) validateRelayCadPeriodicity(formats strfmt.Registry) error {
if swag.IsZero(m.RelayCadPeriodicity) { // not required
return nil
}
if m.RelayCadPeriodicity != nil {
if err := m.RelayCadPeriodicity.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relayCadPeriodicity")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relayCadPeriodicity")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) validateRelayEdActivationMode(formats strfmt.Registry) error {
if swag.IsZero(m.RelayEdActivationMode) { // not required
return nil
}
if m.RelayEdActivationMode != nil {
if err := m.RelayEdActivationMode.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relayEdActivationMode")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relayEdActivationMode")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) validateRelaySecondChannelAckOffset(formats strfmt.Registry) error {
if swag.IsZero(m.RelaySecondChannelAckOffset) { // not required
return nil
}
if m.RelaySecondChannelAckOffset != nil {
if err := m.RelaySecondChannelAckOffset.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relaySecondChannelAckOffset")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relaySecondChannelAckOffset")
}
return err
}
}
return nil
}
// ContextValidate validate this api device profile based on the context it is used
func (m *APIDeviceProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAppLayerParams(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMacVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeasurements(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePayloadCodecRuntime(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegParamsRevision(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRelayCadPeriodicity(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRelayEdActivationMode(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRelaySecondChannelAckOffset(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfile) contextValidateAppLayerParams(ctx context.Context, formats strfmt.Registry) error {
if m.AppLayerParams != nil {
if swag.IsZero(m.AppLayerParams) { // not required
return nil
}
if err := m.AppLayerParams.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("appLayerParams")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("appLayerParams")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) contextValidateMacVersion(ctx context.Context, formats strfmt.Registry) error {
if m.MacVersion != nil {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if err := m.MacVersion.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) contextValidateMeasurements(ctx context.Context, formats strfmt.Registry) error {
for k := range m.Measurements {
if val, ok := m.Measurements[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
return nil
}
func (m *APIDeviceProfile) contextValidatePayloadCodecRuntime(ctx context.Context, formats strfmt.Registry) error {
if m.PayloadCodecRuntime != nil {
if swag.IsZero(m.PayloadCodecRuntime) { // not required
return nil
}
if err := m.PayloadCodecRuntime.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("payloadCodecRuntime")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("payloadCodecRuntime")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) contextValidateRegParamsRevision(ctx context.Context, formats strfmt.Registry) error {
if m.RegParamsRevision != nil {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if err := m.RegParamsRevision.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error {
if m.Region != nil {
if swag.IsZero(m.Region) { // not required
return nil
}
if err := m.Region.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) contextValidateRelayCadPeriodicity(ctx context.Context, formats strfmt.Registry) error {
if m.RelayCadPeriodicity != nil {
if swag.IsZero(m.RelayCadPeriodicity) { // not required
return nil
}
if err := m.RelayCadPeriodicity.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relayCadPeriodicity")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relayCadPeriodicity")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) contextValidateRelayEdActivationMode(ctx context.Context, formats strfmt.Registry) error {
if m.RelayEdActivationMode != nil {
if swag.IsZero(m.RelayEdActivationMode) { // not required
return nil
}
if err := m.RelayEdActivationMode.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relayEdActivationMode")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relayEdActivationMode")
}
return err
}
}
return nil
}
func (m *APIDeviceProfile) contextValidateRelaySecondChannelAckOffset(ctx context.Context, formats strfmt.Registry) error {
if m.RelaySecondChannelAckOffset != nil {
if swag.IsZero(m.RelaySecondChannelAckOffset) { // not required
return nil
}
if err := m.RelaySecondChannelAckOffset.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relaySecondChannelAckOffset")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relaySecondChannelAckOffset")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceProfile) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceProfile) UnmarshalBinary(b []byte) error {
var res APIDeviceProfile
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,267 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIDeviceProfileListItem api device profile list item
//
// swagger:model apiDeviceProfileListItem
type APIDeviceProfileListItem struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Device-profile ID (UUID).
ID string `json:"id,omitempty"`
// LoRaWAN mac-version.
MacVersion *CommonMacVersion `json:"macVersion,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Regional parameters revision.
RegParamsRevision *CommonRegParamsRevision `json:"regParamsRevision,omitempty"`
// Region.
Region *CommonRegion `json:"region,omitempty"`
// Supports Class-B.
SupportsClassB bool `json:"supportsClassB,omitempty"`
// Supports Class-C.
SupportsClassC bool `json:"supportsClassC,omitempty"`
// Supports OTAA.
SupportsOtaa bool `json:"supportsOtaa,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api device profile list item
func (m *APIDeviceProfileListItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateMacVersion(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegParamsRevision(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegion(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfileListItem) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIDeviceProfileListItem) validateMacVersion(formats strfmt.Registry) error {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if m.MacVersion != nil {
if err := m.MacVersion.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileListItem) validateRegParamsRevision(formats strfmt.Registry) error {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if m.RegParamsRevision != nil {
if err := m.RegParamsRevision.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileListItem) validateRegion(formats strfmt.Registry) error {
if swag.IsZero(m.Region) { // not required
return nil
}
if m.Region != nil {
if err := m.Region.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileListItem) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api device profile list item based on the context it is used
func (m *APIDeviceProfileListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMacVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegParamsRevision(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegion(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfileListItem) contextValidateMacVersion(ctx context.Context, formats strfmt.Registry) error {
if m.MacVersion != nil {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if err := m.MacVersion.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileListItem) contextValidateRegParamsRevision(ctx context.Context, formats strfmt.Registry) error {
if m.RegParamsRevision != nil {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if err := m.RegParamsRevision.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileListItem) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error {
if m.Region != nil {
if swag.IsZero(m.Region) { // not required
return nil
}
if err := m.Region.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceProfileListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceProfileListItem) UnmarshalBinary(b []byte) error {
var res APIDeviceProfileListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,405 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIDeviceProfileTemplate api device profile template
//
// swagger:model apiDeviceProfileTemplate
type APIDeviceProfileTemplate struct {
// RX1 delay (for ABP).
AbpRx1Delay int64 `json:"abpRx1Delay,omitempty"`
// RX1 DR offset (for ABP).
AbpRx1DrOffset int64 `json:"abpRx1DrOffset,omitempty"`
// RX2 DR (for ABP).
AbpRx2Dr int64 `json:"abpRx2Dr,omitempty"`
// RX2 frequency (for ABP, Hz).
AbpRx2Freq int64 `json:"abpRx2Freq,omitempty"`
// ADR algorithm ID.
AdrAlgorithmID string `json:"adrAlgorithmId,omitempty"`
// Auto-detect measurements.
// If set to true, measurements will be automatically added based on the
// keys of the decoded payload. In cases where the decoded payload contains
// random keys in the data, you want to set this to false.
AutoDetectMeasurements bool `json:"autoDetectMeasurements,omitempty"`
// Class-B ping-slot DR.
ClassBPingSlotDr int64 `json:"classBPingSlotDr,omitempty"`
// Class-B ping-slot freq (Hz).
ClassBPingSlotFreq int64 `json:"classBPingSlotFreq,omitempty"`
// Class-B ping-slot periodicity (only for Class-B).
// Valid options are: 0 - 7.
//
// Number of ping-slots per beacon-period:
// pingNb = 2^(7-periodicity)
//
// Periodicity: 0 = 128 ping-slots per beacon period = ~ every 1 sec
// Periodicity: 7 = 1 ping-slot per beacon period = ~ every 128 sec
ClassBPingSlotPeriodicity int64 `json:"classBPingSlotPeriodicity,omitempty"`
// Class-B timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement from the device (if requested).
ClassBTimeout int64 `json:"classBTimeout,omitempty"`
// Class-C timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement from the device (if requested).
ClassCTimeout int64 `json:"classCTimeout,omitempty"`
// Description.
Description string `json:"description,omitempty"`
// Device-status request interval (times / day).
// This defines the times per day that ChirpStack will request the device-status
// from the device.
DeviceStatusReqInterval int64 `json:"deviceStatusReqInterval,omitempty"`
// Firmware.
Firmware string `json:"firmware,omitempty"`
// Flush queue on device activation.
FlushQueueOnActivate bool `json:"flushQueueOnActivate,omitempty"`
// Device-profile template ID.
ID string `json:"id,omitempty"`
// LoRaWAN mac-version.
MacVersion *CommonMacVersion `json:"macVersion,omitempty"`
// Measurements.
// If defined, ChirpStack will visualize these metrics in the web-interface.
Measurements map[string]APIMeasurement `json:"measurements,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Payload codec runtime.
PayloadCodecRuntime *APICodecRuntime `json:"payloadCodecRuntime,omitempty"`
// Payload codec script.
PayloadCodecScript string `json:"payloadCodecScript,omitempty"`
// Regional parameters revision.
RegParamsRevision *CommonRegParamsRevision `json:"regParamsRevision,omitempty"`
// Region.
Region *CommonRegion `json:"region,omitempty"`
// Supports Class B.
SupportsClassB bool `json:"supportsClassB,omitempty"`
// Supports Class-C.
SupportsClassC bool `json:"supportsClassC,omitempty"`
// Supports OTAA.
SupportsOtaa bool `json:"supportsOtaa,omitempty"`
// User defined tags.
Tags map[string]string `json:"tags,omitempty"`
// Uplink interval (seconds).
// This defines the expected uplink interval which the device uses for
// communication. When the uplink interval has expired and no uplink has
// been received, the device is considered inactive.
UplinkInterval int64 `json:"uplinkInterval,omitempty"`
// Vendor.
Vendor string `json:"vendor,omitempty"`
}
// Validate validates this api device profile template
func (m *APIDeviceProfileTemplate) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMacVersion(formats); err != nil {
res = append(res, err)
}
if err := m.validateMeasurements(formats); err != nil {
res = append(res, err)
}
if err := m.validatePayloadCodecRuntime(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegParamsRevision(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegion(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfileTemplate) validateMacVersion(formats strfmt.Registry) error {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if m.MacVersion != nil {
if err := m.MacVersion.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplate) validateMeasurements(formats strfmt.Registry) error {
if swag.IsZero(m.Measurements) { // not required
return nil
}
for k := range m.Measurements {
if err := validate.Required("measurements"+"."+k, "body", m.Measurements[k]); err != nil {
return err
}
if val, ok := m.Measurements[k]; ok {
if err := val.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("measurements" + "." + k)
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("measurements" + "." + k)
}
return err
}
}
}
return nil
}
func (m *APIDeviceProfileTemplate) validatePayloadCodecRuntime(formats strfmt.Registry) error {
if swag.IsZero(m.PayloadCodecRuntime) { // not required
return nil
}
if m.PayloadCodecRuntime != nil {
if err := m.PayloadCodecRuntime.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("payloadCodecRuntime")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("payloadCodecRuntime")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplate) validateRegParamsRevision(formats strfmt.Registry) error {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if m.RegParamsRevision != nil {
if err := m.RegParamsRevision.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplate) validateRegion(formats strfmt.Registry) error {
if swag.IsZero(m.Region) { // not required
return nil
}
if m.Region != nil {
if err := m.Region.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
// ContextValidate validate this api device profile template based on the context it is used
func (m *APIDeviceProfileTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMacVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMeasurements(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePayloadCodecRuntime(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegParamsRevision(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegion(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfileTemplate) contextValidateMacVersion(ctx context.Context, formats strfmt.Registry) error {
if m.MacVersion != nil {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if err := m.MacVersion.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplate) contextValidateMeasurements(ctx context.Context, formats strfmt.Registry) error {
for k := range m.Measurements {
if val, ok := m.Measurements[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
return nil
}
func (m *APIDeviceProfileTemplate) contextValidatePayloadCodecRuntime(ctx context.Context, formats strfmt.Registry) error {
if m.PayloadCodecRuntime != nil {
if swag.IsZero(m.PayloadCodecRuntime) { // not required
return nil
}
if err := m.PayloadCodecRuntime.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("payloadCodecRuntime")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("payloadCodecRuntime")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplate) contextValidateRegParamsRevision(ctx context.Context, formats strfmt.Registry) error {
if m.RegParamsRevision != nil {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if err := m.RegParamsRevision.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplate) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error {
if m.Region != nil {
if swag.IsZero(m.Region) { // not required
return nil
}
if err := m.Region.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceProfileTemplate) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceProfileTemplate) UnmarshalBinary(b []byte) error {
var res APIDeviceProfileTemplate
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,273 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIDeviceProfileTemplateListItem api device profile template list item
//
// swagger:model apiDeviceProfileTemplateListItem
type APIDeviceProfileTemplateListItem struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Firmware.
Firmware string `json:"firmware,omitempty"`
// Device-profile template ID.
ID string `json:"id,omitempty"`
// LoRaWAN mac-version.
MacVersion *CommonMacVersion `json:"macVersion,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Regional parameters revision.
RegParamsRevision *CommonRegParamsRevision `json:"regParamsRevision,omitempty"`
// Region.
Region *CommonRegion `json:"region,omitempty"`
// Supports Class-B.
SupportsClassB bool `json:"supportsClassB,omitempty"`
// Supports Class-C.
SupportsClassC bool `json:"supportsClassC,omitempty"`
// Supports OTAA.
SupportsOtaa bool `json:"supportsOtaa,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
// Vendor.
Vendor string `json:"vendor,omitempty"`
}
// Validate validates this api device profile template list item
func (m *APIDeviceProfileTemplateListItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateMacVersion(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegParamsRevision(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegion(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) validateMacVersion(formats strfmt.Registry) error {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if m.MacVersion != nil {
if err := m.MacVersion.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) validateRegParamsRevision(formats strfmt.Registry) error {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if m.RegParamsRevision != nil {
if err := m.RegParamsRevision.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) validateRegion(formats strfmt.Registry) error {
if swag.IsZero(m.Region) { // not required
return nil
}
if m.Region != nil {
if err := m.Region.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api device profile template list item based on the context it is used
func (m *APIDeviceProfileTemplateListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMacVersion(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegParamsRevision(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegion(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) contextValidateMacVersion(ctx context.Context, formats strfmt.Registry) error {
if m.MacVersion != nil {
if swag.IsZero(m.MacVersion) { // not required
return nil
}
if err := m.MacVersion.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("macVersion")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("macVersion")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) contextValidateRegParamsRevision(ctx context.Context, formats strfmt.Registry) error {
if m.RegParamsRevision != nil {
if swag.IsZero(m.RegParamsRevision) { // not required
return nil
}
if err := m.RegParamsRevision.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("regParamsRevision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("regParamsRevision")
}
return err
}
}
return nil
}
func (m *APIDeviceProfileTemplateListItem) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error {
if m.Region != nil {
if swag.IsZero(m.Region) { // not required
return nil
}
if err := m.Region.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceProfileTemplateListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceProfileTemplateListItem) UnmarshalBinary(b []byte) error {
var res APIDeviceProfileTemplateListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,115 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIDeviceQueueItem api device queue item
//
// swagger:model apiDeviceQueueItem
type APIDeviceQueueItem struct {
// Confirmed.
Confirmed bool `json:"confirmed,omitempty"`
// Data.
// Or use the json_object field when a codec has been configured.
// Format: byte
Data strfmt.Base64 `json:"data,omitempty"`
// Device EUI (EUI64).
DevEui string `json:"devEui,omitempty"`
// Expires at (optional).
// Expired queue-items will be automatically removed from the queue.
// Format: date-time
ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"`
// Downlink frame-counter.
// Do not set this for plain-text data payloads. It will be automatically set
// by ChirpStack when the payload has been sent as downlink.
FCntDown int64 `json:"fCntDown,omitempty"`
// FPort (must be > 0).
// On enqueue and if using a JavaScript codec, this value might be
// automatically set by the codec function.
FPort int64 `json:"fPort,omitempty"`
// ID (UUID).
// This is automatically generated on enqueue.
ID string `json:"id,omitempty"`
// Is encrypted.
// This must be set to true if the end-application has already encrypted
// the data payload. In this case, the f_cnt_down field must be set to
// the corresponding frame-counter which has been used during the encryption.
IsEncrypted bool `json:"isEncrypted,omitempty"`
// Is pending.
// This is set by ChirpStack to true when the downlink is pending (e.g. it
// has been sent, but a confirmation is still pending).
IsPending bool `json:"isPending,omitempty"`
// Only use this when a codec has been configured that can encode this
// object to bytes.
Object interface{} `json:"object,omitempty"`
}
// Validate validates this api device queue item
func (m *APIDeviceQueueItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateExpiresAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIDeviceQueueItem) validateExpiresAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExpiresAt) { // not required
return nil
}
if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this api device queue item based on context it is used
func (m *APIDeviceQueueItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceQueueItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceQueueItem) UnmarshalBinary(b []byte) error {
var res APIDeviceQueueItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,53 @@
// 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"
)
// APIDeviceState api device state
//
// swagger:model apiDeviceState
type APIDeviceState struct {
// Name.
Name string `json:"name,omitempty"`
// Value.
Value string `json:"value,omitempty"`
}
// Validate validates this api device state
func (m *APIDeviceState) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api device state based on context it is used
func (m *APIDeviceState) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceState) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceState) UnmarshalBinary(b []byte) error {
var res APIDeviceState
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,58 @@
// 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"
)
// APIDeviceStatus api device status
//
// swagger:model apiDeviceStatus
type APIDeviceStatus struct {
// Device battery level as a percentage.
// -1 when the battery level is not available.
BatteryLevel float32 `json:"batteryLevel,omitempty"`
// Device is connected to an external power source.
ExternalPowerSource bool `json:"externalPowerSource,omitempty"`
// The device margin status
// -32..32: The demodulation SNR ration in dB
Margin int32 `json:"margin,omitempty"`
}
// Validate validates this api device status
func (m *APIDeviceStatus) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api device status based on context it is used
func (m *APIDeviceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIDeviceStatus) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIDeviceStatus) UnmarshalBinary(b []byte) error {
var res APIDeviceStatus
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,78 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIEncoding api encoding
//
// swagger:model apiEncoding
type APIEncoding string
func NewAPIEncoding(value APIEncoding) *APIEncoding {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIEncoding.
func (m APIEncoding) Pointer() *APIEncoding {
return &m
}
const (
// APIEncodingJSON captures enum value "JSON"
APIEncodingJSON APIEncoding = "JSON"
// APIEncodingPROTOBUF captures enum value "PROTOBUF"
APIEncodingPROTOBUF APIEncoding = "PROTOBUF"
)
// for schema
var apiEncodingEnum []interface{}
func init() {
var res []APIEncoding
if err := json.Unmarshal([]byte(`["JSON","PROTOBUF"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiEncodingEnum = append(apiEncodingEnum, v)
}
}
func (m APIEncoding) validateAPIEncodingEnum(path, location string, value APIEncoding) error {
if err := validate.EnumCase(path, location, value, apiEncodingEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api encoding
func (m APIEncoding) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIEncodingEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api encoding based on context it is used
func (m APIEncoding) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APIEnqueueDeviceQueueItemResponse api enqueue device queue item response
//
// swagger:model apiEnqueueDeviceQueueItemResponse
type APIEnqueueDeviceQueueItemResponse struct {
// ID (UUID).
ID string `json:"id,omitempty"`
}
// Validate validates this api enqueue device queue item response
func (m *APIEnqueueDeviceQueueItemResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api enqueue device queue item response based on context it is used
func (m *APIEnqueueDeviceQueueItemResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIEnqueueDeviceQueueItemResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIEnqueueDeviceQueueItemResponse) UnmarshalBinary(b []byte) error {
var res APIEnqueueDeviceQueueItemResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APIEnqueueMulticastGroupQueueItemResponse api enqueue multicast group queue item response
//
// swagger:model apiEnqueueMulticastGroupQueueItemResponse
type APIEnqueueMulticastGroupQueueItemResponse struct {
// Frame-counter of the enqueued payload.
FCnt int64 `json:"fCnt,omitempty"`
}
// Validate validates this api enqueue multicast group queue item response
func (m *APIEnqueueMulticastGroupQueueItemResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api enqueue multicast group queue item response based on context it is used
func (m *APIEnqueueMulticastGroupQueueItemResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIEnqueueMulticastGroupQueueItemResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIEnqueueMulticastGroupQueueItemResponse) UnmarshalBinary(b []byte) error {
var res APIEnqueueMulticastGroupQueueItemResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,132 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGateway api gateway
//
// swagger:model apiGateway
type APIGateway struct {
// Description.
Description string `json:"description,omitempty"`
// Gateway ID (EUI64).
GatewayID string `json:"gatewayId,omitempty"`
// Gateway location.
Location *CommonLocation `json:"location,omitempty"`
// Metadata (provided by the gateway).
Metadata map[string]string `json:"metadata,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Stats interval (seconds).
// This defines the expected interval in which the gateway sends its
// statistics.
StatsInterval int64 `json:"statsInterval,omitempty"`
// Tags.
Tags map[string]string `json:"tags,omitempty"`
// Tenant ID (UUID).
TenantID string `json:"tenantId,omitempty"`
}
// Validate validates this api gateway
func (m *APIGateway) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLocation(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGateway) validateLocation(formats strfmt.Registry) error {
if swag.IsZero(m.Location) { // not required
return nil
}
if m.Location != nil {
if err := m.Location.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("location")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("location")
}
return err
}
}
return nil
}
// ContextValidate validate this api gateway based on the context it is used
func (m *APIGateway) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateLocation(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGateway) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error {
if m.Location != nil {
if swag.IsZero(m.Location) { // not required
return nil
}
if err := m.Location.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("location")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("location")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGateway) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGateway) UnmarshalBinary(b []byte) error {
var res APIGateway
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,238 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGatewayListItem api gateway list item
//
// swagger:model apiGatewayListItem
type APIGatewayListItem struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Description.
Description string `json:"description,omitempty"`
// Gateway ID (EUI64).
GatewayID string `json:"gatewayId,omitempty"`
// Last seen at timestamp.
// Format: date-time
LastSeenAt strfmt.DateTime `json:"lastSeenAt,omitempty"`
// Location.
Location *CommonLocation `json:"location,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Gateway properties.
Properties map[string]string `json:"properties,omitempty"`
// Gateway state.
// Please note that the state of the gateway is driven by the stats
// packages that are sent by the gateway.
State *APIGatewayState `json:"state,omitempty"`
// Tenant ID.
TenantID string `json:"tenantId,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api gateway list item
func (m *APIGatewayListItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateLastSeenAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateLocation(formats); err != nil {
res = append(res, err)
}
if err := m.validateState(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGatewayListItem) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGatewayListItem) validateLastSeenAt(formats strfmt.Registry) error {
if swag.IsZero(m.LastSeenAt) { // not required
return nil
}
if err := validate.FormatOf("lastSeenAt", "body", "date-time", m.LastSeenAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGatewayListItem) validateLocation(formats strfmt.Registry) error {
if swag.IsZero(m.Location) { // not required
return nil
}
if m.Location != nil {
if err := m.Location.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("location")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("location")
}
return err
}
}
return nil
}
func (m *APIGatewayListItem) validateState(formats strfmt.Registry) error {
if swag.IsZero(m.State) { // not required
return nil
}
if m.State != nil {
if err := m.State.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("state")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("state")
}
return err
}
}
return nil
}
func (m *APIGatewayListItem) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api gateway list item based on the context it is used
func (m *APIGatewayListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateLocation(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateState(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGatewayListItem) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error {
if m.Location != nil {
if swag.IsZero(m.Location) { // not required
return nil
}
if err := m.Location.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("location")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("location")
}
return err
}
}
return nil
}
func (m *APIGatewayListItem) contextValidateState(ctx context.Context, formats strfmt.Registry) error {
if m.State != nil {
if swag.IsZero(m.State) { // not required
return nil
}
if err := m.State.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("state")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("state")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGatewayListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGatewayListItem) UnmarshalBinary(b []byte) error {
var res APIGatewayListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,83 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIGatewayState - NEVER_SEEN: The gateway has never sent any stats.
// - ONLINE: Online.
// - OFFLINE: Offline.
//
// swagger:model apiGatewayState
type APIGatewayState string
func NewAPIGatewayState(value APIGatewayState) *APIGatewayState {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIGatewayState.
func (m APIGatewayState) Pointer() *APIGatewayState {
return &m
}
const (
// APIGatewayStateNEVERSEEN captures enum value "NEVER_SEEN"
APIGatewayStateNEVERSEEN APIGatewayState = "NEVER_SEEN"
// APIGatewayStateONLINE captures enum value "ONLINE"
APIGatewayStateONLINE APIGatewayState = "ONLINE"
// APIGatewayStateOFFLINE captures enum value "OFFLINE"
APIGatewayStateOFFLINE APIGatewayState = "OFFLINE"
)
// for schema
var apiGatewayStateEnum []interface{}
func init() {
var res []APIGatewayState
if err := json.Unmarshal([]byte(`["NEVER_SEEN","ONLINE","OFFLINE"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiGatewayStateEnum = append(apiGatewayStateEnum, v)
}
}
func (m APIGatewayState) validateAPIGatewayStateEnum(path, location string, value APIGatewayState) error {
if err := validate.EnumCase(path, location, value, apiGatewayStateEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api gateway state
func (m APIGatewayState) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIGatewayStateEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api gateway state based on context it is used
func (m APIGatewayState) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,125 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGcpPubSubIntegration api gcp pub sub integration
//
// swagger:model apiGcpPubSubIntegration
type APIGcpPubSubIntegration struct {
// Application ID (UUID).
ApplicationID string `json:"applicationId,omitempty"`
// Credentials file.
// This IAM service-account credentials file (JSON) must have the following
// Pub/Sub roles:
// * Pub/Sub Publisher
CredentialsFile string `json:"credentialsFile,omitempty"`
// Encoding.
Encoding *APIEncoding `json:"encoding,omitempty"`
// Project ID.
ProjectID string `json:"projectId,omitempty"`
// Topic name.
// This is the name of the Pub/Sub topic.
TopicName string `json:"topicName,omitempty"`
}
// Validate validates this api gcp pub sub integration
func (m *APIGcpPubSubIntegration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEncoding(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGcpPubSubIntegration) validateEncoding(formats strfmt.Registry) error {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if m.Encoding != nil {
if err := m.Encoding.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// ContextValidate validate this api gcp pub sub integration based on the context it is used
func (m *APIGcpPubSubIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEncoding(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGcpPubSubIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error {
if m.Encoding != nil {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if err := m.Encoding.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGcpPubSubIntegration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGcpPubSubIntegration) UnmarshalBinary(b []byte) error {
var res APIGcpPubSubIntegration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,83 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGenerateGatewayClientCertificateResponse api generate gateway client certificate response
//
// swagger:model apiGenerateGatewayClientCertificateResponse
type APIGenerateGatewayClientCertificateResponse struct {
// CA certificate.
CaCert string `json:"caCert,omitempty"`
// Expires at defines the expiration date of the certificate.
// Format: date-time
ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"`
// TLS certificate.
TLSCert string `json:"tlsCert,omitempty"`
// TLS key.
TLSKey string `json:"tlsKey,omitempty"`
}
// Validate validates this api generate gateway client certificate response
func (m *APIGenerateGatewayClientCertificateResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateExpiresAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGenerateGatewayClientCertificateResponse) validateExpiresAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExpiresAt) { // not required
return nil
}
if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this api generate gateway client certificate response based on context it is used
func (m *APIGenerateGatewayClientCertificateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIGenerateGatewayClientCertificateResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGenerateGatewayClientCertificateResponse) UnmarshalBinary(b []byte) error {
var res APIGenerateGatewayClientCertificateResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,83 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGenerateMqttIntegrationClientCertificateResponse api generate mqtt integration client certificate response
//
// swagger:model apiGenerateMqttIntegrationClientCertificateResponse
type APIGenerateMqttIntegrationClientCertificateResponse struct {
// CA certificate.
CaCert string `json:"caCert,omitempty"`
// Expires at defines the expiration date of the certificate.
// Format: date-time
ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"`
// TLS certificate.
TLSCert string `json:"tlsCert,omitempty"`
// TLS key.
TLSKey string `json:"tlsKey,omitempty"`
}
// Validate validates this api generate mqtt integration client certificate response
func (m *APIGenerateMqttIntegrationClientCertificateResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateExpiresAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGenerateMqttIntegrationClientCertificateResponse) validateExpiresAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExpiresAt) { // not required
return nil
}
if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this api generate mqtt integration client certificate response based on context it is used
func (m *APIGenerateMqttIntegrationClientCertificateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIGenerateMqttIntegrationClientCertificateResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGenerateMqttIntegrationClientCertificateResponse) UnmarshalBinary(b []byte) error {
var res APIGenerateMqttIntegrationClientCertificateResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,155 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetApplicationResponse api get application response
//
// swagger:model apiGetApplicationResponse
type APIGetApplicationResponse struct {
// Application object.
Application *APIApplication `json:"application,omitempty"`
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Measurement keys.
// This contains the measurement keys from all the device-profiles that
// are used by the devices under this application.
MeasurementKeys []string `json:"measurementKeys"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get application response
func (m *APIGetApplicationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateApplication(formats); err != nil {
res = append(res, err)
}
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetApplicationResponse) validateApplication(formats strfmt.Registry) error {
if swag.IsZero(m.Application) { // not required
return nil
}
if m.Application != nil {
if err := m.Application.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("application")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("application")
}
return err
}
}
return nil
}
func (m *APIGetApplicationResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetApplicationResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get application response based on the context it is used
func (m *APIGetApplicationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateApplication(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetApplicationResponse) contextValidateApplication(ctx context.Context, formats strfmt.Registry) error {
if m.Application != nil {
if swag.IsZero(m.Application) { // not required
return nil
}
if err := m.Application.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("application")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("application")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetApplicationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetApplicationResponse) UnmarshalBinary(b []byte) error {
var res APIGetApplicationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetAwsSnsIntegrationResponse api get aws sns integration response
//
// swagger:model apiGetAwsSnsIntegrationResponse
type APIGetAwsSnsIntegrationResponse struct {
// Integration object.
Integration *APIAwsSnsIntegration `json:"integration,omitempty"`
}
// Validate validates this api get aws sns integration response
func (m *APIGetAwsSnsIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetAwsSnsIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get aws sns integration response based on the context it is used
func (m *APIGetAwsSnsIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetAwsSnsIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetAwsSnsIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetAwsSnsIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetAwsSnsIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetAzureServiceBusIntegrationResponse api get azure service bus integration response
//
// swagger:model apiGetAzureServiceBusIntegrationResponse
type APIGetAzureServiceBusIntegrationResponse struct {
// Integration object.
Integration *APIAzureServiceBusIntegration `json:"integration,omitempty"`
}
// Validate validates this api get azure service bus integration response
func (m *APIGetAzureServiceBusIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetAzureServiceBusIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get azure service bus integration response based on the context it is used
func (m *APIGetAzureServiceBusIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetAzureServiceBusIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetAzureServiceBusIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetAzureServiceBusIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetAzureServiceBusIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,163 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetDeviceActivationResponse api get device activation response
//
// swagger:model apiGetDeviceActivationResponse
type APIGetDeviceActivationResponse struct {
// Device activation object.
DeviceActivation *APIDeviceActivation `json:"deviceActivation,omitempty"`
// Join-Server context.
// A non-empty value indicatest that ChirpStack does not have access to
// the AppSKey and that the encryption / decryption of the payloads is
// the responsibility of the end-application.
JoinServerContext *CommonJoinServerContext `json:"joinServerContext,omitempty"`
}
// Validate validates this api get device activation response
func (m *APIGetDeviceActivationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDeviceActivation(formats); err != nil {
res = append(res, err)
}
if err := m.validateJoinServerContext(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceActivationResponse) validateDeviceActivation(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceActivation) { // not required
return nil
}
if m.DeviceActivation != nil {
if err := m.DeviceActivation.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceActivation")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceActivation")
}
return err
}
}
return nil
}
func (m *APIGetDeviceActivationResponse) validateJoinServerContext(formats strfmt.Registry) error {
if swag.IsZero(m.JoinServerContext) { // not required
return nil
}
if m.JoinServerContext != nil {
if err := m.JoinServerContext.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("joinServerContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("joinServerContext")
}
return err
}
}
return nil
}
// ContextValidate validate this api get device activation response based on the context it is used
func (m *APIGetDeviceActivationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDeviceActivation(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateJoinServerContext(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceActivationResponse) contextValidateDeviceActivation(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceActivation != nil {
if swag.IsZero(m.DeviceActivation) { // not required
return nil
}
if err := m.DeviceActivation.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceActivation")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceActivation")
}
return err
}
}
return nil
}
func (m *APIGetDeviceActivationResponse) contextValidateJoinServerContext(ctx context.Context, formats strfmt.Registry) error {
if m.JoinServerContext != nil {
if swag.IsZero(m.JoinServerContext) { // not required
return nil
}
if err := m.JoinServerContext.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("joinServerContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("joinServerContext")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceActivationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceActivationResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceActivationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,150 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetDeviceKeysResponse api get device keys response
//
// swagger:model apiGetDeviceKeysResponse
type APIGetDeviceKeysResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Device-keys object.
DeviceKeys *APIDeviceKeys `json:"deviceKeys,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get device keys response
func (m *APIGetDeviceKeysResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeviceKeys(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceKeysResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetDeviceKeysResponse) validateDeviceKeys(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceKeys) { // not required
return nil
}
if m.DeviceKeys != nil {
if err := m.DeviceKeys.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceKeys")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceKeys")
}
return err
}
}
return nil
}
func (m *APIGetDeviceKeysResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get device keys response based on the context it is used
func (m *APIGetDeviceKeysResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDeviceKeys(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceKeysResponse) contextValidateDeviceKeys(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceKeys != nil {
if swag.IsZero(m.DeviceKeys) { // not required
return nil
}
if err := m.DeviceKeys.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceKeys")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceKeys")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceKeysResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceKeysResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceKeysResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,364 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetDeviceLinkMetricsResponse api get device link metrics response
//
// swagger:model apiGetDeviceLinkMetricsResponse
type APIGetDeviceLinkMetricsResponse struct {
// Errors.
Errors *CommonMetric `json:"errors,omitempty"`
// RSSI (as reported by the gateway(s)).
GwRssi *CommonMetric `json:"gwRssi,omitempty"`
// SNR (as reported by the gateway(s)).
GwSnr *CommonMetric `json:"gwSnr,omitempty"`
// Packets received from the device.
RxPackets *CommonMetric `json:"rxPackets,omitempty"`
// Packets received by DR.
RxPacketsPerDr *CommonMetric `json:"rxPacketsPerDr,omitempty"`
// Packets received by frequency.
RxPacketsPerFreq *CommonMetric `json:"rxPacketsPerFreq,omitempty"`
}
// Validate validates this api get device link metrics response
func (m *APIGetDeviceLinkMetricsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateErrors(formats); err != nil {
res = append(res, err)
}
if err := m.validateGwRssi(formats); err != nil {
res = append(res, err)
}
if err := m.validateGwSnr(formats); err != nil {
res = append(res, err)
}
if err := m.validateRxPackets(formats); err != nil {
res = append(res, err)
}
if err := m.validateRxPacketsPerDr(formats); err != nil {
res = append(res, err)
}
if err := m.validateRxPacketsPerFreq(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) validateErrors(formats strfmt.Registry) error {
if swag.IsZero(m.Errors) { // not required
return nil
}
if m.Errors != nil {
if err := m.Errors.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("errors")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("errors")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) validateGwRssi(formats strfmt.Registry) error {
if swag.IsZero(m.GwRssi) { // not required
return nil
}
if m.GwRssi != nil {
if err := m.GwRssi.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gwRssi")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gwRssi")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) validateGwSnr(formats strfmt.Registry) error {
if swag.IsZero(m.GwSnr) { // not required
return nil
}
if m.GwSnr != nil {
if err := m.GwSnr.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gwSnr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gwSnr")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) validateRxPackets(formats strfmt.Registry) error {
if swag.IsZero(m.RxPackets) { // not required
return nil
}
if m.RxPackets != nil {
if err := m.RxPackets.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPackets")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPackets")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) validateRxPacketsPerDr(formats strfmt.Registry) error {
if swag.IsZero(m.RxPacketsPerDr) { // not required
return nil
}
if m.RxPacketsPerDr != nil {
if err := m.RxPacketsPerDr.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerDr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerDr")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) validateRxPacketsPerFreq(formats strfmt.Registry) error {
if swag.IsZero(m.RxPacketsPerFreq) { // not required
return nil
}
if m.RxPacketsPerFreq != nil {
if err := m.RxPacketsPerFreq.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerFreq")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerFreq")
}
return err
}
}
return nil
}
// ContextValidate validate this api get device link metrics response based on the context it is used
func (m *APIGetDeviceLinkMetricsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateErrors(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGwRssi(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGwSnr(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRxPackets(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRxPacketsPerDr(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRxPacketsPerFreq(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) contextValidateErrors(ctx context.Context, formats strfmt.Registry) error {
if m.Errors != nil {
if swag.IsZero(m.Errors) { // not required
return nil
}
if err := m.Errors.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("errors")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("errors")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) contextValidateGwRssi(ctx context.Context, formats strfmt.Registry) error {
if m.GwRssi != nil {
if swag.IsZero(m.GwRssi) { // not required
return nil
}
if err := m.GwRssi.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gwRssi")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gwRssi")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) contextValidateGwSnr(ctx context.Context, formats strfmt.Registry) error {
if m.GwSnr != nil {
if swag.IsZero(m.GwSnr) { // not required
return nil
}
if err := m.GwSnr.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gwSnr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gwSnr")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) contextValidateRxPackets(ctx context.Context, formats strfmt.Registry) error {
if m.RxPackets != nil {
if swag.IsZero(m.RxPackets) { // not required
return nil
}
if err := m.RxPackets.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPackets")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPackets")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) contextValidateRxPacketsPerDr(ctx context.Context, formats strfmt.Registry) error {
if m.RxPacketsPerDr != nil {
if swag.IsZero(m.RxPacketsPerDr) { // not required
return nil
}
if err := m.RxPacketsPerDr.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerDr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerDr")
}
return err
}
}
return nil
}
func (m *APIGetDeviceLinkMetricsResponse) contextValidateRxPacketsPerFreq(ctx context.Context, formats strfmt.Registry) error {
if m.RxPacketsPerFreq != nil {
if swag.IsZero(m.RxPacketsPerFreq) { // not required
return nil
}
if err := m.RxPacketsPerFreq.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerFreq")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerFreq")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceLinkMetricsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceLinkMetricsResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceLinkMetricsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,163 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetDeviceMetricsResponse api get device metrics response
//
// swagger:model apiGetDeviceMetricsResponse
type APIGetDeviceMetricsResponse struct {
// metrics
Metrics map[string]CommonMetric `json:"metrics,omitempty"`
// states
States map[string]APIDeviceState `json:"states,omitempty"`
}
// Validate validates this api get device metrics response
func (m *APIGetDeviceMetricsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMetrics(formats); err != nil {
res = append(res, err)
}
if err := m.validateStates(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceMetricsResponse) validateMetrics(formats strfmt.Registry) error {
if swag.IsZero(m.Metrics) { // not required
return nil
}
for k := range m.Metrics {
if err := validate.Required("metrics"+"."+k, "body", m.Metrics[k]); err != nil {
return err
}
if val, ok := m.Metrics[k]; ok {
if err := val.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metrics" + "." + k)
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("metrics" + "." + k)
}
return err
}
}
}
return nil
}
func (m *APIGetDeviceMetricsResponse) validateStates(formats strfmt.Registry) error {
if swag.IsZero(m.States) { // not required
return nil
}
for k := range m.States {
if err := validate.Required("states"+"."+k, "body", m.States[k]); err != nil {
return err
}
if val, ok := m.States[k]; ok {
if err := val.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("states" + "." + k)
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("states" + "." + k)
}
return err
}
}
}
return nil
}
// ContextValidate validate this api get device metrics response based on the context it is used
func (m *APIGetDeviceMetricsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMetrics(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateStates(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceMetricsResponse) contextValidateMetrics(ctx context.Context, formats strfmt.Registry) error {
for k := range m.Metrics {
if val, ok := m.Metrics[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
return nil
}
func (m *APIGetDeviceMetricsResponse) contextValidateStates(ctx context.Context, formats strfmt.Registry) error {
for k := range m.States {
if val, ok := m.States[k]; ok {
if err := val.ContextValidate(ctx, formats); err != nil {
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceMetricsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceMetricsResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceMetricsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APIGetDeviceNextFCntDownResponse api get device next f cnt down response
//
// swagger:model apiGetDeviceNextFCntDownResponse
type APIGetDeviceNextFCntDownResponse struct {
// FCntDown.
FCntDown int64 `json:"fCntDown,omitempty"`
}
// Validate validates this api get device next f cnt down response
func (m *APIGetDeviceNextFCntDownResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api get device next f cnt down response based on context it is used
func (m *APIGetDeviceNextFCntDownResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceNextFCntDownResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceNextFCntDownResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceNextFCntDownResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,150 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetDeviceProfileResponse api get device profile response
//
// swagger:model apiGetDeviceProfileResponse
type APIGetDeviceProfileResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Device-profile object.
DeviceProfile *APIDeviceProfile `json:"deviceProfile,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get device profile response
func (m *APIGetDeviceProfileResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeviceProfile(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceProfileResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetDeviceProfileResponse) validateDeviceProfile(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceProfile) { // not required
return nil
}
if m.DeviceProfile != nil {
if err := m.DeviceProfile.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfile")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfile")
}
return err
}
}
return nil
}
func (m *APIGetDeviceProfileResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get device profile response based on the context it is used
func (m *APIGetDeviceProfileResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDeviceProfile(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceProfileResponse) contextValidateDeviceProfile(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceProfile != nil {
if swag.IsZero(m.DeviceProfile) { // not required
return nil
}
if err := m.DeviceProfile.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfile")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfile")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceProfileResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceProfileResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceProfileResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,150 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetDeviceProfileTemplateResponse api get device profile template response
//
// swagger:model apiGetDeviceProfileTemplateResponse
type APIGetDeviceProfileTemplateResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Device-profile template object.
DeviceProfileTemplate *APIDeviceProfileTemplate `json:"deviceProfileTemplate,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get device profile template response
func (m *APIGetDeviceProfileTemplateResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeviceProfileTemplate(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceProfileTemplateResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetDeviceProfileTemplateResponse) validateDeviceProfileTemplate(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceProfileTemplate) { // not required
return nil
}
if m.DeviceProfileTemplate != nil {
if err := m.DeviceProfileTemplate.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfileTemplate")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfileTemplate")
}
return err
}
}
return nil
}
func (m *APIGetDeviceProfileTemplateResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get device profile template response based on the context it is used
func (m *APIGetDeviceProfileTemplateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDeviceProfileTemplate(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceProfileTemplateResponse) contextValidateDeviceProfileTemplate(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceProfileTemplate != nil {
if swag.IsZero(m.DeviceProfileTemplate) { // not required
return nil
}
if err := m.DeviceProfileTemplate.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceProfileTemplate")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceProfileTemplate")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceProfileTemplateResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceProfileTemplateResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceProfileTemplateResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetDeviceQueueItemsResponse api get device queue items response
//
// swagger:model apiGetDeviceQueueItemsResponse
type APIGetDeviceQueueItemsResponse struct {
// Result-set.
Result []*APIDeviceQueueItem `json:"result"`
// Total number of queue items.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api get device queue items response
func (m *APIGetDeviceQueueItemsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceQueueItemsResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api get device queue items response based on the context it is used
func (m *APIGetDeviceQueueItemsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceQueueItemsResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceQueueItemsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceQueueItemsResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceQueueItemsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,272 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetDeviceResponse api get device response
//
// swagger:model apiGetDeviceResponse
type APIGetDeviceResponse struct {
// Enabled device class.
ClassEnabled *CommonDeviceClass `json:"classEnabled,omitempty"`
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Device object.
Device *APIDevice `json:"device,omitempty"`
// Device status.
DeviceStatus *APIDeviceStatus `json:"deviceStatus,omitempty"`
// Last seen at timestamp.
// Format: date-time
LastSeenAt strfmt.DateTime `json:"lastSeenAt,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get device response
func (m *APIGetDeviceResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateClassEnabled(formats); err != nil {
res = append(res, err)
}
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateDevice(formats); err != nil {
res = append(res, err)
}
if err := m.validateDeviceStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateLastSeenAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceResponse) validateClassEnabled(formats strfmt.Registry) error {
if swag.IsZero(m.ClassEnabled) { // not required
return nil
}
if m.ClassEnabled != nil {
if err := m.ClassEnabled.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("classEnabled")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("classEnabled")
}
return err
}
}
return nil
}
func (m *APIGetDeviceResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetDeviceResponse) validateDevice(formats strfmt.Registry) error {
if swag.IsZero(m.Device) { // not required
return nil
}
if m.Device != nil {
if err := m.Device.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("device")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("device")
}
return err
}
}
return nil
}
func (m *APIGetDeviceResponse) validateDeviceStatus(formats strfmt.Registry) error {
if swag.IsZero(m.DeviceStatus) { // not required
return nil
}
if m.DeviceStatus != nil {
if err := m.DeviceStatus.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceStatus")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceStatus")
}
return err
}
}
return nil
}
func (m *APIGetDeviceResponse) validateLastSeenAt(formats strfmt.Registry) error {
if swag.IsZero(m.LastSeenAt) { // not required
return nil
}
if err := validate.FormatOf("lastSeenAt", "body", "date-time", m.LastSeenAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetDeviceResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get device response based on the context it is used
func (m *APIGetDeviceResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateClassEnabled(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDevice(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateDeviceStatus(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetDeviceResponse) contextValidateClassEnabled(ctx context.Context, formats strfmt.Registry) error {
if m.ClassEnabled != nil {
if swag.IsZero(m.ClassEnabled) { // not required
return nil
}
if err := m.ClassEnabled.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("classEnabled")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("classEnabled")
}
return err
}
}
return nil
}
func (m *APIGetDeviceResponse) contextValidateDevice(ctx context.Context, formats strfmt.Registry) error {
if m.Device != nil {
if swag.IsZero(m.Device) { // not required
return nil
}
if err := m.Device.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("device")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("device")
}
return err
}
}
return nil
}
func (m *APIGetDeviceResponse) contextValidateDeviceStatus(ctx context.Context, formats strfmt.Registry) error {
if m.DeviceStatus != nil {
if swag.IsZero(m.DeviceStatus) { // not required
return nil
}
if err := m.DeviceStatus.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("deviceStatus")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("deviceStatus")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetDeviceResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetDeviceResponse) UnmarshalBinary(b []byte) error {
var res APIGetDeviceResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,160 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetGatewayDutyCycleMetricsResponse api get gateway duty cycle metrics response
//
// swagger:model apiGetGatewayDutyCycleMetricsResponse
type APIGetGatewayDutyCycleMetricsResponse struct {
// Percentage relative to max load.
MaxLoadPercentage *CommonMetric `json:"maxLoadPercentage,omitempty"`
// Percentage relative to tracking window.
WindowPercentage *CommonMetric `json:"windowPercentage,omitempty"`
}
// Validate validates this api get gateway duty cycle metrics response
func (m *APIGetGatewayDutyCycleMetricsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMaxLoadPercentage(formats); err != nil {
res = append(res, err)
}
if err := m.validateWindowPercentage(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGatewayDutyCycleMetricsResponse) validateMaxLoadPercentage(formats strfmt.Registry) error {
if swag.IsZero(m.MaxLoadPercentage) { // not required
return nil
}
if m.MaxLoadPercentage != nil {
if err := m.MaxLoadPercentage.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("maxLoadPercentage")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("maxLoadPercentage")
}
return err
}
}
return nil
}
func (m *APIGetGatewayDutyCycleMetricsResponse) validateWindowPercentage(formats strfmt.Registry) error {
if swag.IsZero(m.WindowPercentage) { // not required
return nil
}
if m.WindowPercentage != nil {
if err := m.WindowPercentage.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("windowPercentage")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("windowPercentage")
}
return err
}
}
return nil
}
// ContextValidate validate this api get gateway duty cycle metrics response based on the context it is used
func (m *APIGetGatewayDutyCycleMetricsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMaxLoadPercentage(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateWindowPercentage(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGatewayDutyCycleMetricsResponse) contextValidateMaxLoadPercentage(ctx context.Context, formats strfmt.Registry) error {
if m.MaxLoadPercentage != nil {
if swag.IsZero(m.MaxLoadPercentage) { // not required
return nil
}
if err := m.MaxLoadPercentage.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("maxLoadPercentage")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("maxLoadPercentage")
}
return err
}
}
return nil
}
func (m *APIGetGatewayDutyCycleMetricsResponse) contextValidateWindowPercentage(ctx context.Context, formats strfmt.Registry) error {
if m.WindowPercentage != nil {
if swag.IsZero(m.WindowPercentage) { // not required
return nil
}
if err := m.WindowPercentage.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("windowPercentage")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("windowPercentage")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetGatewayDutyCycleMetricsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetGatewayDutyCycleMetricsResponse) UnmarshalBinary(b []byte) error {
var res APIGetGatewayDutyCycleMetricsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,415 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetGatewayMetricsResponse api get gateway metrics response
//
// swagger:model apiGetGatewayMetricsResponse
type APIGetGatewayMetricsResponse struct {
// RX packets.
RxPackets *CommonMetric `json:"rxPackets,omitempty"`
// RX packets / DR.
RxPacketsPerDr *CommonMetric `json:"rxPacketsPerDr,omitempty"`
// RX packets / frequency.
RxPacketsPerFreq *CommonMetric `json:"rxPacketsPerFreq,omitempty"`
// TX packets.
TxPackets *CommonMetric `json:"txPackets,omitempty"`
// TX packets / DR.
TxPacketsPerDr *CommonMetric `json:"txPacketsPerDr,omitempty"`
// TX packets / frequency.
TxPacketsPerFreq *CommonMetric `json:"txPacketsPerFreq,omitempty"`
// TX packets per status.
TxPacketsPerStatus *CommonMetric `json:"txPacketsPerStatus,omitempty"`
}
// Validate validates this api get gateway metrics response
func (m *APIGetGatewayMetricsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateRxPackets(formats); err != nil {
res = append(res, err)
}
if err := m.validateRxPacketsPerDr(formats); err != nil {
res = append(res, err)
}
if err := m.validateRxPacketsPerFreq(formats); err != nil {
res = append(res, err)
}
if err := m.validateTxPackets(formats); err != nil {
res = append(res, err)
}
if err := m.validateTxPacketsPerDr(formats); err != nil {
res = append(res, err)
}
if err := m.validateTxPacketsPerFreq(formats); err != nil {
res = append(res, err)
}
if err := m.validateTxPacketsPerStatus(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGatewayMetricsResponse) validateRxPackets(formats strfmt.Registry) error {
if swag.IsZero(m.RxPackets) { // not required
return nil
}
if m.RxPackets != nil {
if err := m.RxPackets.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPackets")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPackets")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) validateRxPacketsPerDr(formats strfmt.Registry) error {
if swag.IsZero(m.RxPacketsPerDr) { // not required
return nil
}
if m.RxPacketsPerDr != nil {
if err := m.RxPacketsPerDr.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerDr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerDr")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) validateRxPacketsPerFreq(formats strfmt.Registry) error {
if swag.IsZero(m.RxPacketsPerFreq) { // not required
return nil
}
if m.RxPacketsPerFreq != nil {
if err := m.RxPacketsPerFreq.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerFreq")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerFreq")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) validateTxPackets(formats strfmt.Registry) error {
if swag.IsZero(m.TxPackets) { // not required
return nil
}
if m.TxPackets != nil {
if err := m.TxPackets.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPackets")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPackets")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) validateTxPacketsPerDr(formats strfmt.Registry) error {
if swag.IsZero(m.TxPacketsPerDr) { // not required
return nil
}
if m.TxPacketsPerDr != nil {
if err := m.TxPacketsPerDr.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPacketsPerDr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPacketsPerDr")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) validateTxPacketsPerFreq(formats strfmt.Registry) error {
if swag.IsZero(m.TxPacketsPerFreq) { // not required
return nil
}
if m.TxPacketsPerFreq != nil {
if err := m.TxPacketsPerFreq.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPacketsPerFreq")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPacketsPerFreq")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) validateTxPacketsPerStatus(formats strfmt.Registry) error {
if swag.IsZero(m.TxPacketsPerStatus) { // not required
return nil
}
if m.TxPacketsPerStatus != nil {
if err := m.TxPacketsPerStatus.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPacketsPerStatus")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPacketsPerStatus")
}
return err
}
}
return nil
}
// ContextValidate validate this api get gateway metrics response based on the context it is used
func (m *APIGetGatewayMetricsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateRxPackets(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRxPacketsPerDr(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRxPacketsPerFreq(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTxPackets(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTxPacketsPerDr(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTxPacketsPerFreq(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTxPacketsPerStatus(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGatewayMetricsResponse) contextValidateRxPackets(ctx context.Context, formats strfmt.Registry) error {
if m.RxPackets != nil {
if swag.IsZero(m.RxPackets) { // not required
return nil
}
if err := m.RxPackets.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPackets")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPackets")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) contextValidateRxPacketsPerDr(ctx context.Context, formats strfmt.Registry) error {
if m.RxPacketsPerDr != nil {
if swag.IsZero(m.RxPacketsPerDr) { // not required
return nil
}
if err := m.RxPacketsPerDr.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerDr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerDr")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) contextValidateRxPacketsPerFreq(ctx context.Context, formats strfmt.Registry) error {
if m.RxPacketsPerFreq != nil {
if swag.IsZero(m.RxPacketsPerFreq) { // not required
return nil
}
if err := m.RxPacketsPerFreq.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rxPacketsPerFreq")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("rxPacketsPerFreq")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) contextValidateTxPackets(ctx context.Context, formats strfmt.Registry) error {
if m.TxPackets != nil {
if swag.IsZero(m.TxPackets) { // not required
return nil
}
if err := m.TxPackets.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPackets")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPackets")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) contextValidateTxPacketsPerDr(ctx context.Context, formats strfmt.Registry) error {
if m.TxPacketsPerDr != nil {
if swag.IsZero(m.TxPacketsPerDr) { // not required
return nil
}
if err := m.TxPacketsPerDr.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPacketsPerDr")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPacketsPerDr")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) contextValidateTxPacketsPerFreq(ctx context.Context, formats strfmt.Registry) error {
if m.TxPacketsPerFreq != nil {
if swag.IsZero(m.TxPacketsPerFreq) { // not required
return nil
}
if err := m.TxPacketsPerFreq.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPacketsPerFreq")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPacketsPerFreq")
}
return err
}
}
return nil
}
func (m *APIGetGatewayMetricsResponse) contextValidateTxPacketsPerStatus(ctx context.Context, formats strfmt.Registry) error {
if m.TxPacketsPerStatus != nil {
if swag.IsZero(m.TxPacketsPerStatus) { // not required
return nil
}
if err := m.TxPacketsPerStatus.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("txPacketsPerStatus")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("txPacketsPerStatus")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetGatewayMetricsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetGatewayMetricsResponse) UnmarshalBinary(b []byte) error {
var res APIGetGatewayMetricsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,170 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetGatewayResponse api get gateway response
//
// swagger:model apiGetGatewayResponse
type APIGetGatewayResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Gateway object.
Gateway *APIGateway `json:"gateway,omitempty"`
// Last seen at timestamp.
// Format: date-time
LastSeenAt strfmt.DateTime `json:"lastSeenAt,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get gateway response
func (m *APIGetGatewayResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateGateway(formats); err != nil {
res = append(res, err)
}
if err := m.validateLastSeenAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGatewayResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetGatewayResponse) validateGateway(formats strfmt.Registry) error {
if swag.IsZero(m.Gateway) { // not required
return nil
}
if m.Gateway != nil {
if err := m.Gateway.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gateway")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gateway")
}
return err
}
}
return nil
}
func (m *APIGetGatewayResponse) validateLastSeenAt(formats strfmt.Registry) error {
if swag.IsZero(m.LastSeenAt) { // not required
return nil
}
if err := validate.FormatOf("lastSeenAt", "body", "date-time", m.LastSeenAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetGatewayResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get gateway response based on the context it is used
func (m *APIGetGatewayResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateGateway(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGatewayResponse) contextValidateGateway(ctx context.Context, formats strfmt.Registry) error {
if m.Gateway != nil {
if swag.IsZero(m.Gateway) { // not required
return nil
}
if err := m.Gateway.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gateway")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gateway")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetGatewayResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetGatewayResponse) UnmarshalBinary(b []byte) error {
var res APIGetGatewayResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetGcpPubSubIntegrationResponse api get gcp pub sub integration response
//
// swagger:model apiGetGcpPubSubIntegrationResponse
type APIGetGcpPubSubIntegrationResponse struct {
// Integration object.
Integration *APIGcpPubSubIntegration `json:"integration,omitempty"`
}
// Validate validates this api get gcp pub sub integration response
func (m *APIGetGcpPubSubIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGcpPubSubIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get gcp pub sub integration response based on the context it is used
func (m *APIGetGcpPubSubIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetGcpPubSubIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetGcpPubSubIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetGcpPubSubIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetGcpPubSubIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetHTTPIntegrationResponse api get Http integration response
//
// swagger:model apiGetHttpIntegrationResponse
type APIGetHTTPIntegrationResponse struct {
// Integration object.
Integration *APIHTTPIntegration `json:"integration,omitempty"`
}
// Validate validates this api get Http integration response
func (m *APIGetHTTPIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetHTTPIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get Http integration response based on the context it is used
func (m *APIGetHTTPIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetHTTPIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetHTTPIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetHTTPIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetHTTPIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetIftttIntegrationResponse api get ifttt integration response
//
// swagger:model apiGetIftttIntegrationResponse
type APIGetIftttIntegrationResponse struct {
// Integration object.
Integration *APIIftttIntegration `json:"integration,omitempty"`
}
// Validate validates this api get ifttt integration response
func (m *APIGetIftttIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetIftttIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get ifttt integration response based on the context it is used
func (m *APIGetIftttIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetIftttIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetIftttIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetIftttIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetIftttIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetInfluxDbIntegrationResponse api get influx db integration response
//
// swagger:model apiGetInfluxDbIntegrationResponse
type APIGetInfluxDbIntegrationResponse struct {
// Integration object.
Integration *APIInfluxDbIntegration `json:"integration,omitempty"`
}
// Validate validates this api get influx db integration response
func (m *APIGetInfluxDbIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetInfluxDbIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get influx db integration response based on the context it is used
func (m *APIGetInfluxDbIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetInfluxDbIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetInfluxDbIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetInfluxDbIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetInfluxDbIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,150 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetMulticastGroupResponse api get multicast group response
//
// swagger:model apiGetMulticastGroupResponse
type APIGetMulticastGroupResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Multicast group object.
MulticastGroup *APIMulticastGroup `json:"multicastGroup,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get multicast group response
func (m *APIGetMulticastGroupResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateMulticastGroup(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetMulticastGroupResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetMulticastGroupResponse) validateMulticastGroup(formats strfmt.Registry) error {
if swag.IsZero(m.MulticastGroup) { // not required
return nil
}
if m.MulticastGroup != nil {
if err := m.MulticastGroup.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("multicastGroup")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("multicastGroup")
}
return err
}
}
return nil
}
func (m *APIGetMulticastGroupResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get multicast group response based on the context it is used
func (m *APIGetMulticastGroupResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMulticastGroup(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetMulticastGroupResponse) contextValidateMulticastGroup(ctx context.Context, formats strfmt.Registry) error {
if m.MulticastGroup != nil {
if swag.IsZero(m.MulticastGroup) { // not required
return nil
}
if err := m.MulticastGroup.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("multicastGroup")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("multicastGroup")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetMulticastGroupResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetMulticastGroupResponse) UnmarshalBinary(b []byte) error {
var res APIGetMulticastGroupResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetMyDevicesIntegrationResponse api get my devices integration response
//
// swagger:model apiGetMyDevicesIntegrationResponse
type APIGetMyDevicesIntegrationResponse struct {
// Integration object.
Integration *APIMyDevicesIntegration `json:"integration,omitempty"`
}
// Validate validates this api get my devices integration response
func (m *APIGetMyDevicesIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetMyDevicesIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get my devices integration response based on the context it is used
func (m *APIGetMyDevicesIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetMyDevicesIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetMyDevicesIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetMyDevicesIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetMyDevicesIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetPilotThingsIntegrationResponse api get pilot things integration response
//
// swagger:model apiGetPilotThingsIntegrationResponse
type APIGetPilotThingsIntegrationResponse struct {
// Integration object.
Integration *APIPilotThingsIntegration `json:"integration,omitempty"`
}
// Validate validates this api get pilot things integration response
func (m *APIGetPilotThingsIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetPilotThingsIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get pilot things integration response based on the context it is used
func (m *APIGetPilotThingsIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetPilotThingsIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetPilotThingsIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetPilotThingsIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetPilotThingsIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,50 @@
// 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"
)
// APIGetRandomDevAddrResponse api get random dev addr response
//
// swagger:model apiGetRandomDevAddrResponse
type APIGetRandomDevAddrResponse struct {
// DevAddr.
DevAddr string `json:"devAddr,omitempty"`
}
// Validate validates this api get random dev addr response
func (m *APIGetRandomDevAddrResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api get random dev addr response based on context it is used
func (m *APIGetRandomDevAddrResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIGetRandomDevAddrResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetRandomDevAddrResponse) UnmarshalBinary(b []byte) error {
var res APIGetRandomDevAddrResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,170 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetRelayGatewayResponse api get relay gateway response
//
// swagger:model apiGetRelayGatewayResponse
type APIGetRelayGatewayResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Last seen at timestamp.
// Format: date-time
LastSeenAt strfmt.DateTime `json:"lastSeenAt,omitempty"`
// Relay Gateway object.
RelayGateway *APIRelayGateway `json:"relayGateway,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get relay gateway response
func (m *APIGetRelayGatewayResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateLastSeenAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateRelayGateway(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetRelayGatewayResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetRelayGatewayResponse) validateLastSeenAt(formats strfmt.Registry) error {
if swag.IsZero(m.LastSeenAt) { // not required
return nil
}
if err := validate.FormatOf("lastSeenAt", "body", "date-time", m.LastSeenAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetRelayGatewayResponse) validateRelayGateway(formats strfmt.Registry) error {
if swag.IsZero(m.RelayGateway) { // not required
return nil
}
if m.RelayGateway != nil {
if err := m.RelayGateway.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relayGateway")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relayGateway")
}
return err
}
}
return nil
}
func (m *APIGetRelayGatewayResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get relay gateway response based on the context it is used
func (m *APIGetRelayGatewayResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateRelayGateway(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetRelayGatewayResponse) contextValidateRelayGateway(ctx context.Context, formats strfmt.Registry) error {
if m.RelayGateway != nil {
if swag.IsZero(m.RelayGateway) { // not required
return nil
}
if err := m.RelayGateway.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("relayGateway")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("relayGateway")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetRelayGatewayResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetRelayGatewayResponse) UnmarshalBinary(b []byte) error {
var res APIGetRelayGatewayResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,150 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetTenantResponse api get tenant response
//
// swagger:model apiGetTenantResponse
type APIGetTenantResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Tenant object.
Tenant *APITenant `json:"tenant,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get tenant response
func (m *APIGetTenantResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateTenant(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetTenantResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetTenantResponse) validateTenant(formats strfmt.Registry) error {
if swag.IsZero(m.Tenant) { // not required
return nil
}
if m.Tenant != nil {
if err := m.Tenant.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenant")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenant")
}
return err
}
}
return nil
}
func (m *APIGetTenantResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get tenant response based on the context it is used
func (m *APIGetTenantResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTenant(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetTenantResponse) contextValidateTenant(ctx context.Context, formats strfmt.Registry) error {
if m.Tenant != nil {
if swag.IsZero(m.Tenant) { // not required
return nil
}
if err := m.Tenant.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenant")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenant")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetTenantResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetTenantResponse) UnmarshalBinary(b []byte) error {
var res APIGetTenantResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,150 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetTenantUserResponse api get tenant user response
//
// swagger:model apiGetTenantUserResponse
type APIGetTenantUserResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Tenant user object.
TenantUser *APITenantUser `json:"tenantUser,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api get tenant user response
func (m *APIGetTenantUserResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateTenantUser(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetTenantUserResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetTenantUserResponse) validateTenantUser(formats strfmt.Registry) error {
if swag.IsZero(m.TenantUser) { // not required
return nil
}
if m.TenantUser != nil {
if err := m.TenantUser.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantUser")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenantUser")
}
return err
}
}
return nil
}
func (m *APIGetTenantUserResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api get tenant user response based on the context it is used
func (m *APIGetTenantUserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTenantUser(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetTenantUserResponse) contextValidateTenantUser(ctx context.Context, formats strfmt.Registry) error {
if m.TenantUser != nil {
if swag.IsZero(m.TenantUser) { // not required
return nil
}
if err := m.TenantUser.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenantUser")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenantUser")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetTenantUserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetTenantUserResponse) UnmarshalBinary(b []byte) error {
var res APIGetTenantUserResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIGetThingsBoardIntegrationResponse api get things board integration response
//
// swagger:model apiGetThingsBoardIntegrationResponse
type APIGetThingsBoardIntegrationResponse struct {
// Integration object.
Integration *APIThingsBoardIntegration `json:"integration,omitempty"`
}
// Validate validates this api get things board integration response
func (m *APIGetThingsBoardIntegrationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateIntegration(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetThingsBoardIntegrationResponse) validateIntegration(formats strfmt.Registry) error {
if swag.IsZero(m.Integration) { // not required
return nil
}
if m.Integration != nil {
if err := m.Integration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// ContextValidate validate this api get things board integration response based on the context it is used
func (m *APIGetThingsBoardIntegrationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateIntegration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetThingsBoardIntegrationResponse) contextValidateIntegration(ctx context.Context, formats strfmt.Registry) error {
if m.Integration != nil {
if swag.IsZero(m.Integration) { // not required
return nil
}
if err := m.Integration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("integration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("integration")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetThingsBoardIntegrationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetThingsBoardIntegrationResponse) UnmarshalBinary(b []byte) error {
var res APIGetThingsBoardIntegrationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,150 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIGetUserResponse api get user response
//
// swagger:model apiGetUserResponse
type APIGetUserResponse struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
// User object.
User *APIUser `json:"user,omitempty"`
}
// Validate validates this api get user response
func (m *APIGetUserResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUser(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetUserResponse) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetUserResponse) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIGetUserResponse) validateUser(formats strfmt.Registry) error {
if swag.IsZero(m.User) { // not required
return nil
}
if m.User != nil {
if err := m.User.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("user")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("user")
}
return err
}
}
return nil
}
// ContextValidate validate this api get user response based on the context it is used
func (m *APIGetUserResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateUser(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIGetUserResponse) contextValidateUser(ctx context.Context, formats strfmt.Registry) error {
if m.User != nil {
if swag.IsZero(m.User) { // not required
return nil
}
if err := m.User.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("user")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("user")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIGetUserResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIGetUserResponse) UnmarshalBinary(b []byte) error {
var res APIGetUserResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,121 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIHTTPIntegration api Http integration
//
// swagger:model apiHttpIntegration
type APIHTTPIntegration struct {
// Application ID (UUID).
ApplicationID string `json:"applicationId,omitempty"`
// Payload encoding.
Encoding *APIEncoding `json:"encoding,omitempty"`
// Event endpoint URL.
// The HTTP integration will POST all events to this enpoint. The request
// will contain a query parameters "event" containing the type of the
// event.
EventEndpointURL string `json:"eventEndpointUrl,omitempty"`
// HTTP headers to set when making requests.
Headers map[string]string `json:"headers,omitempty"`
}
// Validate validates this api Http integration
func (m *APIHTTPIntegration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEncoding(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIHTTPIntegration) validateEncoding(formats strfmt.Registry) error {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if m.Encoding != nil {
if err := m.Encoding.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// ContextValidate validate this api Http integration based on the context it is used
func (m *APIHTTPIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEncoding(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIHTTPIntegration) contextValidateEncoding(ctx context.Context, formats strfmt.Registry) error {
if m.Encoding != nil {
if swag.IsZero(m.Encoding) { // not required
return nil
}
if err := m.Encoding.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encoding")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encoding")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIHTTPIntegration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIHTTPIntegration) UnmarshalBinary(b []byte) error {
var res APIHTTPIntegration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,77 @@
// 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 webhook.
// 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
}

View File

@@ -0,0 +1,187 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIInfluxDbIntegration api influx db integration
//
// swagger:model apiInfluxDbIntegration
type APIInfluxDbIntegration struct {
// Application ID (UUID).
ApplicationID string `json:"applicationId,omitempty"`
// Bucket. (InfluxDb v2)
Bucket string `json:"bucket,omitempty"`
// InfluxDb database name. (InfluxDb v1)
Db string `json:"db,omitempty"`
// InfluxDb API write endpoint (e.g. http://localhost:8086/write).
Endpoint string `json:"endpoint,omitempty"`
// Organization. (InfluxDb v2)
Organization string `json:"organization,omitempty"`
// InfluxDb password. (InfluxDb v1)
Password string `json:"password,omitempty"`
// InfluxDb timestamp precision (InfluxDb v1).
Precision *APIInfluxDbPrecision `json:"precision,omitempty"`
// InfluxDb retention policy name. (InfluxDb v1)
RetentionPolicyName string `json:"retentionPolicyName,omitempty"`
// Token. (InfluxDb v2)
Token string `json:"token,omitempty"`
// InfluxDb username. (InfluxDb v1)
Username string `json:"username,omitempty"`
// InfluxDb version.
Version *APIInfluxDbVersion `json:"version,omitempty"`
}
// Validate validates this api influx db integration
func (m *APIInfluxDbIntegration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePrecision(formats); err != nil {
res = append(res, err)
}
if err := m.validateVersion(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIInfluxDbIntegration) validatePrecision(formats strfmt.Registry) error {
if swag.IsZero(m.Precision) { // not required
return nil
}
if m.Precision != nil {
if err := m.Precision.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("precision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("precision")
}
return err
}
}
return nil
}
func (m *APIInfluxDbIntegration) validateVersion(formats strfmt.Registry) error {
if swag.IsZero(m.Version) { // not required
return nil
}
if m.Version != nil {
if err := m.Version.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("version")
}
return err
}
}
return nil
}
// ContextValidate validate this api influx db integration based on the context it is used
func (m *APIInfluxDbIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidatePrecision(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateVersion(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIInfluxDbIntegration) contextValidatePrecision(ctx context.Context, formats strfmt.Registry) error {
if m.Precision != nil {
if swag.IsZero(m.Precision) { // not required
return nil
}
if err := m.Precision.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("precision")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("precision")
}
return err
}
}
return nil
}
func (m *APIInfluxDbIntegration) contextValidateVersion(ctx context.Context, formats strfmt.Registry) error {
if m.Version != nil {
if swag.IsZero(m.Version) { // not required
return nil
}
if err := m.Version.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("version")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("version")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIInfluxDbIntegration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIInfluxDbIntegration) UnmarshalBinary(b []byte) error {
var res APIInfluxDbIntegration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,90 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIInfluxDbPrecision api influx db precision
//
// swagger:model apiInfluxDbPrecision
type APIInfluxDbPrecision string
func NewAPIInfluxDbPrecision(value APIInfluxDbPrecision) *APIInfluxDbPrecision {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIInfluxDbPrecision.
func (m APIInfluxDbPrecision) Pointer() *APIInfluxDbPrecision {
return &m
}
const (
// APIInfluxDbPrecisionNS captures enum value "NS"
APIInfluxDbPrecisionNS APIInfluxDbPrecision = "NS"
// APIInfluxDbPrecisionU captures enum value "U"
APIInfluxDbPrecisionU APIInfluxDbPrecision = "U"
// APIInfluxDbPrecisionMS captures enum value "MS"
APIInfluxDbPrecisionMS APIInfluxDbPrecision = "MS"
// APIInfluxDbPrecisionS captures enum value "S"
APIInfluxDbPrecisionS APIInfluxDbPrecision = "S"
// APIInfluxDbPrecisionM captures enum value "M"
APIInfluxDbPrecisionM APIInfluxDbPrecision = "M"
// APIInfluxDbPrecisionH captures enum value "H"
APIInfluxDbPrecisionH APIInfluxDbPrecision = "H"
)
// for schema
var apiInfluxDbPrecisionEnum []interface{}
func init() {
var res []APIInfluxDbPrecision
if err := json.Unmarshal([]byte(`["NS","U","MS","S","M","H"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiInfluxDbPrecisionEnum = append(apiInfluxDbPrecisionEnum, v)
}
}
func (m APIInfluxDbPrecision) validateAPIInfluxDbPrecisionEnum(path, location string, value APIInfluxDbPrecision) error {
if err := validate.EnumCase(path, location, value, apiInfluxDbPrecisionEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api influx db precision
func (m APIInfluxDbPrecision) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIInfluxDbPrecisionEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api influx db precision based on context it is used
func (m APIInfluxDbPrecision) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,78 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIInfluxDbVersion api influx db version
//
// swagger:model apiInfluxDbVersion
type APIInfluxDbVersion string
func NewAPIInfluxDbVersion(value APIInfluxDbVersion) *APIInfluxDbVersion {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIInfluxDbVersion.
func (m APIInfluxDbVersion) Pointer() *APIInfluxDbVersion {
return &m
}
const (
// APIInfluxDbVersionINFLUXDB1 captures enum value "INFLUXDB_1"
APIInfluxDbVersionINFLUXDB1 APIInfluxDbVersion = "INFLUXDB_1"
// APIInfluxDbVersionINFLUXDB2 captures enum value "INFLUXDB_2"
APIInfluxDbVersionINFLUXDB2 APIInfluxDbVersion = "INFLUXDB_2"
)
// for schema
var apiInfluxDbVersionEnum []interface{}
func init() {
var res []APIInfluxDbVersion
if err := json.Unmarshal([]byte(`["INFLUXDB_1","INFLUXDB_2"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiInfluxDbVersionEnum = append(apiInfluxDbVersionEnum, v)
}
}
func (m APIInfluxDbVersion) validateAPIInfluxDbVersionEnum(path, location string, value APIInfluxDbVersion) error {
if err := validate.EnumCase(path, location, value, apiInfluxDbVersionEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api influx db version
func (m APIInfluxDbVersion) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIInfluxDbVersionEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api influx db version based on context it is used
func (m APIInfluxDbVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,102 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIIntegrationKind api integration kind
//
// swagger:model apiIntegrationKind
type APIIntegrationKind string
func NewAPIIntegrationKind(value APIIntegrationKind) *APIIntegrationKind {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIIntegrationKind.
func (m APIIntegrationKind) Pointer() *APIIntegrationKind {
return &m
}
const (
// APIIntegrationKindHTTP captures enum value "HTTP"
APIIntegrationKindHTTP APIIntegrationKind = "HTTP"
// APIIntegrationKindINFLUXDB captures enum value "INFLUX_DB"
APIIntegrationKindINFLUXDB APIIntegrationKind = "INFLUX_DB"
// APIIntegrationKindTHINGSBOARD captures enum value "THINGS_BOARD"
APIIntegrationKindTHINGSBOARD APIIntegrationKind = "THINGS_BOARD"
// APIIntegrationKindMYDEVICES captures enum value "MY_DEVICES"
APIIntegrationKindMYDEVICES APIIntegrationKind = "MY_DEVICES"
// APIIntegrationKindGCPPUBSUB captures enum value "GCP_PUB_SUB"
APIIntegrationKindGCPPUBSUB APIIntegrationKind = "GCP_PUB_SUB"
// APIIntegrationKindAWSSNS captures enum value "AWS_SNS"
APIIntegrationKindAWSSNS APIIntegrationKind = "AWS_SNS"
// APIIntegrationKindAZURESERVICEBUS captures enum value "AZURE_SERVICE_BUS"
APIIntegrationKindAZURESERVICEBUS APIIntegrationKind = "AZURE_SERVICE_BUS"
// APIIntegrationKindPILOTTHINGS captures enum value "PILOT_THINGS"
APIIntegrationKindPILOTTHINGS APIIntegrationKind = "PILOT_THINGS"
// APIIntegrationKindMQTTGLOBAL captures enum value "MQTT_GLOBAL"
APIIntegrationKindMQTTGLOBAL APIIntegrationKind = "MQTT_GLOBAL"
// APIIntegrationKindIFTTT captures enum value "IFTTT"
APIIntegrationKindIFTTT APIIntegrationKind = "IFTTT"
)
// for schema
var apiIntegrationKindEnum []interface{}
func init() {
var res []APIIntegrationKind
if err := json.Unmarshal([]byte(`["HTTP","INFLUX_DB","THINGS_BOARD","MY_DEVICES","GCP_PUB_SUB","AWS_SNS","AZURE_SERVICE_BUS","PILOT_THINGS","MQTT_GLOBAL","IFTTT"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiIntegrationKindEnum = append(apiIntegrationKindEnum, v)
}
}
func (m APIIntegrationKind) validateAPIIntegrationKindEnum(path, location string, value APIIntegrationKind) error {
if err := validate.EnumCase(path, location, value, apiIntegrationKindEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api integration kind
func (m APIIntegrationKind) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIIntegrationKindEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api integration kind based on context it is used
func (m APIIntegrationKind) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,109 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIIntegrationListItem api integration list item
//
// swagger:model apiIntegrationListItem
type APIIntegrationListItem struct {
// Integration kind.
Kind *APIIntegrationKind `json:"kind,omitempty"`
}
// Validate validates this api integration list item
func (m *APIIntegrationListItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKind(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIIntegrationListItem) validateKind(formats strfmt.Registry) error {
if swag.IsZero(m.Kind) { // not required
return nil
}
if m.Kind != nil {
if err := m.Kind.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kind")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kind")
}
return err
}
}
return nil
}
// ContextValidate validate this api integration list item based on the context it is used
func (m *APIIntegrationListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateKind(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIIntegrationListItem) contextValidateKind(ctx context.Context, formats strfmt.Registry) error {
if m.Kind != nil {
if swag.IsZero(m.Kind) { // not required
return nil
}
if err := m.Kind.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kind")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kind")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIIntegrationListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIIntegrationListItem) UnmarshalBinary(b []byte) error {
var res APIIntegrationListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,121 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListApplicationDeviceProfilesResponse api list application device profiles response
//
// swagger:model apiListApplicationDeviceProfilesResponse
type APIListApplicationDeviceProfilesResponse struct {
// Device-profiles.
Result []*APIApplicationDeviceProfileListItem `json:"result"`
}
// Validate validates this api list application device profiles response
func (m *APIListApplicationDeviceProfilesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListApplicationDeviceProfilesResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list application device profiles response based on the context it is used
func (m *APIListApplicationDeviceProfilesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListApplicationDeviceProfilesResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListApplicationDeviceProfilesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListApplicationDeviceProfilesResponse) UnmarshalBinary(b []byte) error {
var res APIListApplicationDeviceProfilesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,121 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListApplicationDeviceTagsResponse api list application device tags response
//
// swagger:model apiListApplicationDeviceTagsResponse
type APIListApplicationDeviceTagsResponse struct {
// Device tags.
Result []*APIApplicationDeviceTagListItem `json:"result"`
}
// Validate validates this api list application device tags response
func (m *APIListApplicationDeviceTagsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListApplicationDeviceTagsResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list application device tags response based on the context it is used
func (m *APIListApplicationDeviceTagsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListApplicationDeviceTagsResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListApplicationDeviceTagsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListApplicationDeviceTagsResponse) UnmarshalBinary(b []byte) error {
var res APIListApplicationDeviceTagsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListApplicationsResponse api list applications response
//
// swagger:model apiListApplicationsResponse
type APIListApplicationsResponse struct {
// Result-set.
Result []*APIApplicationListItem `json:"result"`
// Total number of applications.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list applications response
func (m *APIListApplicationsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListApplicationsResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list applications response based on the context it is used
func (m *APIListApplicationsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListApplicationsResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListApplicationsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListApplicationsResponse) UnmarshalBinary(b []byte) error {
var res APIListApplicationsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListDeviceProfileAdrAlgorithmsResponse api list device profile adr algorithms response
//
// swagger:model apiListDeviceProfileAdrAlgorithmsResponse
type APIListDeviceProfileAdrAlgorithmsResponse struct {
// Result-set.
Result []*APIAdrAlgorithmListItem `json:"result"`
// Total number of algorithms.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list device profile adr algorithms response
func (m *APIListDeviceProfileAdrAlgorithmsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDeviceProfileAdrAlgorithmsResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list device profile adr algorithms response based on the context it is used
func (m *APIListDeviceProfileAdrAlgorithmsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDeviceProfileAdrAlgorithmsResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListDeviceProfileAdrAlgorithmsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListDeviceProfileAdrAlgorithmsResponse) UnmarshalBinary(b []byte) error {
var res APIListDeviceProfileAdrAlgorithmsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListDeviceProfileTemplatesResponse api list device profile templates response
//
// swagger:model apiListDeviceProfileTemplatesResponse
type APIListDeviceProfileTemplatesResponse struct {
// Result-set.
Result []*APIDeviceProfileTemplateListItem `json:"result"`
// Total number of device-profile templates.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list device profile templates response
func (m *APIListDeviceProfileTemplatesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDeviceProfileTemplatesResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list device profile templates response based on the context it is used
func (m *APIListDeviceProfileTemplatesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDeviceProfileTemplatesResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListDeviceProfileTemplatesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListDeviceProfileTemplatesResponse) UnmarshalBinary(b []byte) error {
var res APIListDeviceProfileTemplatesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListDeviceProfilesResponse api list device profiles response
//
// swagger:model apiListDeviceProfilesResponse
type APIListDeviceProfilesResponse struct {
// Result-set.
Result []*APIDeviceProfileListItem `json:"result"`
// Total number of device-profiles.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list device profiles response
func (m *APIListDeviceProfilesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDeviceProfilesResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list device profiles response based on the context it is used
func (m *APIListDeviceProfilesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDeviceProfilesResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListDeviceProfilesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListDeviceProfilesResponse) UnmarshalBinary(b []byte) error {
var res APIListDeviceProfilesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListDevicesResponse api list devices response
//
// swagger:model apiListDevicesResponse
type APIListDevicesResponse struct {
// Result-set.
Result []*APIDeviceListItem `json:"result"`
// Total number of devices.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list devices response
func (m *APIListDevicesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDevicesResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list devices response based on the context it is used
func (m *APIListDevicesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListDevicesResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListDevicesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListDevicesResponse) UnmarshalBinary(b []byte) error {
var res APIListDevicesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListGatewaysResponse api list gateways response
//
// swagger:model apiListGatewaysResponse
type APIListGatewaysResponse struct {
// Result-set.
Result []*APIGatewayListItem `json:"result"`
// Total number of gateways.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list gateways response
func (m *APIListGatewaysResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListGatewaysResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list gateways response based on the context it is used
func (m *APIListGatewaysResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListGatewaysResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListGatewaysResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListGatewaysResponse) UnmarshalBinary(b []byte) error {
var res APIListGatewaysResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListIntegrationsResponse api list integrations response
//
// swagger:model apiListIntegrationsResponse
type APIListIntegrationsResponse struct {
// Integrations within result-set.
Result []*APIIntegrationListItem `json:"result"`
// Total number of integrations available within the result-set.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list integrations response
func (m *APIListIntegrationsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListIntegrationsResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list integrations response based on the context it is used
func (m *APIListIntegrationsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListIntegrationsResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListIntegrationsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListIntegrationsResponse) UnmarshalBinary(b []byte) error {
var res APIListIntegrationsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,121 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListMulticastGroupQueueResponse api list multicast group queue response
//
// swagger:model apiListMulticastGroupQueueResponse
type APIListMulticastGroupQueueResponse struct {
// items
Items []*APIMulticastGroupQueueItem `json:"items"`
}
// Validate validates this api list multicast group queue response
func (m *APIListMulticastGroupQueueResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateItems(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListMulticastGroupQueueResponse) validateItems(formats strfmt.Registry) error {
if swag.IsZero(m.Items) { // not required
return nil
}
for i := 0; i < len(m.Items); i++ {
if swag.IsZero(m.Items[i]) { // not required
continue
}
if m.Items[i] != nil {
if err := m.Items[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("items" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("items" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list multicast group queue response based on the context it is used
func (m *APIListMulticastGroupQueueResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateItems(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListMulticastGroupQueueResponse) contextValidateItems(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Items); i++ {
if m.Items[i] != nil {
if swag.IsZero(m.Items[i]) { // not required
return nil
}
if err := m.Items[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("items" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("items" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListMulticastGroupQueueResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListMulticastGroupQueueResponse) UnmarshalBinary(b []byte) error {
var res APIListMulticastGroupQueueResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListMulticastGroupsResponse api list multicast groups response
//
// swagger:model apiListMulticastGroupsResponse
type APIListMulticastGroupsResponse struct {
// Result-test.
Result []*APIMulticastGroupListItem `json:"result"`
// Total number of multicast groups.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list multicast groups response
func (m *APIListMulticastGroupsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListMulticastGroupsResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list multicast groups response based on the context it is used
func (m *APIListMulticastGroupsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListMulticastGroupsResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListMulticastGroupsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListMulticastGroupsResponse) UnmarshalBinary(b []byte) error {
var res APIListMulticastGroupsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListRelayGatewaysResponse api list relay gateways response
//
// swagger:model apiListRelayGatewaysResponse
type APIListRelayGatewaysResponse struct {
// Result-set.
Result []*APIRelayGatewayListItem `json:"result"`
// Total number of relay-gateways.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list relay gateways response
func (m *APIListRelayGatewaysResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListRelayGatewaysResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list relay gateways response based on the context it is used
func (m *APIListRelayGatewaysResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListRelayGatewaysResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListRelayGatewaysResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListRelayGatewaysResponse) UnmarshalBinary(b []byte) error {
var res APIListRelayGatewaysResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListTenantUsersResponse api list tenant users response
//
// swagger:model apiListTenantUsersResponse
type APIListTenantUsersResponse struct {
// Result-set.
Result []*APITenantUserListItem `json:"result"`
// Total number of tenants.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list tenant users response
func (m *APIListTenantUsersResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListTenantUsersResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list tenant users response based on the context it is used
func (m *APIListTenantUsersResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListTenantUsersResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListTenantUsersResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListTenantUsersResponse) UnmarshalBinary(b []byte) error {
var res APIListTenantUsersResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListTenantsResponse api list tenants response
//
// swagger:model apiListTenantsResponse
type APIListTenantsResponse struct {
// Result-set.
Result []*APITenantListItem `json:"result"`
// Total number of tenants.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list tenants response
func (m *APIListTenantsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListTenantsResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list tenants response based on the context it is used
func (m *APIListTenantsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListTenantsResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListTenantsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListTenantsResponse) UnmarshalBinary(b []byte) error {
var res APIListTenantsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,124 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIListUsersResponse api list users response
//
// swagger:model apiListUsersResponse
type APIListUsersResponse struct {
// Result-set.
Result []*APIUserListItem `json:"result"`
// Total number of users.
TotalCount int64 `json:"totalCount,omitempty"`
}
// Validate validates this api list users response
func (m *APIListUsersResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResult(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListUsersResponse) validateResult(formats strfmt.Registry) error {
if swag.IsZero(m.Result) { // not required
return nil
}
for i := 0; i < len(m.Result); i++ {
if swag.IsZero(m.Result[i]) { // not required
continue
}
if m.Result[i] != nil {
if err := m.Result[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this api list users response based on the context it is used
func (m *APIListUsersResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResult(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIListUsersResponse) contextValidateResult(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("result" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIListUsersResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIListUsersResponse) UnmarshalBinary(b []byte) error {
var res APIListUsersResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,112 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIMeasurement api measurement
//
// swagger:model apiMeasurement
type APIMeasurement struct {
// Kind.
Kind *APIMeasurementKind `json:"kind,omitempty"`
// Name (user defined).
Name string `json:"name,omitempty"`
}
// Validate validates this api measurement
func (m *APIMeasurement) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKind(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIMeasurement) validateKind(formats strfmt.Registry) error {
if swag.IsZero(m.Kind) { // not required
return nil
}
if m.Kind != nil {
if err := m.Kind.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kind")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kind")
}
return err
}
}
return nil
}
// ContextValidate validate this api measurement based on the context it is used
func (m *APIMeasurement) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateKind(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIMeasurement) contextValidateKind(ctx context.Context, formats strfmt.Registry) error {
if m.Kind != nil {
if swag.IsZero(m.Kind) { // not required
return nil
}
if err := m.Kind.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kind")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kind")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIMeasurement) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIMeasurement) UnmarshalBinary(b []byte) error {
var res APIMeasurement
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,93 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIMeasurementKind - UNKNOWN: Unknown (in which case it is not tracked).
// - COUNTER: Incrementing counters that never decrease (these are not reset on each
//
// reading).
// - ABSOLUTE: Counters that do get reset upon reading.
// - GAUGE: E.g. a temperature value.
// - STRING: E.g. a firmware version, true / false value.
//
// swagger:model apiMeasurementKind
type APIMeasurementKind string
func NewAPIMeasurementKind(value APIMeasurementKind) *APIMeasurementKind {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIMeasurementKind.
func (m APIMeasurementKind) Pointer() *APIMeasurementKind {
return &m
}
const (
// APIMeasurementKindUNKNOWN captures enum value "UNKNOWN"
APIMeasurementKindUNKNOWN APIMeasurementKind = "UNKNOWN"
// APIMeasurementKindCOUNTER captures enum value "COUNTER"
APIMeasurementKindCOUNTER APIMeasurementKind = "COUNTER"
// APIMeasurementKindABSOLUTE captures enum value "ABSOLUTE"
APIMeasurementKindABSOLUTE APIMeasurementKind = "ABSOLUTE"
// APIMeasurementKindGAUGE captures enum value "GAUGE"
APIMeasurementKindGAUGE APIMeasurementKind = "GAUGE"
// APIMeasurementKindSTRING captures enum value "STRING"
APIMeasurementKindSTRING APIMeasurementKind = "STRING"
)
// for schema
var apiMeasurementKindEnum []interface{}
func init() {
var res []APIMeasurementKind
if err := json.Unmarshal([]byte(`["UNKNOWN","COUNTER","ABSOLUTE","GAUGE","STRING"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiMeasurementKindEnum = append(apiMeasurementKindEnum, v)
}
}
func (m APIMeasurementKind) validateAPIMeasurementKindEnum(path, location string, value APIMeasurementKind) error {
if err := validate.EnumCase(path, location, value, apiMeasurementKindEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api measurement kind
func (m APIMeasurementKind) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIMeasurementKindEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api measurement kind based on context it is used
func (m APIMeasurementKind) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,250 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// APIMulticastGroup api multicast group
//
// swagger:model apiMulticastGroup
type APIMulticastGroup struct {
// Application ID.
// After creation, this can not be updated.
ApplicationID string `json:"applicationId,omitempty"`
// Class-B ping-slot periodicity (only for Class-B).
// Valid options are: 0 - 7.
//
// Number of ping-slots per beacon-period:
// pingNb = 2^(7-periodicity)
//
// Periodicity: 0 = 128 ping-slots per beacon period = ~ every 1 sec
// Periodicity: 7 = 1 ping-slot per beacon period = ~ every 128 sec
ClassBPingSlotPeriodicity int64 `json:"classBPingSlotPeriodicity,omitempty"`
// Scheduling type (only for Class-C).
ClassCSchedulingType *APIMulticastGroupSchedulingType `json:"classCSchedulingType,omitempty"`
// Data-rate.
Dr int64 `json:"dr,omitempty"`
// Frame-counter.
FCnt int64 `json:"fCnt,omitempty"`
// Frequency (Hz).
Frequency int64 `json:"frequency,omitempty"`
// Multicast group type.
GroupType *APIMulticastGroupType `json:"groupType,omitempty"`
// ID (UUID).
// This will be generated automatically on create.
ID string `json:"id,omitempty"`
// Multicast address (HEX encoded DevAddr).
McAddr string `json:"mcAddr,omitempty"`
// Multicast application session key (HEX encoded AES128 key).
McAppSKey string `json:"mcAppSKey,omitempty"`
// Multicast network session key (HEX encoded AES128 key).
McNwkSKey string `json:"mcNwkSKey,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Region.
Region *CommonRegion `json:"region,omitempty"`
}
// Validate validates this api multicast group
func (m *APIMulticastGroup) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateClassCSchedulingType(formats); err != nil {
res = append(res, err)
}
if err := m.validateGroupType(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegion(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIMulticastGroup) validateClassCSchedulingType(formats strfmt.Registry) error {
if swag.IsZero(m.ClassCSchedulingType) { // not required
return nil
}
if m.ClassCSchedulingType != nil {
if err := m.ClassCSchedulingType.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("classCSchedulingType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("classCSchedulingType")
}
return err
}
}
return nil
}
func (m *APIMulticastGroup) validateGroupType(formats strfmt.Registry) error {
if swag.IsZero(m.GroupType) { // not required
return nil
}
if m.GroupType != nil {
if err := m.GroupType.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("groupType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("groupType")
}
return err
}
}
return nil
}
func (m *APIMulticastGroup) validateRegion(formats strfmt.Registry) error {
if swag.IsZero(m.Region) { // not required
return nil
}
if m.Region != nil {
if err := m.Region.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
// ContextValidate validate this api multicast group based on the context it is used
func (m *APIMulticastGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateClassCSchedulingType(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGroupType(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegion(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIMulticastGroup) contextValidateClassCSchedulingType(ctx context.Context, formats strfmt.Registry) error {
if m.ClassCSchedulingType != nil {
if swag.IsZero(m.ClassCSchedulingType) { // not required
return nil
}
if err := m.ClassCSchedulingType.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("classCSchedulingType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("classCSchedulingType")
}
return err
}
}
return nil
}
func (m *APIMulticastGroup) contextValidateGroupType(ctx context.Context, formats strfmt.Registry) error {
if m.GroupType != nil {
if swag.IsZero(m.GroupType) { // not required
return nil
}
if err := m.GroupType.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("groupType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("groupType")
}
return err
}
}
return nil
}
func (m *APIMulticastGroup) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error {
if m.Region != nil {
if swag.IsZero(m.Region) { // not required
return nil
}
if err := m.Region.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIMulticastGroup) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIMulticastGroup) UnmarshalBinary(b []byte) error {
var res APIMulticastGroup
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,207 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIMulticastGroupListItem api multicast group list item
//
// swagger:model apiMulticastGroupListItem
type APIMulticastGroupListItem struct {
// Created at timestamp.
// Format: date-time
CreatedAt strfmt.DateTime `json:"createdAt,omitempty"`
// Multicast group type.
GroupType *APIMulticastGroupType `json:"groupType,omitempty"`
// ID.
ID string `json:"id,omitempty"`
// Name.
Name string `json:"name,omitempty"`
// Region.
Region *CommonRegion `json:"region,omitempty"`
// Last update timestamp.
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"`
}
// Validate validates this api multicast group list item
func (m *APIMulticastGroupListItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateGroupType(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegion(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIMulticastGroupListItem) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *APIMulticastGroupListItem) validateGroupType(formats strfmt.Registry) error {
if swag.IsZero(m.GroupType) { // not required
return nil
}
if m.GroupType != nil {
if err := m.GroupType.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("groupType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("groupType")
}
return err
}
}
return nil
}
func (m *APIMulticastGroupListItem) validateRegion(formats strfmt.Registry) error {
if swag.IsZero(m.Region) { // not required
return nil
}
if m.Region != nil {
if err := m.Region.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
func (m *APIMulticastGroupListItem) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this api multicast group list item based on the context it is used
func (m *APIMulticastGroupListItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateGroupType(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateRegion(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIMulticastGroupListItem) contextValidateGroupType(ctx context.Context, formats strfmt.Registry) error {
if m.GroupType != nil {
if swag.IsZero(m.GroupType) { // not required
return nil
}
if err := m.GroupType.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("groupType")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("groupType")
}
return err
}
}
return nil
}
func (m *APIMulticastGroupListItem) contextValidateRegion(ctx context.Context, formats strfmt.Registry) error {
if m.Region != nil {
if swag.IsZero(m.Region) { // not required
return nil
}
if err := m.Region.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("region")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("region")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *APIMulticastGroupListItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIMulticastGroupListItem) UnmarshalBinary(b []byte) error {
var res APIMulticastGroupListItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,89 @@
// 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// APIMulticastGroupQueueItem api multicast group queue item
//
// swagger:model apiMulticastGroupQueueItem
type APIMulticastGroupQueueItem struct {
// Payload.
// Format: byte
Data strfmt.Base64 `json:"data,omitempty"`
// Expires at (optional).
// Expired queue-items will be automatically removed from the queue.
// Format: date-time
ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"`
// Downlink frame-counter.
// This will be automatically set on enqueue.
FCnt int64 `json:"fCnt,omitempty"`
// FPort (must be > 0).
FPort int64 `json:"fPort,omitempty"`
// Multicast group ID.
MulticastGroupID string `json:"multicastGroupId,omitempty"`
}
// Validate validates this api multicast group queue item
func (m *APIMulticastGroupQueueItem) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateExpiresAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *APIMulticastGroupQueueItem) validateExpiresAt(formats strfmt.Registry) error {
if swag.IsZero(m.ExpiresAt) { // not required
return nil
}
if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this api multicast group queue item based on context it is used
func (m *APIMulticastGroupQueueItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIMulticastGroupQueueItem) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIMulticastGroupQueueItem) UnmarshalBinary(b []byte) error {
var res APIMulticastGroupQueueItem
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,85 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIMulticastGroupSchedulingType - DELAY: Delay.
// If multicast downlinks must be sent through multiple gateways, then
// these will be sent one by one with a delay between each gateway.
// - GPS_TIME: Time.
//
// If multicast downlinks must be sent through multiple gateways, then
// these will be sent simultaneously using GPS time synchronization.
// Note that this does require GPS time-synchronized LoRa gateways.
//
// swagger:model apiMulticastGroupSchedulingType
type APIMulticastGroupSchedulingType string
func NewAPIMulticastGroupSchedulingType(value APIMulticastGroupSchedulingType) *APIMulticastGroupSchedulingType {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIMulticastGroupSchedulingType.
func (m APIMulticastGroupSchedulingType) Pointer() *APIMulticastGroupSchedulingType {
return &m
}
const (
// APIMulticastGroupSchedulingTypeDELAY captures enum value "DELAY"
APIMulticastGroupSchedulingTypeDELAY APIMulticastGroupSchedulingType = "DELAY"
// APIMulticastGroupSchedulingTypeGPSTIME captures enum value "GPS_TIME"
APIMulticastGroupSchedulingTypeGPSTIME APIMulticastGroupSchedulingType = "GPS_TIME"
)
// for schema
var apiMulticastGroupSchedulingTypeEnum []interface{}
func init() {
var res []APIMulticastGroupSchedulingType
if err := json.Unmarshal([]byte(`["DELAY","GPS_TIME"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiMulticastGroupSchedulingTypeEnum = append(apiMulticastGroupSchedulingTypeEnum, v)
}
}
func (m APIMulticastGroupSchedulingType) validateAPIMulticastGroupSchedulingTypeEnum(path, location string, value APIMulticastGroupSchedulingType) error {
if err := validate.EnumCase(path, location, value, apiMulticastGroupSchedulingTypeEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api multicast group scheduling type
func (m APIMulticastGroupSchedulingType) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIMulticastGroupSchedulingTypeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api multicast group scheduling type based on context it is used
func (m APIMulticastGroupSchedulingType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -0,0 +1,79 @@
// 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// APIMulticastGroupType - CLASS_C: Class C.
// - CLASS_B: Class-B.
//
// swagger:model apiMulticastGroupType
type APIMulticastGroupType string
func NewAPIMulticastGroupType(value APIMulticastGroupType) *APIMulticastGroupType {
return &value
}
// Pointer returns a pointer to a freshly-allocated APIMulticastGroupType.
func (m APIMulticastGroupType) Pointer() *APIMulticastGroupType {
return &m
}
const (
// APIMulticastGroupTypeCLASSC captures enum value "CLASS_C"
APIMulticastGroupTypeCLASSC APIMulticastGroupType = "CLASS_C"
// APIMulticastGroupTypeCLASSB captures enum value "CLASS_B"
APIMulticastGroupTypeCLASSB APIMulticastGroupType = "CLASS_B"
)
// for schema
var apiMulticastGroupTypeEnum []interface{}
func init() {
var res []APIMulticastGroupType
if err := json.Unmarshal([]byte(`["CLASS_C","CLASS_B"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
apiMulticastGroupTypeEnum = append(apiMulticastGroupTypeEnum, v)
}
}
func (m APIMulticastGroupType) validateAPIMulticastGroupTypeEnum(path, location string, value APIMulticastGroupType) error {
if err := validate.EnumCase(path, location, value, apiMulticastGroupTypeEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this api multicast group type
func (m APIMulticastGroupType) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateAPIMulticastGroupTypeEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this api multicast group type based on context it is used
func (m APIMulticastGroupType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

Some files were not shown because too many files have changed in this diff Show More