X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Fmodels%2Fsubscription_response_item.go;fp=pkg%2Fmodels%2Fsubscription_response_item.go;h=2bed019f0a9fceb0af022ab31aee2d52ec572010;hb=429da19d53224135082f8b6f65470ae3ee8df176;hp=0000000000000000000000000000000000000000;hpb=e0948fe8b755b4d752ef9da4a46246cf3951c9dc;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/models/subscription_response_item.go b/pkg/models/subscription_response_item.go new file mode 100644 index 0000000..2bed019 --- /dev/null +++ b/pkg/models/subscription_response_item.go @@ -0,0 +1,98 @@ +// 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 ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SubscriptionResponseItem subscription response item +// swagger:model SubscriptionResponseItem +type SubscriptionResponseItem struct { + + // instance Id + // Required: true + InstanceID *int64 `json:"InstanceId"` + + // requestor Id + // Required: true + RequestorID *int64 `json:"RequestorId"` + + // subscription Id + // Required: true + SubscriptionID *string `json:"SubscriptionId"` +} + +// Validate validates this subscription response item +func (m *SubscriptionResponseItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInstanceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestorID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubscriptionID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SubscriptionResponseItem) validateInstanceID(formats strfmt.Registry) error { + + if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil { + return err + } + + return nil +} + +func (m *SubscriptionResponseItem) validateRequestorID(formats strfmt.Registry) error { + + if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil { + return err + } + + return nil +} + +func (m *SubscriptionResponseItem) validateSubscriptionID(formats strfmt.Registry) error { + + if err := validate.Required("SubscriptionId", "body", m.SubscriptionID); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SubscriptionResponseItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubscriptionResponseItem) UnmarshalBinary(b []byte) error { + var res SubscriptionResponseItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}