Created
November 28, 2019 02:24
-
-
Save MarlikAlmighty/bca5c92efae8a9e9de0a6260e6d7ba7a to your computer and use it in GitHub Desktop.
Teams Request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 ( | |
"strconv" | |
strfmt "github.com/go-openapi/strfmt" | |
"github.com/go-openapi/errors" | |
"github.com/go-openapi/swag" | |
"github.com/go-openapi/validate" | |
) | |
// TeamsRequest teams request | |
// swagger:model TeamsRequest | |
type TeamsRequest struct { | |
// channel data | |
ChannelData *TeamsRequestChannelData `json:"ChannelData,omitempty"` | |
// channel ID | |
ChannelID string `json:"ChannelID,omitempty"` | |
// conversation | |
Conversation *TeamsRequestConversation `json:"Conversation,omitempty"` | |
// entities | |
Entities []*TeamsRequestEntitiesItems0 `json:"Entities"` | |
// from | |
From *TeamsRequestFrom `json:"From,omitempty"` | |
// ID | |
ID string `json:"ID,omitempty"` | |
// locale | |
Locale string `json:"Locale,omitempty"` | |
// recipient | |
Recipient *TeamsRequestRecipient `json:"Recipient,omitempty"` | |
// service URL | |
ServiceURL string `json:"ServiceURL,omitempty"` | |
// text | |
Text string `json:"Text,omitempty"` | |
// text format | |
TextFormat string `json:"TextFormat,omitempty"` | |
// timestamp | |
// Format: date-time | |
Timestamp strfmt.DateTime `json:"Timestamp,omitempty"` | |
// type | |
Type string `json:"Type,omitempty"` | |
} | |
// Validate validates this teams request | |
func (m *TeamsRequest) Validate(formats strfmt.Registry) error { | |
var res []error | |
if err := m.validateChannelData(formats); err != nil { | |
res = append(res, err) | |
} | |
if err := m.validateConversation(formats); err != nil { | |
res = append(res, err) | |
} | |
if err := m.validateEntities(formats); err != nil { | |
res = append(res, err) | |
} | |
if err := m.validateFrom(formats); err != nil { | |
res = append(res, err) | |
} | |
if err := m.validateRecipient(formats); err != nil { | |
res = append(res, err) | |
} | |
if err := m.validateTimestamp(formats); err != nil { | |
res = append(res, err) | |
} | |
if len(res) > 0 { | |
return errors.CompositeValidationError(res...) | |
} | |
return nil | |
} | |
func (m *TeamsRequest) validateChannelData(formats strfmt.Registry) error { | |
if swag.IsZero(m.ChannelData) { // not required | |
return nil | |
} | |
if m.ChannelData != nil { | |
if err := m.ChannelData.Validate(formats); err != nil { | |
if ve, ok := err.(*errors.Validation); ok { | |
return ve.ValidateName("ChannelData") | |
} | |
return err | |
} | |
} | |
return nil | |
} | |
func (m *TeamsRequest) validateConversation(formats strfmt.Registry) error { | |
if swag.IsZero(m.Conversation) { // not required | |
return nil | |
} | |
if m.Conversation != nil { | |
if err := m.Conversation.Validate(formats); err != nil { | |
if ve, ok := err.(*errors.Validation); ok { | |
return ve.ValidateName("Conversation") | |
} | |
return err | |
} | |
} | |
return nil | |
} | |
func (m *TeamsRequest) validateEntities(formats strfmt.Registry) error { | |
if swag.IsZero(m.Entities) { // not required | |
return nil | |
} | |
for i := 0; i < len(m.Entities); i++ { | |
if swag.IsZero(m.Entities[i]) { // not required | |
continue | |
} | |
if m.Entities[i] != nil { | |
if err := m.Entities[i].Validate(formats); err != nil { | |
if ve, ok := err.(*errors.Validation); ok { | |
return ve.ValidateName("Entities" + "." + strconv.Itoa(i)) | |
} | |
return err | |
} | |
} | |
} | |
return nil | |
} | |
func (m *TeamsRequest) validateFrom(formats strfmt.Registry) error { | |
if swag.IsZero(m.From) { // not required | |
return nil | |
} | |
if m.From != nil { | |
if err := m.From.Validate(formats); err != nil { | |
if ve, ok := err.(*errors.Validation); ok { | |
return ve.ValidateName("From") | |
} | |
return err | |
} | |
} | |
return nil | |
} | |
func (m *TeamsRequest) validateRecipient(formats strfmt.Registry) error { | |
if swag.IsZero(m.Recipient) { // not required | |
return nil | |
} | |
if m.Recipient != nil { | |
if err := m.Recipient.Validate(formats); err != nil { | |
if ve, ok := err.(*errors.Validation); ok { | |
return ve.ValidateName("Recipient") | |
} | |
return err | |
} | |
} | |
return nil | |
} | |
func (m *TeamsRequest) validateTimestamp(formats strfmt.Registry) error { | |
if swag.IsZero(m.Timestamp) { // not required | |
return nil | |
} | |
if err := validate.FormatOf("Timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil { | |
return err | |
} | |
return nil | |
} | |
// MarshalBinary interface implementation | |
func (m *TeamsRequest) MarshalBinary() ([]byte, error) { | |
if m == nil { | |
return nil, nil | |
} | |
return swag.WriteJSON(m) | |
} | |
// UnmarshalBinary interface implementation | |
func (m *TeamsRequest) UnmarshalBinary(b []byte) error { | |
var res TeamsRequest | |
if err := swag.ReadJSON(b, &res); err != nil { | |
return err | |
} | |
*m = res | |
return nil | |
} | |
// TeamsRequestChannelData teams request channel data | |
// swagger:model TeamsRequestChannelData | |
type TeamsRequestChannelData struct { | |
// client activity ID | |
ClientActivityID string `json:"ClientActivityID,omitempty"` | |
} | |
// Validate validates this teams request channel data | |
func (m *TeamsRequestChannelData) Validate(formats strfmt.Registry) error { | |
return nil | |
} | |
// MarshalBinary interface implementation | |
func (m *TeamsRequestChannelData) MarshalBinary() ([]byte, error) { | |
if m == nil { | |
return nil, nil | |
} | |
return swag.WriteJSON(m) | |
} | |
// UnmarshalBinary interface implementation | |
func (m *TeamsRequestChannelData) UnmarshalBinary(b []byte) error { | |
var res TeamsRequestChannelData | |
if err := swag.ReadJSON(b, &res); err != nil { | |
return err | |
} | |
*m = res | |
return nil | |
} | |
// TeamsRequestConversation teams request conversation | |
// swagger:model TeamsRequestConversation | |
type TeamsRequestConversation struct { | |
// ID | |
ID string `json:"ID,omitempty"` | |
} | |
// Validate validates this teams request conversation | |
func (m *TeamsRequestConversation) Validate(formats strfmt.Registry) error { | |
return nil | |
} | |
// MarshalBinary interface implementation | |
func (m *TeamsRequestConversation) MarshalBinary() ([]byte, error) { | |
if m == nil { | |
return nil, nil | |
} | |
return swag.WriteJSON(m) | |
} | |
// UnmarshalBinary interface implementation | |
func (m *TeamsRequestConversation) UnmarshalBinary(b []byte) error { | |
var res TeamsRequestConversation | |
if err := swag.ReadJSON(b, &res); err != nil { | |
return err | |
} | |
*m = res | |
return nil | |
} | |
// TeamsRequestEntitiesItems0 teams request entities items0 | |
// swagger:model TeamsRequestEntitiesItems0 | |
type TeamsRequestEntitiesItems0 struct { | |
// requires bot state | |
RequiresBotState bool `json:"RequiresBotState,omitempty"` | |
// supports listening | |
SupportsListening bool `json:"SupportsListening,omitempty"` | |
// supports tts | |
SupportsTts bool `json:"SupportsTts,omitempty"` | |
// type | |
Type string `json:"Type,omitempty"` | |
} | |
// Validate validates this teams request entities items0 | |
func (m *TeamsRequestEntitiesItems0) Validate(formats strfmt.Registry) error { | |
return nil | |
} | |
// MarshalBinary interface implementation | |
func (m *TeamsRequestEntitiesItems0) MarshalBinary() ([]byte, error) { | |
if m == nil { | |
return nil, nil | |
} | |
return swag.WriteJSON(m) | |
} | |
// UnmarshalBinary interface implementation | |
func (m *TeamsRequestEntitiesItems0) UnmarshalBinary(b []byte) error { | |
var res TeamsRequestEntitiesItems0 | |
if err := swag.ReadJSON(b, &res); err != nil { | |
return err | |
} | |
*m = res | |
return nil | |
} | |
// TeamsRequestFrom teams request from | |
// swagger:model TeamsRequestFrom | |
type TeamsRequestFrom struct { | |
// ID | |
ID string `json:"ID,omitempty"` | |
} | |
// Validate validates this teams request from | |
func (m *TeamsRequestFrom) Validate(formats strfmt.Registry) error { | |
return nil | |
} | |
// MarshalBinary interface implementation | |
func (m *TeamsRequestFrom) MarshalBinary() ([]byte, error) { | |
if m == nil { | |
return nil, nil | |
} | |
return swag.WriteJSON(m) | |
} | |
// UnmarshalBinary interface implementation | |
func (m *TeamsRequestFrom) UnmarshalBinary(b []byte) error { | |
var res TeamsRequestFrom | |
if err := swag.ReadJSON(b, &res); err != nil { | |
return err | |
} | |
*m = res | |
return nil | |
} | |
// TeamsRequestRecipient teams request recipient | |
// swagger:model TeamsRequestRecipient | |
type TeamsRequestRecipient struct { | |
// ID | |
ID string `json:"ID,omitempty"` | |
// name | |
Name string `json:"Name,omitempty"` | |
} | |
// Validate validates this teams request recipient | |
func (m *TeamsRequestRecipient) Validate(formats strfmt.Registry) error { | |
return nil | |
} | |
// MarshalBinary interface implementation | |
func (m *TeamsRequestRecipient) MarshalBinary() ([]byte, error) { | |
if m == nil { | |
return nil, nil | |
} | |
return swag.WriteJSON(m) | |
} | |
// UnmarshalBinary interface implementation | |
func (m *TeamsRequestRecipient) UnmarshalBinary(b []byte) error { | |
var res TeamsRequestRecipient | |
if err := swag.ReadJSON(b, &res); err != nil { | |
return err | |
} | |
*m = res | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment