Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Teams Response
// 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"
)
// TeamsResponse teams response
// swagger:model TeamsResponse
type TeamsResponse struct {
// attachments
Attachments []*TeamsResponseAttachmentsItems0 `json:"Attachments"`
// conversation
Conversation *TeamsResponseConversation `json:"Conversation,omitempty"`
// from
From *TeamsResponseFrom `json:"From,omitempty"`
// recipient
Recipient *TeamsResponseRecipient `json:"Recipient,omitempty"`
// reply to ID
ReplyToID string `json:"ReplyToID,omitempty"`
// text
Text string `json:"Text,omitempty"`
// type
Type string `json:"Type,omitempty"`
}
// Validate validates this teams response
func (m *TeamsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAttachments(formats); err != nil {
res = append(res, err)
}
if err := m.validateConversation(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 len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TeamsResponse) validateAttachments(formats strfmt.Registry) error {
if swag.IsZero(m.Attachments) { // not required
return nil
}
for i := 0; i < len(m.Attachments); i++ {
if swag.IsZero(m.Attachments[i]) { // not required
continue
}
if m.Attachments[i] != nil {
if err := m.Attachments[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Attachments" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TeamsResponse) 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 *TeamsResponse) 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 *TeamsResponse) 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
}
// MarshalBinary interface implementation
func (m *TeamsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TeamsResponse) UnmarshalBinary(b []byte) error {
var res TeamsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// TeamsResponseAttachmentsItems0 teams response attachments items0
// swagger:model TeamsResponseAttachmentsItems0
type TeamsResponseAttachmentsItems0 struct {
// content type
ContentType string `json:"ContentType,omitempty"`
// content URL
ContentURL string `json:"ContentURL,omitempty"`
// name
Name string `json:"Name,omitempty"`
}
// Validate validates this teams response attachments items0
func (m *TeamsResponseAttachmentsItems0) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TeamsResponseAttachmentsItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TeamsResponseAttachmentsItems0) UnmarshalBinary(b []byte) error {
var res TeamsResponseAttachmentsItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// TeamsResponseConversation teams response conversation
// swagger:model TeamsResponseConversation
type TeamsResponseConversation struct {
// ID
ID string `json:"ID,omitempty"`
// name
Name string `json:"Name,omitempty"`
}
// Validate validates this teams response conversation
func (m *TeamsResponseConversation) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TeamsResponseConversation) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TeamsResponseConversation) UnmarshalBinary(b []byte) error {
var res TeamsResponseConversation
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// TeamsResponseFrom teams response from
// swagger:model TeamsResponseFrom
type TeamsResponseFrom struct {
// ID
ID string `json:"ID,omitempty"`
// name
Name string `json:"Name,omitempty"`
}
// Validate validates this teams response from
func (m *TeamsResponseFrom) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TeamsResponseFrom) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TeamsResponseFrom) UnmarshalBinary(b []byte) error {
var res TeamsResponseFrom
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// TeamsResponseRecipient teams response recipient
// swagger:model TeamsResponseRecipient
type TeamsResponseRecipient struct {
// ID
ID string `json:"ID,omitempty"`
// name
Name string `json:"Name,omitempty"`
}
// Validate validates this teams response recipient
func (m *TeamsResponseRecipient) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TeamsResponseRecipient) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TeamsResponseRecipient) UnmarshalBinary(b []byte) error {
var res TeamsResponseRecipient
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
You can’t perform that action at this time.