blob: 7853a3b3374d3c7f5b64167433ef6c77c20b0569 [file] [log] [blame]
// Code generated by go-swagger; DO NOT EDIT.
package clientmodel
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SubscriptionInstance subscription instance
// swagger:model SubscriptionInstance
type SubscriptionInstance struct {
// Empty string when no error.
// Required: true
ErrorCause *string `json:"ErrorCause"`
// instance Id
// Required: true
// Maximum: 65535
// Minimum: 0
InstanceID *int64 `json:"InstanceId"`
// requestor Id
// Required: true
// Maximum: 65535
// Minimum: 0
RequestorID *int64 `json:"RequestorId"`
}
// Validate validates this subscription instance
func (m *SubscriptionInstance) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateErrorCause(formats); err != nil {
res = append(res, err)
}
if err := m.validateInstanceID(formats); err != nil {
res = append(res, err)
}
if err := m.validateRequestorID(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SubscriptionInstance) validateErrorCause(formats strfmt.Registry) error {
if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
return err
}
return nil
}
func (m *SubscriptionInstance) validateInstanceID(formats strfmt.Registry) error {
if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
return err
}
if err := validate.MinimumInt("InstanceId", "body", int64(*m.InstanceID), 0, false); err != nil {
return err
}
if err := validate.MaximumInt("InstanceId", "body", int64(*m.InstanceID), 65535, false); err != nil {
return err
}
return nil
}
func (m *SubscriptionInstance) validateRequestorID(formats strfmt.Registry) error {
if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
return err
}
if err := validate.MinimumInt("RequestorId", "body", int64(*m.RequestorID), 0, false); err != nil {
return err
}
if err := validate.MaximumInt("RequestorId", "body", int64(*m.RequestorID), 65535, false); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *SubscriptionInstance) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SubscriptionInstance) UnmarshalBinary(b []byte) error {
var res SubscriptionInstance
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}