mirror of https://github.com/vernonkeenan/lib
119 lines
2.6 KiB
Go
119 lines
2.6 KiB
Go
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
|
||
|
|
// (c) 2012-2020 by Taxnexus, Inc.
|
||
|
|
// All rights reserved worldwide.
|
||
|
|
// Proprietary product; unlicensed use is not allowed
|
||
|
|
|
||
|
|
package members_models
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
stderrors "errors"
|
||
|
|
|
||
|
|
"github.com/go-openapi/errors"
|
||
|
|
"github.com/go-openapi/strfmt"
|
||
|
|
"github.com/go-openapi/swag/jsonutils"
|
||
|
|
"github.com/go-openapi/validate"
|
||
|
|
)
|
||
|
|
|
||
|
|
// TenantMembershipUpdateRequest tenant membership update request
|
||
|
|
//
|
||
|
|
// swagger:model TenantMembershipUpdateRequest
|
||
|
|
type TenantMembershipUpdateRequest struct {
|
||
|
|
|
||
|
|
// data
|
||
|
|
// Required: true
|
||
|
|
Data *TenantMembershipUpdate `json:"Data"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// Validate validates this tenant membership update request
|
||
|
|
func (m *TenantMembershipUpdateRequest) Validate(formats strfmt.Registry) error {
|
||
|
|
var res []error
|
||
|
|
|
||
|
|
if err := m.validateData(formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if len(res) > 0 {
|
||
|
|
return errors.CompositeValidationError(res...)
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *TenantMembershipUpdateRequest) validateData(formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if err := validate.Required("Data", "body", m.Data); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
if m.Data != nil {
|
||
|
|
if err := m.Data.Validate(formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Data")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Data")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// ContextValidate validate this tenant membership update request based on the context it is used
|
||
|
|
func (m *TenantMembershipUpdateRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
var res []error
|
||
|
|
|
||
|
|
if err := m.contextValidateData(ctx, formats); err != nil {
|
||
|
|
res = append(res, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
if len(res) > 0 {
|
||
|
|
return errors.CompositeValidationError(res...)
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m *TenantMembershipUpdateRequest) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
|
||
|
|
|
||
|
|
if m.Data != nil {
|
||
|
|
|
||
|
|
if err := m.Data.ContextValidate(ctx, formats); err != nil {
|
||
|
|
ve := new(errors.Validation)
|
||
|
|
if stderrors.As(err, &ve) {
|
||
|
|
return ve.ValidateName("Data")
|
||
|
|
}
|
||
|
|
ce := new(errors.CompositeError)
|
||
|
|
if stderrors.As(err, &ce) {
|
||
|
|
return ce.ValidateName("Data")
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// MarshalBinary interface implementation
|
||
|
|
func (m *TenantMembershipUpdateRequest) MarshalBinary() ([]byte, error) {
|
||
|
|
if m == nil {
|
||
|
|
return nil, nil
|
||
|
|
}
|
||
|
|
return jsonutils.WriteJSON(m)
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnmarshalBinary interface implementation
|
||
|
|
func (m *TenantMembershipUpdateRequest) UnmarshalBinary(b []byte) error {
|
||
|
|
var res TenantMembershipUpdateRequest
|
||
|
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
*m = res
|
||
|
|
return nil
|
||
|
|
}
|