1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
9 strfmt "github.com/go-openapi/strfmt"
11 "github.com/go-openapi/errors"
12 "github.com/go-openapi/swag"
13 "github.com/go-openapi/validate"
16 // SubscriptionInstance subscription instance
17 // swagger:model SubscriptionInstance
18 type SubscriptionInstance struct {
20 // Empty string when no error.
22 ErrorCause *string `json:"ErrorCause"`
28 InstanceID *int64 `json:"InstanceId"`
34 RequestorID *int64 `json:"RequestorId"`
37 // Validate validates this subscription instance
38 func (m *SubscriptionInstance) Validate(formats strfmt.Registry) error {
41 if err := m.validateErrorCause(formats); err != nil {
42 res = append(res, err)
45 if err := m.validateInstanceID(formats); err != nil {
46 res = append(res, err)
49 if err := m.validateRequestorID(formats); err != nil {
50 res = append(res, err)
54 return errors.CompositeValidationError(res...)
59 func (m *SubscriptionInstance) validateErrorCause(formats strfmt.Registry) error {
61 if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
68 func (m *SubscriptionInstance) validateInstanceID(formats strfmt.Registry) error {
70 if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
74 if err := validate.MinimumInt("InstanceId", "body", int64(*m.InstanceID), 0, false); err != nil {
78 if err := validate.MaximumInt("InstanceId", "body", int64(*m.InstanceID), 65535, false); err != nil {
85 func (m *SubscriptionInstance) validateRequestorID(formats strfmt.Registry) error {
87 if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
91 if err := validate.MinimumInt("RequestorId", "body", int64(*m.RequestorID), 0, false); err != nil {
95 if err := validate.MaximumInt("RequestorId", "body", int64(*m.RequestorID), 65535, false); err != nil {
102 // MarshalBinary interface implementation
103 func (m *SubscriptionInstance) MarshalBinary() ([]byte, error) {
107 return swag.WriteJSON(m)
110 // UnmarshalBinary interface implementation
111 func (m *SubscriptionInstance) UnmarshalBinary(b []byte) error {
112 var res SubscriptionInstance
113 if err := swag.ReadJSON(b, &res); err != nil {