From 58f47c77169d018d2abdabd231e2391707f1c597 Mon Sep 17 00:00:00 2001 From: Daniel Ross <92299268+danielross-form3@users.noreply.github.com> Date: Tue, 29 Nov 2022 11:07:07 +0000 Subject: [PATCH] feat: update generated models & client (#72) --- .../list_direct_debits_requests.go | 128 + .../client/form3_public_api_client.go | 7 + ...anisation_nameverifications_id_requests.go | 88 + ...nisation_nameverifications_id_responses.go | 195 ++ ..._verification_id_admissions_id_requests.go | 106 + ...verification_id_admissions_id_responses.go | 195 ++ ...organisation_nameverifications_requests.go | 1179 +++++++++ ...rganisation_nameverifications_responses.go | 236 ++ .../name_verification_api_client.go | 170 ++ ...organisation_nameverifications_requests.go | 108 + ...rganisation_nameverifications_responses.go | 236 ++ .../models/account_classification.go | 72 + .../direct_debit_admission_status_reason.go | 5 +- pkg/generated/models/name_verification.go | 349 +++ .../models/name_verification_admission.go | 349 +++ .../name_verification_admission_answer.go | 72 + .../name_verification_admission_attributes.go | 203 ++ ...verification_admission_details_response.go | 101 + ...name_verification_admission_reason_code.go | 102 + ...me_verification_admission_relationships.go | 188 ++ .../name_verification_admission_status.go | 72 + .../models/name_verification_attributes.go | 327 +++ .../models/name_verification_creation.go | 103 + .../name_verification_creation_response.go | 101 + ...name_verification_details_list_response.go | 143 + .../name_verification_details_response.go | 101 + .../models/name_verification_relationships.go | 338 +++ .../models/name_verification_submission.go | 348 +++ .../name_verification_submission_answer.go | 72 + ...name_verification_submission_attributes.go | 203 ++ ...erification_submission_details_response.go | 101 + ...ame_verification_submission_reason_code.go | 102 + ...e_verification_submission_relationships.go | 188 ++ .../name_verification_submission_status.go | 72 + pkg/generated/models/new_payment.go | 349 +++ .../models/new_payment_relationships.go | 1563 +++++++++++ pkg/generated/models/payment.go | 2297 ---------------- .../models/payment_admission_task_name.go | 49 - .../models/payment_admission_task_status.go | 5 +- .../payment_admission_update_relationships.go | 104 + pkg/generated/models/payment_attributes.go | 2315 +++++++++++++++++ pkg/generated/models/payment_creation.go | 6 +- pkg/generated/models/payment_relationships.go | 250 ++ .../payment_submission_relationships.go | 39 + pkg/generated/models/payment_update.go | 349 +++ .../models/payment_update_relationships.go | 1563 +++++++++++ pkg/generated/models/resource_type.go | 227 +- pkg/generated/models/return_payment.go | 49 + .../models/return_submission_relationships.go | 39 + .../models/return_submission_task.go | 453 ++++ .../models/return_submission_task_assignee.go | 69 + .../models/return_submission_task_name.go | 29 + .../models/return_submission_task_status.go | 78 + .../models/return_submission_update.go | 39 + .../return_submission_update_relationships.go | 104 + pkg/generated/models/reversal_admission.go | 39 + .../models/reversal_admission_task.go | 441 ++++ .../reversal_admission_task_assignee.go | 72 + .../models/reversal_admission_task_name.go | 29 + .../models/reversal_admission_task_status.go | 78 + .../models/reversal_admission_update.go | 354 +++ ...reversal_admission_update_relationships.go | 104 + pkg/generated/models/user_defined_data.go | 10 - .../models/user_defined_data_for_payment.go | 145 -- 64 files changed, 14996 insertions(+), 2612 deletions(-) create mode 100644 pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_requests.go create mode 100644 pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_responses.go create mode 100644 pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_requests.go create mode 100644 pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_responses.go create mode 100644 pkg/generated/client/name_verification_api/get_organisation_nameverifications_requests.go create mode 100644 pkg/generated/client/name_verification_api/get_organisation_nameverifications_responses.go create mode 100644 pkg/generated/client/name_verification_api/name_verification_api_client.go create mode 100644 pkg/generated/client/name_verification_api/post_organisation_nameverifications_requests.go create mode 100644 pkg/generated/client/name_verification_api/post_organisation_nameverifications_responses.go create mode 100644 pkg/generated/models/account_classification.go create mode 100644 pkg/generated/models/name_verification.go create mode 100644 pkg/generated/models/name_verification_admission.go create mode 100644 pkg/generated/models/name_verification_admission_answer.go create mode 100644 pkg/generated/models/name_verification_admission_attributes.go create mode 100644 pkg/generated/models/name_verification_admission_details_response.go create mode 100644 pkg/generated/models/name_verification_admission_reason_code.go create mode 100644 pkg/generated/models/name_verification_admission_relationships.go create mode 100644 pkg/generated/models/name_verification_admission_status.go create mode 100644 pkg/generated/models/name_verification_attributes.go create mode 100644 pkg/generated/models/name_verification_creation.go create mode 100644 pkg/generated/models/name_verification_creation_response.go create mode 100644 pkg/generated/models/name_verification_details_list_response.go create mode 100644 pkg/generated/models/name_verification_details_response.go create mode 100644 pkg/generated/models/name_verification_relationships.go create mode 100644 pkg/generated/models/name_verification_submission.go create mode 100644 pkg/generated/models/name_verification_submission_answer.go create mode 100644 pkg/generated/models/name_verification_submission_attributes.go create mode 100644 pkg/generated/models/name_verification_submission_details_response.go create mode 100644 pkg/generated/models/name_verification_submission_reason_code.go create mode 100644 pkg/generated/models/name_verification_submission_relationships.go create mode 100644 pkg/generated/models/name_verification_submission_status.go create mode 100644 pkg/generated/models/new_payment.go create mode 100644 pkg/generated/models/new_payment_relationships.go create mode 100644 pkg/generated/models/payment_admission_update_relationships.go create mode 100644 pkg/generated/models/payment_attributes.go create mode 100644 pkg/generated/models/payment_update.go create mode 100644 pkg/generated/models/payment_update_relationships.go create mode 100644 pkg/generated/models/return_submission_task.go create mode 100644 pkg/generated/models/return_submission_task_assignee.go create mode 100644 pkg/generated/models/return_submission_task_name.go create mode 100644 pkg/generated/models/return_submission_task_status.go create mode 100644 pkg/generated/models/return_submission_update_relationships.go create mode 100644 pkg/generated/models/reversal_admission_task.go create mode 100644 pkg/generated/models/reversal_admission_task_assignee.go create mode 100644 pkg/generated/models/reversal_admission_task_name.go create mode 100644 pkg/generated/models/reversal_admission_task_status.go create mode 100644 pkg/generated/models/reversal_admission_update.go create mode 100644 pkg/generated/models/reversal_admission_update_relationships.go delete mode 100644 pkg/generated/models/user_defined_data_for_payment.go diff --git a/pkg/generated/client/direct_debits/list_direct_debits_requests.go b/pkg/generated/client/direct_debits/list_direct_debits_requests.go index 802eb802..33fc4427 100644 --- a/pkg/generated/client/direct_debits/list_direct_debits_requests.go +++ b/pkg/generated/client/direct_debits/list_direct_debits_requests.go @@ -51,6 +51,8 @@ func (c *Client) ListDirectDebits() *ListDirectDebitsRequest { FilterModifiedDateTo: c.Defaults.GetStrfmtDateTimePtr("ListDirectDebits", "filter[modified_date_to]"), + FilterNotRelationships: make([]string, 0), + FilterOrganisationID: make([]strfmt.UUID, 0), FilterPaymentScheme: c.Defaults.GetStringPtr("ListDirectDebits", "filter[payment_scheme]"), @@ -63,6 +65,8 @@ func (c *Client) ListDirectDebits() *ListDirectDebitsRequest { FilterReference: c.Defaults.GetStringPtr("ListDirectDebits", "filter[reference]"), + FilterRelationships: make([]string, 0), + FilterSubmissionSchemeStatusCode: c.Defaults.GetStringPtr("ListDirectDebits", "filter[submission.scheme_status_code]"), FilterSubmissionStatus: c.Defaults.GetStringPtr("ListDirectDebits", "filter[submission.status]"), @@ -73,6 +77,10 @@ func (c *Client) ListDirectDebits() *ListDirectDebitsRequest { FilterUniqueSchemeID: c.Defaults.GetStringPtr("ListDirectDebits", "filter[unique_scheme_id]"), + PageAfter: c.Defaults.GetStringPtr("ListDirectDebits", "page[after]"), + + PageBefore: c.Defaults.GetStringPtr("ListDirectDebits", "page[before]"), + PageNumber: c.Defaults.GetStringPtr("ListDirectDebits", "page[number]"), PageSize: c.Defaults.GetInt64Ptr("ListDirectDebits", "page[size]"), @@ -146,6 +154,10 @@ type ListDirectDebitsRequest struct { FilterModifiedDateTo *strfmt.DateTime + /*FilterNotRelationships Filter for direct debits containing none of the requested relationships */ + + FilterNotRelationships []string + /*FilterOrganisationID Filter by organisation id */ FilterOrganisationID []strfmt.UUID @@ -170,6 +182,10 @@ type ListDirectDebitsRequest struct { FilterReference *string + /*FilterRelationships Filter for direct debits containing all of the requested relationships */ + + FilterRelationships []string + /*FilterSubmissionSchemeStatusCode Filter by submission scheme status code */ FilterSubmissionSchemeStatusCode *string @@ -190,6 +206,14 @@ type ListDirectDebitsRequest struct { FilterUniqueSchemeID *string + /*PageAfter Cursor for next page (this is a base64-encoded UUID continuation token returned from the application and should not be manually generated, unless requesting the first page, where the value should be set to "start"). */ + + PageAfter *string + + /*PageBefore Cursor for previous page (this is a base64-encoded UUID continuation token returned from the application and should not be manually generated, unless requesting the last page, where the value should be set to "end"). */ + + PageBefore *string + /*PageNumber Which page to select */ PageNumber *string @@ -421,6 +445,20 @@ func (o *ListDirectDebitsRequest) WithoutFilterModifiedDateTo() *ListDirectDebit return o } +func (o *ListDirectDebitsRequest) WithFilterNotRelationships(filterNotRelationships []string) *ListDirectDebitsRequest { + + o.FilterNotRelationships = filterNotRelationships + + return o +} + +func (o *ListDirectDebitsRequest) WithoutFilterNotRelationships() *ListDirectDebitsRequest { + + o.FilterNotRelationships = nil + + return o +} + func (o *ListDirectDebitsRequest) WithFilterOrganisationID(filterOrganisationID []strfmt.UUID) *ListDirectDebitsRequest { o.FilterOrganisationID = filterOrganisationID @@ -505,6 +543,20 @@ func (o *ListDirectDebitsRequest) WithoutFilterReference() *ListDirectDebitsRequ return o } +func (o *ListDirectDebitsRequest) WithFilterRelationships(filterRelationships []string) *ListDirectDebitsRequest { + + o.FilterRelationships = filterRelationships + + return o +} + +func (o *ListDirectDebitsRequest) WithoutFilterRelationships() *ListDirectDebitsRequest { + + o.FilterRelationships = nil + + return o +} + func (o *ListDirectDebitsRequest) WithFilterSubmissionSchemeStatusCode(filterSubmissionSchemeStatusCode string) *ListDirectDebitsRequest { o.FilterSubmissionSchemeStatusCode = &filterSubmissionSchemeStatusCode @@ -575,6 +627,34 @@ func (o *ListDirectDebitsRequest) WithoutFilterUniqueSchemeID() *ListDirectDebit return o } +func (o *ListDirectDebitsRequest) WithPageAfter(pageAfter string) *ListDirectDebitsRequest { + + o.PageAfter = &pageAfter + + return o +} + +func (o *ListDirectDebitsRequest) WithoutPageAfter() *ListDirectDebitsRequest { + + o.PageAfter = nil + + return o +} + +func (o *ListDirectDebitsRequest) WithPageBefore(pageBefore string) *ListDirectDebitsRequest { + + o.PageBefore = &pageBefore + + return o +} + +func (o *ListDirectDebitsRequest) WithoutPageBefore() *ListDirectDebitsRequest { + + o.PageBefore = nil + + return o +} + func (o *ListDirectDebitsRequest) WithPageNumber(pageNumber string) *ListDirectDebitsRequest { o.PageNumber = &pageNumber @@ -864,6 +944,14 @@ func (o *ListDirectDebitsRequest) WriteToRequest(r runtime.ClientRequest, reg st } + valuesFilterNotRelationships := o.FilterNotRelationships + + joinedFilterNotRelationships := swag.JoinByFormat(valuesFilterNotRelationships, "") + // query array param filter[not_relationships] + if err := r.SetQueryParam("filter[not_relationships]", joinedFilterNotRelationships...); err != nil { + return err + } + var valuesFilterOrganisationID []string for _, v := range o.FilterOrganisationID { valuesFilterOrganisationID = append(valuesFilterOrganisationID, v.String()) @@ -955,6 +1043,14 @@ func (o *ListDirectDebitsRequest) WriteToRequest(r runtime.ClientRequest, reg st } + valuesFilterRelationships := o.FilterRelationships + + joinedFilterRelationships := swag.JoinByFormat(valuesFilterRelationships, "") + // query array param filter[relationships] + if err := r.SetQueryParam("filter[relationships]", joinedFilterRelationships...); err != nil { + return err + } + if o.FilterSubmissionSchemeStatusCode != nil { // query param filter[submission.scheme_status_code] @@ -1035,6 +1131,38 @@ func (o *ListDirectDebitsRequest) WriteToRequest(r runtime.ClientRequest, reg st } + if o.PageAfter != nil { + + // query param page[after] + var qrPageAfter string + if o.PageAfter != nil { + qrPageAfter = *o.PageAfter + } + qPageAfter := qrPageAfter + if qPageAfter != "" { + if err := r.SetQueryParam("page[after]", qPageAfter); err != nil { + return err + } + } + + } + + if o.PageBefore != nil { + + // query param page[before] + var qrPageBefore string + if o.PageBefore != nil { + qrPageBefore = *o.PageBefore + } + qPageBefore := qrPageBefore + if qPageBefore != "" { + if err := r.SetQueryParam("page[before]", qPageBefore); err != nil { + return err + } + } + + } + if o.PageNumber != nil { // query param page[number] diff --git a/pkg/generated/client/form3_public_api_client.go b/pkg/generated/client/form3_public_api_client.go index acaf3db3..16de71bb 100644 --- a/pkg/generated/client/form3_public_api_client.go +++ b/pkg/generated/client/form3_public_api_client.go @@ -24,6 +24,7 @@ import ( "github.com/form3tech-oss/go-form3/v6/pkg/generated/client/lhv_gateway" "github.com/form3tech-oss/go-form3/v6/pkg/generated/client/mandates" "github.com/form3tech-oss/go-form3/v6/pkg/generated/client/metrics_api" + "github.com/form3tech-oss/go-form3/v6/pkg/generated/client/name_verification_api" "github.com/form3tech-oss/go-form3/v6/pkg/generated/client/oauth2" "github.com/form3tech-oss/go-form3/v6/pkg/generated/client/organisations" "github.com/form3tech-oss/go-form3/v6/pkg/generated/client/payments" @@ -109,6 +110,8 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry, defaults cl cli.MetricsAPI = metrics_api.New(transport, formats, defaults) + cli.NameVerificationAPI = name_verification_api.New(transport, formats, defaults) + cli.Oauth2 = oauth2.New(transport, formats, defaults) cli.Organisations = organisations.New(transport, formats, defaults) @@ -203,6 +206,8 @@ type Form3PublicAPI struct { MetricsAPI *metrics_api.Client + NameVerificationAPI *name_verification_api.Client + Oauth2 *oauth2.Client Organisations *organisations.Client @@ -260,6 +265,8 @@ func (c *Form3PublicAPI) SetTransport(transport runtime.ClientTransport) { c.MetricsAPI.SetTransport(transport) + c.NameVerificationAPI.SetTransport(transport) + c.Oauth2.SetTransport(transport) c.Organisations.SetTransport(transport) diff --git a/pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_requests.go b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_requests.go new file mode 100644 index 00000000..41fa9fed --- /dev/null +++ b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_requests.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// Client.GetOrganisationNameverificationsID creates a new GetOrganisationNameverificationsIDRequest object +// with the default values initialized. +func (c *Client) GetOrganisationNameverificationsID() *GetOrganisationNameverificationsIDRequest { + var () + return &GetOrganisationNameverificationsIDRequest{ + + ID: c.Defaults.GetStrfmtUUID("GetOrganisationNameverificationsID", "id"), + + timeout: cr.DefaultTimeout, + + transport: c.transport, + formats: c.formats, + } +} + +type GetOrganisationNameverificationsIDRequest struct { + + /*ID Name Verification ID */ + + ID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client + + transport runtime.ClientTransport + formats strfmt.Registry +} + +func (o *GetOrganisationNameverificationsIDRequest) FromJson(j string) (*GetOrganisationNameverificationsIDRequest, error) { + + return o, nil +} + +func (o *GetOrganisationNameverificationsIDRequest) WithID(id strfmt.UUID) *GetOrganisationNameverificationsIDRequest { + + o.ID = id + + return o +} + +////////////////// +// WithContext adds the context to the get organisation nameverifications ID Request +func (o *GetOrganisationNameverificationsIDRequest) WithContext(ctx context.Context) *GetOrganisationNameverificationsIDRequest { + o.Context = ctx + return o +} + +// WithHTTPClient adds the HTTPClient to the get organisation nameverifications ID Request +func (o *GetOrganisationNameverificationsIDRequest) WithHTTPClient(client *http.Client) *GetOrganisationNameverificationsIDRequest { + o.HTTPClient = client + return o +} + +// WriteToRequest writes these Request to a swagger request +func (o *GetOrganisationNameverificationsIDRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_responses.go b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_responses.go new file mode 100644 index 00000000..9dfc9a66 --- /dev/null +++ b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_id_responses.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/form3tech-oss/go-form3/v6/pkg/generated/models" +) + +// GetOrganisationNameverificationsIDReader is a Reader for the GetOrganisationNameverificationsID structure. +type GetOrganisationNameverificationsIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOrganisationNameverificationsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetOrganisationNameverificationsIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 403: + result := NewGetOrganisationNameverificationsIDForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewGetOrganisationNameverificationsIDNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewGetOrganisationNameverificationsIDInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetOrganisationNameverificationsIDOK creates a GetOrganisationNameverificationsIDOK with default headers values +func NewGetOrganisationNameverificationsIDOK() *GetOrganisationNameverificationsIDOK { + return &GetOrganisationNameverificationsIDOK{} +} + +/*GetOrganisationNameverificationsIDOK handles this case with default header values. + +Name verification details +*/ +type GetOrganisationNameverificationsIDOK struct { + + //Payload + + // isStream: false + *models.NameVerificationDetailsResponse +} + +func (o *GetOrganisationNameverificationsIDOK) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{id}][%d] getOrganisationNameverificationsIdOK", 200) +} + +func (o *GetOrganisationNameverificationsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.NameVerificationDetailsResponse = new(models.NameVerificationDetailsResponse) + + // response payload + + if err := consumer.Consume(response.Body(), o.NameVerificationDetailsResponse); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsIDForbidden creates a GetOrganisationNameverificationsIDForbidden with default headers values +func NewGetOrganisationNameverificationsIDForbidden() *GetOrganisationNameverificationsIDForbidden { + return &GetOrganisationNameverificationsIDForbidden{} +} + +/*GetOrganisationNameverificationsIDForbidden handles this case with default header values. + +Forbidden +*/ +type GetOrganisationNameverificationsIDForbidden struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsIDForbidden) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{id}][%d] getOrganisationNameverificationsIdForbidden", 403) +} + +func (o *GetOrganisationNameverificationsIDForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsIDNotFound creates a GetOrganisationNameverificationsIDNotFound with default headers values +func NewGetOrganisationNameverificationsIDNotFound() *GetOrganisationNameverificationsIDNotFound { + return &GetOrganisationNameverificationsIDNotFound{} +} + +/*GetOrganisationNameverificationsIDNotFound handles this case with default header values. + +Not Found +*/ +type GetOrganisationNameverificationsIDNotFound struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsIDNotFound) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{id}][%d] getOrganisationNameverificationsIdNotFound", 404) +} + +func (o *GetOrganisationNameverificationsIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsIDInternalServerError creates a GetOrganisationNameverificationsIDInternalServerError with default headers values +func NewGetOrganisationNameverificationsIDInternalServerError() *GetOrganisationNameverificationsIDInternalServerError { + return &GetOrganisationNameverificationsIDInternalServerError{} +} + +/*GetOrganisationNameverificationsIDInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type GetOrganisationNameverificationsIDInternalServerError struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsIDInternalServerError) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{id}][%d] getOrganisationNameverificationsIdInternalServerError", 500) +} + +func (o *GetOrganisationNameverificationsIDInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_requests.go b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_requests.go new file mode 100644 index 00000000..0e8537a7 --- /dev/null +++ b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_requests.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// Client.GetOrganisationNameverificationsNameVerificationIDAdmissionsID creates a new GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest object +// with the default values initialized. +func (c *Client) GetOrganisationNameverificationsNameVerificationIDAdmissionsID() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest { + var () + return &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest{ + + ID: c.Defaults.GetStrfmtUUID("GetOrganisationNameverificationsNameVerificationIDAdmissionsID", "id"), + + NameVerificationID: c.Defaults.GetStrfmtUUID("GetOrganisationNameverificationsNameVerificationIDAdmissionsID", "name_verification_id"), + + timeout: cr.DefaultTimeout, + + transport: c.transport, + formats: c.formats, + } +} + +type GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest struct { + + /*ID*/ + + ID strfmt.UUID + + /*NameVerificationID*/ + + NameVerificationID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client + + transport runtime.ClientTransport + formats strfmt.Registry +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) FromJson(j string) (*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest, error) { + + return o, nil +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) WithID(id strfmt.UUID) *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest { + + o.ID = id + + return o +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) WithNameVerificationID(nameVerificationID strfmt.UUID) *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest { + + o.NameVerificationID = nameVerificationID + + return o +} + +////////////////// +// WithContext adds the context to the get organisation nameverifications name verification ID admissions ID Request +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) WithContext(ctx context.Context) *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest { + o.Context = ctx + return o +} + +// WithHTTPClient adds the HTTPClient to the get organisation nameverifications name verification ID admissions ID Request +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) WithHTTPClient(client *http.Client) *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest { + o.HTTPClient = client + return o +} + +// WriteToRequest writes these Request to a swagger request +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID.String()); err != nil { + return err + } + + // path param name_verification_id + if err := r.SetPathParam("name_verification_id", o.NameVerificationID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_responses.go b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_responses.go new file mode 100644 index 00000000..149bb668 --- /dev/null +++ b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_name_verification_id_admissions_id_responses.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/form3tech-oss/go-form3/v6/pkg/generated/models" +) + +// GetOrganisationNameverificationsNameVerificationIDAdmissionsIDReader is a Reader for the GetOrganisationNameverificationsNameVerificationIDAdmissionsID structure. +type GetOrganisationNameverificationsNameVerificationIDAdmissionsIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 403: + result := NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK creates a GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK with default headers values +func NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK { + return &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK{} +} + +/*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK handles this case with default header values. + +Name verification admission details +*/ +type GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK struct { + + //Payload + + // isStream: false + *models.NameVerificationAdmissionDetailsResponse +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{name_verification_id}/admissions/{id}][%d] getOrganisationNameverificationsNameVerificationIdAdmissionsIdOK", 200) +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.NameVerificationAdmissionDetailsResponse = new(models.NameVerificationAdmissionDetailsResponse) + + // response payload + + if err := consumer.Consume(response.Body(), o.NameVerificationAdmissionDetailsResponse); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden creates a GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden with default headers values +func NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden { + return &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden{} +} + +/*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden handles this case with default header values. + +Forbidden +*/ +type GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{name_verification_id}/admissions/{id}][%d] getOrganisationNameverificationsNameVerificationIdAdmissionsIdForbidden", 403) +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound creates a GetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound with default headers values +func NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound { + return &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound{} +} + +/*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound handles this case with default header values. + +Not Found +*/ +type GetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{name_verification_id}/admissions/{id}][%d] getOrganisationNameverificationsNameVerificationIdAdmissionsIdNotFound", 404) +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError creates a GetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError with default headers values +func NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError { + return &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError{} +} + +/*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type GetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{name_verification_id}/admissions/{id}][%d] getOrganisationNameverificationsNameVerificationIdAdmissionsIdInternalServerError", 500) +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/generated/client/name_verification_api/get_organisation_nameverifications_requests.go b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_requests.go new file mode 100644 index 00000000..010c9903 --- /dev/null +++ b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_requests.go @@ -0,0 +1,1179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// Client.GetOrganisationNameverifications creates a new GetOrganisationNameverificationsRequest object +// with the default values initialized. +func (c *Client) GetOrganisationNameverifications() *GetOrganisationNameverificationsRequest { + var () + return &GetOrganisationNameverificationsRequest{ + + FilterAccountClassification: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[account_classification]"), + + FilterAccountNumber: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[account_number]"), + + FilterAdmissionActualName: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[admission.actual_name]"), + + FilterAdmissionAnswer: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[admission.answer]"), + + FilterAdmissionCreatedDateFrom: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[admission.created_date_from]"), + + FilterAdmissionCreatedDateTo: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[admission.created_date_to]"), + + FilterAdmissionModifiedDateFrom: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[admission.modified_date_from]"), + + FilterAdmissionModifiedDateTo: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[admission.modified_date_to]"), + + FilterAdmissionReason: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[admission.reason]"), + + FilterAdmissionReasonCode: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[admission.reason_code]"), + + FilterAdmissionStatus: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[admission.status]"), + + FilterBankID: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[bank_id]"), + + FilterBankIDCode: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[bank_id_code]"), + + FilterCreatedDateFrom: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[created_date_from]"), + + FilterCreatedDateTo: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[created_date_to]"), + + FilterModifiedDateFrom: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[modified_date_from]"), + + FilterModifiedDateTo: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[modified_date_to]"), + + FilterName: make([]string, 0), + + FilterOrganisationID: c.Defaults.GetStrfmtUUIDPtr("GetOrganisationNameverifications", "filter[organisation_id]"), + + FilterSecondaryIdentification: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[secondary_identification]"), + + FilterSubmissionActualName: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[submission.actual_name]"), + + FilterSubmissionAnswer: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[submission.answer]"), + + FilterSubmissionCreatedDateFrom: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[submission.created_date_from]"), + + FilterSubmissionCreatedDateTo: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[submission.created_date_to]"), + + FilterSubmissionModifiedDateFrom: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[submission.modified_date_from]"), + + FilterSubmissionModifiedDateTo: c.Defaults.GetStrfmtDateTimePtr("GetOrganisationNameverifications", "filter[submission.modified_date_to]"), + + FilterSubmissionReason: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[submission.reason]"), + + FilterSubmissionReasonCode: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[submission.reason_code]"), + + FilterSubmissionStatus: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "filter[submission.status]"), + + PageNumber: c.Defaults.GetStringPtr("GetOrganisationNameverifications", "page[number]"), + + PageSize: c.Defaults.GetInt64Ptr("GetOrganisationNameverifications", "page[size]"), + + timeout: cr.DefaultTimeout, + + transport: c.transport, + formats: c.formats, + } +} + +type GetOrganisationNameverificationsRequest struct { + + /*FilterAccountClassification Filter by account classification */ + + FilterAccountClassification *string + + /*FilterAccountNumber Filter by account number */ + + FilterAccountNumber *string + + /*FilterAdmissionActualName Filter by admission actual name */ + + FilterAdmissionActualName *string + + /*FilterAdmissionAnswer Filter by admission answer */ + + FilterAdmissionAnswer *string + + /*FilterAdmissionCreatedDateFrom Filter by admission created date from */ + + FilterAdmissionCreatedDateFrom *strfmt.DateTime + + /*FilterAdmissionCreatedDateTo Filter by admission created date to */ + + FilterAdmissionCreatedDateTo *strfmt.DateTime + + /*FilterAdmissionModifiedDateFrom Filter by admission modified date from */ + + FilterAdmissionModifiedDateFrom *strfmt.DateTime + + /*FilterAdmissionModifiedDateTo Filter by admission modified date to */ + + FilterAdmissionModifiedDateTo *strfmt.DateTime + + /*FilterAdmissionReason Filter by admission reason */ + + FilterAdmissionReason *string + + /*FilterAdmissionReasonCode Filter by admission reason code */ + + FilterAdmissionReasonCode *string + + /*FilterAdmissionStatus Filter by admission status */ + + FilterAdmissionStatus *string + + /*FilterBankID Filter by bank id */ + + FilterBankID *string + + /*FilterBankIDCode Filter by bank id code */ + + FilterBankIDCode *string + + /*FilterCreatedDateFrom Filter by created date from */ + + FilterCreatedDateFrom *strfmt.DateTime + + /*FilterCreatedDateTo Filter by created date to */ + + FilterCreatedDateTo *strfmt.DateTime + + /*FilterModifiedDateFrom Filter by modified date from */ + + FilterModifiedDateFrom *strfmt.DateTime + + /*FilterModifiedDateTo Filter by modified date to */ + + FilterModifiedDateTo *strfmt.DateTime + + /*FilterName Filter by name */ + + FilterName []string + + /*FilterOrganisationID Filter by organisation id */ + + FilterOrganisationID *strfmt.UUID + + /*FilterSecondaryIdentification Filter by secondary identification */ + + FilterSecondaryIdentification *string + + /*FilterSubmissionActualName Filter by submission actual name */ + + FilterSubmissionActualName *string + + /*FilterSubmissionAnswer Filter by submission answer */ + + FilterSubmissionAnswer *string + + /*FilterSubmissionCreatedDateFrom Filter by submission created date from */ + + FilterSubmissionCreatedDateFrom *strfmt.DateTime + + /*FilterSubmissionCreatedDateTo Filter by submission created date to */ + + FilterSubmissionCreatedDateTo *strfmt.DateTime + + /*FilterSubmissionModifiedDateFrom Filter by submission modified date from */ + + FilterSubmissionModifiedDateFrom *strfmt.DateTime + + /*FilterSubmissionModifiedDateTo Filter by submission modified date to */ + + FilterSubmissionModifiedDateTo *strfmt.DateTime + + /*FilterSubmissionReason Filter by submission reason */ + + FilterSubmissionReason *string + + /*FilterSubmissionReasonCode Filter by submission reason code */ + + FilterSubmissionReasonCode *string + + /*FilterSubmissionStatus Filter by submission status */ + + FilterSubmissionStatus *string + + /*PageNumber Which page to select */ + + PageNumber *string + + /*PageSize Number of items to select */ + + PageSize *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client + + transport runtime.ClientTransport + formats strfmt.Registry +} + +func (o *GetOrganisationNameverificationsRequest) FromJson(j string) (*GetOrganisationNameverificationsRequest, error) { + + return o, nil +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAccountClassification(filterAccountClassification string) *GetOrganisationNameverificationsRequest { + + o.FilterAccountClassification = &filterAccountClassification + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAccountClassification() *GetOrganisationNameverificationsRequest { + + o.FilterAccountClassification = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAccountNumber(filterAccountNumber string) *GetOrganisationNameverificationsRequest { + + o.FilterAccountNumber = &filterAccountNumber + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAccountNumber() *GetOrganisationNameverificationsRequest { + + o.FilterAccountNumber = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionActualName(filterAdmissionActualName string) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionActualName = &filterAdmissionActualName + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionActualName() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionActualName = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionAnswer(filterAdmissionAnswer string) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionAnswer = &filterAdmissionAnswer + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionAnswer() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionAnswer = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionCreatedDateFrom(filterAdmissionCreatedDateFrom strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionCreatedDateFrom = &filterAdmissionCreatedDateFrom + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionCreatedDateFrom() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionCreatedDateFrom = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionCreatedDateTo(filterAdmissionCreatedDateTo strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionCreatedDateTo = &filterAdmissionCreatedDateTo + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionCreatedDateTo() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionCreatedDateTo = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionModifiedDateFrom(filterAdmissionModifiedDateFrom strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionModifiedDateFrom = &filterAdmissionModifiedDateFrom + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionModifiedDateFrom() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionModifiedDateFrom = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionModifiedDateTo(filterAdmissionModifiedDateTo strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionModifiedDateTo = &filterAdmissionModifiedDateTo + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionModifiedDateTo() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionModifiedDateTo = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionReason(filterAdmissionReason string) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionReason = &filterAdmissionReason + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionReason() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionReason = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionReasonCode(filterAdmissionReasonCode string) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionReasonCode = &filterAdmissionReasonCode + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionReasonCode() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionReasonCode = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterAdmissionStatus(filterAdmissionStatus string) *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionStatus = &filterAdmissionStatus + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterAdmissionStatus() *GetOrganisationNameverificationsRequest { + + o.FilterAdmissionStatus = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterBankID(filterBankID string) *GetOrganisationNameverificationsRequest { + + o.FilterBankID = &filterBankID + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterBankID() *GetOrganisationNameverificationsRequest { + + o.FilterBankID = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterBankIDCode(filterBankIDCode string) *GetOrganisationNameverificationsRequest { + + o.FilterBankIDCode = &filterBankIDCode + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterBankIDCode() *GetOrganisationNameverificationsRequest { + + o.FilterBankIDCode = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterCreatedDateFrom(filterCreatedDateFrom strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterCreatedDateFrom = &filterCreatedDateFrom + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterCreatedDateFrom() *GetOrganisationNameverificationsRequest { + + o.FilterCreatedDateFrom = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterCreatedDateTo(filterCreatedDateTo strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterCreatedDateTo = &filterCreatedDateTo + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterCreatedDateTo() *GetOrganisationNameverificationsRequest { + + o.FilterCreatedDateTo = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterModifiedDateFrom(filterModifiedDateFrom strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterModifiedDateFrom = &filterModifiedDateFrom + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterModifiedDateFrom() *GetOrganisationNameverificationsRequest { + + o.FilterModifiedDateFrom = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterModifiedDateTo(filterModifiedDateTo strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterModifiedDateTo = &filterModifiedDateTo + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterModifiedDateTo() *GetOrganisationNameverificationsRequest { + + o.FilterModifiedDateTo = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterName(filterName []string) *GetOrganisationNameverificationsRequest { + + o.FilterName = filterName + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterName() *GetOrganisationNameverificationsRequest { + + o.FilterName = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterOrganisationID(filterOrganisationID strfmt.UUID) *GetOrganisationNameverificationsRequest { + + o.FilterOrganisationID = &filterOrganisationID + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterOrganisationID() *GetOrganisationNameverificationsRequest { + + o.FilterOrganisationID = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSecondaryIdentification(filterSecondaryIdentification string) *GetOrganisationNameverificationsRequest { + + o.FilterSecondaryIdentification = &filterSecondaryIdentification + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSecondaryIdentification() *GetOrganisationNameverificationsRequest { + + o.FilterSecondaryIdentification = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionActualName(filterSubmissionActualName string) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionActualName = &filterSubmissionActualName + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionActualName() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionActualName = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionAnswer(filterSubmissionAnswer string) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionAnswer = &filterSubmissionAnswer + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionAnswer() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionAnswer = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionCreatedDateFrom(filterSubmissionCreatedDateFrom strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionCreatedDateFrom = &filterSubmissionCreatedDateFrom + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionCreatedDateFrom() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionCreatedDateFrom = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionCreatedDateTo(filterSubmissionCreatedDateTo strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionCreatedDateTo = &filterSubmissionCreatedDateTo + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionCreatedDateTo() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionCreatedDateTo = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionModifiedDateFrom(filterSubmissionModifiedDateFrom strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionModifiedDateFrom = &filterSubmissionModifiedDateFrom + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionModifiedDateFrom() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionModifiedDateFrom = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionModifiedDateTo(filterSubmissionModifiedDateTo strfmt.DateTime) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionModifiedDateTo = &filterSubmissionModifiedDateTo + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionModifiedDateTo() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionModifiedDateTo = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionReason(filterSubmissionReason string) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionReason = &filterSubmissionReason + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionReason() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionReason = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionReasonCode(filterSubmissionReasonCode string) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionReasonCode = &filterSubmissionReasonCode + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionReasonCode() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionReasonCode = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithFilterSubmissionStatus(filterSubmissionStatus string) *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionStatus = &filterSubmissionStatus + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutFilterSubmissionStatus() *GetOrganisationNameverificationsRequest { + + o.FilterSubmissionStatus = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithPageNumber(pageNumber string) *GetOrganisationNameverificationsRequest { + + o.PageNumber = &pageNumber + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutPageNumber() *GetOrganisationNameverificationsRequest { + + o.PageNumber = nil + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithPageSize(pageSize int64) *GetOrganisationNameverificationsRequest { + + o.PageSize = &pageSize + + return o +} + +func (o *GetOrganisationNameverificationsRequest) WithoutPageSize() *GetOrganisationNameverificationsRequest { + + o.PageSize = nil + + return o +} + +////////////////// +// WithContext adds the context to the get organisation nameverifications Request +func (o *GetOrganisationNameverificationsRequest) WithContext(ctx context.Context) *GetOrganisationNameverificationsRequest { + o.Context = ctx + return o +} + +// WithHTTPClient adds the HTTPClient to the get organisation nameverifications Request +func (o *GetOrganisationNameverificationsRequest) WithHTTPClient(client *http.Client) *GetOrganisationNameverificationsRequest { + o.HTTPClient = client + return o +} + +// WriteToRequest writes these Request to a swagger request +func (o *GetOrganisationNameverificationsRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.FilterAccountClassification != nil { + + // query param filter[account_classification] + var qrFilterAccountClassification string + if o.FilterAccountClassification != nil { + qrFilterAccountClassification = *o.FilterAccountClassification + } + qFilterAccountClassification := qrFilterAccountClassification + if qFilterAccountClassification != "" { + if err := r.SetQueryParam("filter[account_classification]", qFilterAccountClassification); err != nil { + return err + } + } + + } + + if o.FilterAccountNumber != nil { + + // query param filter[account_number] + var qrFilterAccountNumber string + if o.FilterAccountNumber != nil { + qrFilterAccountNumber = *o.FilterAccountNumber + } + qFilterAccountNumber := qrFilterAccountNumber + if qFilterAccountNumber != "" { + if err := r.SetQueryParam("filter[account_number]", qFilterAccountNumber); err != nil { + return err + } + } + + } + + if o.FilterAdmissionActualName != nil { + + // query param filter[admission.actual_name] + var qrFilterAdmissionActualName string + if o.FilterAdmissionActualName != nil { + qrFilterAdmissionActualName = *o.FilterAdmissionActualName + } + qFilterAdmissionActualName := qrFilterAdmissionActualName + if qFilterAdmissionActualName != "" { + if err := r.SetQueryParam("filter[admission.actual_name]", qFilterAdmissionActualName); err != nil { + return err + } + } + + } + + if o.FilterAdmissionAnswer != nil { + + // query param filter[admission.answer] + var qrFilterAdmissionAnswer string + if o.FilterAdmissionAnswer != nil { + qrFilterAdmissionAnswer = *o.FilterAdmissionAnswer + } + qFilterAdmissionAnswer := qrFilterAdmissionAnswer + if qFilterAdmissionAnswer != "" { + if err := r.SetQueryParam("filter[admission.answer]", qFilterAdmissionAnswer); err != nil { + return err + } + } + + } + + if o.FilterAdmissionCreatedDateFrom != nil { + + // query param filter[admission.created_date_from] + var qrFilterAdmissionCreatedDateFrom strfmt.DateTime + if o.FilterAdmissionCreatedDateFrom != nil { + qrFilterAdmissionCreatedDateFrom = *o.FilterAdmissionCreatedDateFrom + } + qFilterAdmissionCreatedDateFrom := qrFilterAdmissionCreatedDateFrom.String() + if qFilterAdmissionCreatedDateFrom != "" { + if err := r.SetQueryParam("filter[admission.created_date_from]", qFilterAdmissionCreatedDateFrom); err != nil { + return err + } + } + + } + + if o.FilterAdmissionCreatedDateTo != nil { + + // query param filter[admission.created_date_to] + var qrFilterAdmissionCreatedDateTo strfmt.DateTime + if o.FilterAdmissionCreatedDateTo != nil { + qrFilterAdmissionCreatedDateTo = *o.FilterAdmissionCreatedDateTo + } + qFilterAdmissionCreatedDateTo := qrFilterAdmissionCreatedDateTo.String() + if qFilterAdmissionCreatedDateTo != "" { + if err := r.SetQueryParam("filter[admission.created_date_to]", qFilterAdmissionCreatedDateTo); err != nil { + return err + } + } + + } + + if o.FilterAdmissionModifiedDateFrom != nil { + + // query param filter[admission.modified_date_from] + var qrFilterAdmissionModifiedDateFrom strfmt.DateTime + if o.FilterAdmissionModifiedDateFrom != nil { + qrFilterAdmissionModifiedDateFrom = *o.FilterAdmissionModifiedDateFrom + } + qFilterAdmissionModifiedDateFrom := qrFilterAdmissionModifiedDateFrom.String() + if qFilterAdmissionModifiedDateFrom != "" { + if err := r.SetQueryParam("filter[admission.modified_date_from]", qFilterAdmissionModifiedDateFrom); err != nil { + return err + } + } + + } + + if o.FilterAdmissionModifiedDateTo != nil { + + // query param filter[admission.modified_date_to] + var qrFilterAdmissionModifiedDateTo strfmt.DateTime + if o.FilterAdmissionModifiedDateTo != nil { + qrFilterAdmissionModifiedDateTo = *o.FilterAdmissionModifiedDateTo + } + qFilterAdmissionModifiedDateTo := qrFilterAdmissionModifiedDateTo.String() + if qFilterAdmissionModifiedDateTo != "" { + if err := r.SetQueryParam("filter[admission.modified_date_to]", qFilterAdmissionModifiedDateTo); err != nil { + return err + } + } + + } + + if o.FilterAdmissionReason != nil { + + // query param filter[admission.reason] + var qrFilterAdmissionReason string + if o.FilterAdmissionReason != nil { + qrFilterAdmissionReason = *o.FilterAdmissionReason + } + qFilterAdmissionReason := qrFilterAdmissionReason + if qFilterAdmissionReason != "" { + if err := r.SetQueryParam("filter[admission.reason]", qFilterAdmissionReason); err != nil { + return err + } + } + + } + + if o.FilterAdmissionReasonCode != nil { + + // query param filter[admission.reason_code] + var qrFilterAdmissionReasonCode string + if o.FilterAdmissionReasonCode != nil { + qrFilterAdmissionReasonCode = *o.FilterAdmissionReasonCode + } + qFilterAdmissionReasonCode := qrFilterAdmissionReasonCode + if qFilterAdmissionReasonCode != "" { + if err := r.SetQueryParam("filter[admission.reason_code]", qFilterAdmissionReasonCode); err != nil { + return err + } + } + + } + + if o.FilterAdmissionStatus != nil { + + // query param filter[admission.status] + var qrFilterAdmissionStatus string + if o.FilterAdmissionStatus != nil { + qrFilterAdmissionStatus = *o.FilterAdmissionStatus + } + qFilterAdmissionStatus := qrFilterAdmissionStatus + if qFilterAdmissionStatus != "" { + if err := r.SetQueryParam("filter[admission.status]", qFilterAdmissionStatus); err != nil { + return err + } + } + + } + + if o.FilterBankID != nil { + + // query param filter[bank_id] + var qrFilterBankID string + if o.FilterBankID != nil { + qrFilterBankID = *o.FilterBankID + } + qFilterBankID := qrFilterBankID + if qFilterBankID != "" { + if err := r.SetQueryParam("filter[bank_id]", qFilterBankID); err != nil { + return err + } + } + + } + + if o.FilterBankIDCode != nil { + + // query param filter[bank_id_code] + var qrFilterBankIDCode string + if o.FilterBankIDCode != nil { + qrFilterBankIDCode = *o.FilterBankIDCode + } + qFilterBankIDCode := qrFilterBankIDCode + if qFilterBankIDCode != "" { + if err := r.SetQueryParam("filter[bank_id_code]", qFilterBankIDCode); err != nil { + return err + } + } + + } + + if o.FilterCreatedDateFrom != nil { + + // query param filter[created_date_from] + var qrFilterCreatedDateFrom strfmt.DateTime + if o.FilterCreatedDateFrom != nil { + qrFilterCreatedDateFrom = *o.FilterCreatedDateFrom + } + qFilterCreatedDateFrom := qrFilterCreatedDateFrom.String() + if qFilterCreatedDateFrom != "" { + if err := r.SetQueryParam("filter[created_date_from]", qFilterCreatedDateFrom); err != nil { + return err + } + } + + } + + if o.FilterCreatedDateTo != nil { + + // query param filter[created_date_to] + var qrFilterCreatedDateTo strfmt.DateTime + if o.FilterCreatedDateTo != nil { + qrFilterCreatedDateTo = *o.FilterCreatedDateTo + } + qFilterCreatedDateTo := qrFilterCreatedDateTo.String() + if qFilterCreatedDateTo != "" { + if err := r.SetQueryParam("filter[created_date_to]", qFilterCreatedDateTo); err != nil { + return err + } + } + + } + + if o.FilterModifiedDateFrom != nil { + + // query param filter[modified_date_from] + var qrFilterModifiedDateFrom strfmt.DateTime + if o.FilterModifiedDateFrom != nil { + qrFilterModifiedDateFrom = *o.FilterModifiedDateFrom + } + qFilterModifiedDateFrom := qrFilterModifiedDateFrom.String() + if qFilterModifiedDateFrom != "" { + if err := r.SetQueryParam("filter[modified_date_from]", qFilterModifiedDateFrom); err != nil { + return err + } + } + + } + + if o.FilterModifiedDateTo != nil { + + // query param filter[modified_date_to] + var qrFilterModifiedDateTo strfmt.DateTime + if o.FilterModifiedDateTo != nil { + qrFilterModifiedDateTo = *o.FilterModifiedDateTo + } + qFilterModifiedDateTo := qrFilterModifiedDateTo.String() + if qFilterModifiedDateTo != "" { + if err := r.SetQueryParam("filter[modified_date_to]", qFilterModifiedDateTo); err != nil { + return err + } + } + + } + + valuesFilterName := o.FilterName + + joinedFilterName := swag.JoinByFormat(valuesFilterName, "") + // query array param filter[name] + if err := r.SetQueryParam("filter[name]", joinedFilterName...); err != nil { + return err + } + + if o.FilterOrganisationID != nil { + + // query param filter[organisation_id] + var qrFilterOrganisationID strfmt.UUID + if o.FilterOrganisationID != nil { + qrFilterOrganisationID = *o.FilterOrganisationID + } + qFilterOrganisationID := qrFilterOrganisationID.String() + if qFilterOrganisationID != "" { + if err := r.SetQueryParam("filter[organisation_id]", qFilterOrganisationID); err != nil { + return err + } + } + + } + + if o.FilterSecondaryIdentification != nil { + + // query param filter[secondary_identification] + var qrFilterSecondaryIdentification string + if o.FilterSecondaryIdentification != nil { + qrFilterSecondaryIdentification = *o.FilterSecondaryIdentification + } + qFilterSecondaryIdentification := qrFilterSecondaryIdentification + if qFilterSecondaryIdentification != "" { + if err := r.SetQueryParam("filter[secondary_identification]", qFilterSecondaryIdentification); err != nil { + return err + } + } + + } + + if o.FilterSubmissionActualName != nil { + + // query param filter[submission.actual_name] + var qrFilterSubmissionActualName string + if o.FilterSubmissionActualName != nil { + qrFilterSubmissionActualName = *o.FilterSubmissionActualName + } + qFilterSubmissionActualName := qrFilterSubmissionActualName + if qFilterSubmissionActualName != "" { + if err := r.SetQueryParam("filter[submission.actual_name]", qFilterSubmissionActualName); err != nil { + return err + } + } + + } + + if o.FilterSubmissionAnswer != nil { + + // query param filter[submission.answer] + var qrFilterSubmissionAnswer string + if o.FilterSubmissionAnswer != nil { + qrFilterSubmissionAnswer = *o.FilterSubmissionAnswer + } + qFilterSubmissionAnswer := qrFilterSubmissionAnswer + if qFilterSubmissionAnswer != "" { + if err := r.SetQueryParam("filter[submission.answer]", qFilterSubmissionAnswer); err != nil { + return err + } + } + + } + + if o.FilterSubmissionCreatedDateFrom != nil { + + // query param filter[submission.created_date_from] + var qrFilterSubmissionCreatedDateFrom strfmt.DateTime + if o.FilterSubmissionCreatedDateFrom != nil { + qrFilterSubmissionCreatedDateFrom = *o.FilterSubmissionCreatedDateFrom + } + qFilterSubmissionCreatedDateFrom := qrFilterSubmissionCreatedDateFrom.String() + if qFilterSubmissionCreatedDateFrom != "" { + if err := r.SetQueryParam("filter[submission.created_date_from]", qFilterSubmissionCreatedDateFrom); err != nil { + return err + } + } + + } + + if o.FilterSubmissionCreatedDateTo != nil { + + // query param filter[submission.created_date_to] + var qrFilterSubmissionCreatedDateTo strfmt.DateTime + if o.FilterSubmissionCreatedDateTo != nil { + qrFilterSubmissionCreatedDateTo = *o.FilterSubmissionCreatedDateTo + } + qFilterSubmissionCreatedDateTo := qrFilterSubmissionCreatedDateTo.String() + if qFilterSubmissionCreatedDateTo != "" { + if err := r.SetQueryParam("filter[submission.created_date_to]", qFilterSubmissionCreatedDateTo); err != nil { + return err + } + } + + } + + if o.FilterSubmissionModifiedDateFrom != nil { + + // query param filter[submission.modified_date_from] + var qrFilterSubmissionModifiedDateFrom strfmt.DateTime + if o.FilterSubmissionModifiedDateFrom != nil { + qrFilterSubmissionModifiedDateFrom = *o.FilterSubmissionModifiedDateFrom + } + qFilterSubmissionModifiedDateFrom := qrFilterSubmissionModifiedDateFrom.String() + if qFilterSubmissionModifiedDateFrom != "" { + if err := r.SetQueryParam("filter[submission.modified_date_from]", qFilterSubmissionModifiedDateFrom); err != nil { + return err + } + } + + } + + if o.FilterSubmissionModifiedDateTo != nil { + + // query param filter[submission.modified_date_to] + var qrFilterSubmissionModifiedDateTo strfmt.DateTime + if o.FilterSubmissionModifiedDateTo != nil { + qrFilterSubmissionModifiedDateTo = *o.FilterSubmissionModifiedDateTo + } + qFilterSubmissionModifiedDateTo := qrFilterSubmissionModifiedDateTo.String() + if qFilterSubmissionModifiedDateTo != "" { + if err := r.SetQueryParam("filter[submission.modified_date_to]", qFilterSubmissionModifiedDateTo); err != nil { + return err + } + } + + } + + if o.FilterSubmissionReason != nil { + + // query param filter[submission.reason] + var qrFilterSubmissionReason string + if o.FilterSubmissionReason != nil { + qrFilterSubmissionReason = *o.FilterSubmissionReason + } + qFilterSubmissionReason := qrFilterSubmissionReason + if qFilterSubmissionReason != "" { + if err := r.SetQueryParam("filter[submission.reason]", qFilterSubmissionReason); err != nil { + return err + } + } + + } + + if o.FilterSubmissionReasonCode != nil { + + // query param filter[submission.reason_code] + var qrFilterSubmissionReasonCode string + if o.FilterSubmissionReasonCode != nil { + qrFilterSubmissionReasonCode = *o.FilterSubmissionReasonCode + } + qFilterSubmissionReasonCode := qrFilterSubmissionReasonCode + if qFilterSubmissionReasonCode != "" { + if err := r.SetQueryParam("filter[submission.reason_code]", qFilterSubmissionReasonCode); err != nil { + return err + } + } + + } + + if o.FilterSubmissionStatus != nil { + + // query param filter[submission.status] + var qrFilterSubmissionStatus string + if o.FilterSubmissionStatus != nil { + qrFilterSubmissionStatus = *o.FilterSubmissionStatus + } + qFilterSubmissionStatus := qrFilterSubmissionStatus + if qFilterSubmissionStatus != "" { + if err := r.SetQueryParam("filter[submission.status]", qFilterSubmissionStatus); err != nil { + return err + } + } + + } + + if o.PageNumber != nil { + + // query param page[number] + var qrPageNumber string + if o.PageNumber != nil { + qrPageNumber = *o.PageNumber + } + qPageNumber := qrPageNumber + if qPageNumber != "" { + if err := r.SetQueryParam("page[number]", qPageNumber); err != nil { + return err + } + } + + } + + if o.PageSize != nil { + + // query param page[size] + var qrPageSize int64 + if o.PageSize != nil { + qrPageSize = *o.PageSize + } + qPageSize := swag.FormatInt64(qrPageSize) + if qPageSize != "" { + if err := r.SetQueryParam("page[size]", qPageSize); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/generated/client/name_verification_api/get_organisation_nameverifications_responses.go b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_responses.go new file mode 100644 index 00000000..1bd08ef6 --- /dev/null +++ b/pkg/generated/client/name_verification_api/get_organisation_nameverifications_responses.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/form3tech-oss/go-form3/v6/pkg/generated/models" +) + +// GetOrganisationNameverificationsReader is a Reader for the GetOrganisationNameverifications structure. +type GetOrganisationNameverificationsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetOrganisationNameverificationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetOrganisationNameverificationsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewGetOrganisationNameverificationsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 403: + result := NewGetOrganisationNameverificationsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 404: + result := NewGetOrganisationNameverificationsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewGetOrganisationNameverificationsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetOrganisationNameverificationsOK creates a GetOrganisationNameverificationsOK with default headers values +func NewGetOrganisationNameverificationsOK() *GetOrganisationNameverificationsOK { + return &GetOrganisationNameverificationsOK{} +} + +/*GetOrganisationNameverificationsOK handles this case with default header values. + +List of name verification details +*/ +type GetOrganisationNameverificationsOK struct { + + //Payload + + // isStream: false + *models.NameVerificationDetailsListResponse +} + +func (o *GetOrganisationNameverificationsOK) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications][%d] getOrganisationNameverificationsOK", 200) +} + +func (o *GetOrganisationNameverificationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.NameVerificationDetailsListResponse = new(models.NameVerificationDetailsListResponse) + + // response payload + + if err := consumer.Consume(response.Body(), o.NameVerificationDetailsListResponse); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsBadRequest creates a GetOrganisationNameverificationsBadRequest with default headers values +func NewGetOrganisationNameverificationsBadRequest() *GetOrganisationNameverificationsBadRequest { + return &GetOrganisationNameverificationsBadRequest{} +} + +/*GetOrganisationNameverificationsBadRequest handles this case with default header values. + +Bad Request +*/ +type GetOrganisationNameverificationsBadRequest struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsBadRequest) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications][%d] getOrganisationNameverificationsBadRequest", 400) +} + +func (o *GetOrganisationNameverificationsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsForbidden creates a GetOrganisationNameverificationsForbidden with default headers values +func NewGetOrganisationNameverificationsForbidden() *GetOrganisationNameverificationsForbidden { + return &GetOrganisationNameverificationsForbidden{} +} + +/*GetOrganisationNameverificationsForbidden handles this case with default header values. + +Forbidden +*/ +type GetOrganisationNameverificationsForbidden struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsForbidden) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications][%d] getOrganisationNameverificationsForbidden", 403) +} + +func (o *GetOrganisationNameverificationsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsNotFound creates a GetOrganisationNameverificationsNotFound with default headers values +func NewGetOrganisationNameverificationsNotFound() *GetOrganisationNameverificationsNotFound { + return &GetOrganisationNameverificationsNotFound{} +} + +/*GetOrganisationNameverificationsNotFound handles this case with default header values. + +Not Found +*/ +type GetOrganisationNameverificationsNotFound struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsNotFound) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications][%d] getOrganisationNameverificationsNotFound", 404) +} + +func (o *GetOrganisationNameverificationsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetOrganisationNameverificationsInternalServerError creates a GetOrganisationNameverificationsInternalServerError with default headers values +func NewGetOrganisationNameverificationsInternalServerError() *GetOrganisationNameverificationsInternalServerError { + return &GetOrganisationNameverificationsInternalServerError{} +} + +/*GetOrganisationNameverificationsInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type GetOrganisationNameverificationsInternalServerError struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsInternalServerError) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications][%d] getOrganisationNameverificationsInternalServerError", 500) +} + +func (o *GetOrganisationNameverificationsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/generated/client/name_verification_api/name_verification_api_client.go b/pkg/generated/client/name_verification_api/name_verification_api_client.go new file mode 100644 index 00000000..14c82845 --- /dev/null +++ b/pkg/generated/client/name_verification_api/name_verification_api_client.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// :Form3: Testing! + +package name_verification_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/form3tech-oss/go-form3/v6/pkg/client" + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new name verification api API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry, defaults client.Defaults) *Client { + return &Client{transport: transport, formats: formats, Defaults: defaults} +} + +/* +Client for name verification api API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry + Defaults client.Defaults +} + +// range of operations + +/* +get organisation nameverifications API +*/ +func (a *GetOrganisationNameverificationsRequest) Do() (*GetOrganisationNameverificationsOK, error) { + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetOrganisationNameverifications", + Method: "GET", + PathPattern: "/organisation/nameverifications", + ProducesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + ConsumesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + Schemes: []string{"https"}, + Params: a, + Reader: &GetOrganisationNameverificationsReader{formats: a.formats}, + //AuthInfo: authInfo, + Context: a.Context, + Client: a.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetOrganisationNameverificationsOK), nil + +} + +func (a *GetOrganisationNameverificationsRequest) MustDo() *GetOrganisationNameverificationsOK { + r0, err := a.Do() + if err != nil { + panic(err) + } + return r0 +} + +/* +get organisation nameverifications ID API +*/ +func (a *GetOrganisationNameverificationsIDRequest) Do() (*GetOrganisationNameverificationsIDOK, error) { + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetOrganisationNameverificationsID", + Method: "GET", + PathPattern: "/organisation/nameverifications/{id}", + ProducesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + ConsumesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + Schemes: []string{"https"}, + Params: a, + Reader: &GetOrganisationNameverificationsIDReader{formats: a.formats}, + //AuthInfo: authInfo, + Context: a.Context, + Client: a.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetOrganisationNameverificationsIDOK), nil + +} + +func (a *GetOrganisationNameverificationsIDRequest) MustDo() *GetOrganisationNameverificationsIDOK { + r0, err := a.Do() + if err != nil { + panic(err) + } + return r0 +} + +/* +get organisation nameverifications name verification ID admissions ID API +*/ +func (a *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) Do() (*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK, error) { + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetOrganisationNameverificationsNameVerificationIDAdmissionsID", + Method: "GET", + PathPattern: "/organisation/nameverifications/{name_verification_id}/admissions/{id}", + ProducesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + ConsumesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + Schemes: []string{"https"}, + Params: a, + Reader: &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDReader{formats: a.formats}, + //AuthInfo: authInfo, + Context: a.Context, + Client: a.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK), nil + +} + +func (a *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDRequest) MustDo() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK { + r0, err := a.Do() + if err != nil { + panic(err) + } + return r0 +} + +/* +post organisation nameverifications API +*/ +func (a *PostOrganisationNameverificationsRequest) Do() (*PostOrganisationNameverificationsCreated, error) { + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PostOrganisationNameverifications", + Method: "POST", + PathPattern: "/organisation/nameverifications", + ProducesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + ConsumesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + Schemes: []string{"https"}, + Params: a, + Reader: &PostOrganisationNameverificationsReader{formats: a.formats}, + //AuthInfo: authInfo, + Context: a.Context, + Client: a.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PostOrganisationNameverificationsCreated), nil + +} + +func (a *PostOrganisationNameverificationsRequest) MustDo() *PostOrganisationNameverificationsCreated { + r0, err := a.Do() + if err != nil { + panic(err) + } + return r0 +} + +///////// + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/generated/client/name_verification_api/post_organisation_nameverifications_requests.go b/pkg/generated/client/name_verification_api/post_organisation_nameverifications_requests.go new file mode 100644 index 00000000..845c6625 --- /dev/null +++ b/pkg/generated/client/name_verification_api/post_organisation_nameverifications_requests.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/form3tech-oss/go-form3/v6/pkg/generated/models" +) + +// Client.PostOrganisationNameverifications creates a new PostOrganisationNameverificationsRequest object +// with the default values initialized. +func (c *Client) PostOrganisationNameverifications() *PostOrganisationNameverificationsRequest { + var () + return &PostOrganisationNameverificationsRequest{ + + NameVerificationCreation: models.NameVerificationCreationWithDefaults(c.Defaults), + + timeout: cr.DefaultTimeout, + + transport: c.transport, + formats: c.formats, + } +} + +type PostOrganisationNameverificationsRequest struct { + + /*NameVerificationCreationRequest*/ + + *models.NameVerificationCreation + + timeout time.Duration + Context context.Context + HTTPClient *http.Client + + transport runtime.ClientTransport + formats strfmt.Registry +} + +func (o *PostOrganisationNameverificationsRequest) FromJson(j string) (*PostOrganisationNameverificationsRequest, error) { + + var m models.NameVerificationCreation + if err := json.Unmarshal([]byte(j), &m); err != nil { + return nil, fmt.Errorf("could not unmarshal JSON: %w", err) + } + + o.NameVerificationCreation = &m + + return o, nil +} + +func (o *PostOrganisationNameverificationsRequest) WithNameVerificationCreationRequest(nameVerificationCreationRequest models.NameVerificationCreation) *PostOrganisationNameverificationsRequest { + + o.NameVerificationCreation = &nameVerificationCreationRequest + + return o +} + +func (o *PostOrganisationNameverificationsRequest) WithoutNameVerificationCreationRequest() *PostOrganisationNameverificationsRequest { + + o.NameVerificationCreation = &models.NameVerificationCreation{} + + return o +} + +////////////////// +// WithContext adds the context to the post organisation nameverifications Request +func (o *PostOrganisationNameverificationsRequest) WithContext(ctx context.Context) *PostOrganisationNameverificationsRequest { + o.Context = ctx + return o +} + +// WithHTTPClient adds the HTTPClient to the post organisation nameverifications Request +func (o *PostOrganisationNameverificationsRequest) WithHTTPClient(client *http.Client) *PostOrganisationNameverificationsRequest { + o.HTTPClient = client + return o +} + +// WriteToRequest writes these Request to a swagger request +func (o *PostOrganisationNameverificationsRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // ISBODYPARAM + if o.NameVerificationCreation != nil { + if err := r.SetBodyParam(o.NameVerificationCreation); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/generated/client/name_verification_api/post_organisation_nameverifications_responses.go b/pkg/generated/client/name_verification_api/post_organisation_nameverifications_responses.go new file mode 100644 index 00000000..0dbb4bb5 --- /dev/null +++ b/pkg/generated/client/name_verification_api/post_organisation_nameverifications_responses.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package name_verification_api + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/form3tech-oss/go-form3/v6/pkg/generated/models" +) + +// PostOrganisationNameverificationsReader is a Reader for the PostOrganisationNameverifications structure. +type PostOrganisationNameverificationsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostOrganisationNameverificationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewPostOrganisationNameverificationsCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPostOrganisationNameverificationsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 403: + result := NewPostOrganisationNameverificationsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPostOrganisationNameverificationsConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 500: + result := NewPostOrganisationNameverificationsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewPostOrganisationNameverificationsCreated creates a PostOrganisationNameverificationsCreated with default headers values +func NewPostOrganisationNameverificationsCreated() *PostOrganisationNameverificationsCreated { + return &PostOrganisationNameverificationsCreated{} +} + +/*PostOrganisationNameverificationsCreated handles this case with default header values. + +created +*/ +type PostOrganisationNameverificationsCreated struct { + + //Payload + + // isStream: false + *models.NameVerificationCreationResponse +} + +func (o *PostOrganisationNameverificationsCreated) Error() string { + return fmt.Sprintf("[POST /organisation/nameverifications][%d] postOrganisationNameverificationsCreated", 201) +} + +func (o *PostOrganisationNameverificationsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.NameVerificationCreationResponse = new(models.NameVerificationCreationResponse) + + // response payload + + if err := consumer.Consume(response.Body(), o.NameVerificationCreationResponse); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrganisationNameverificationsBadRequest creates a PostOrganisationNameverificationsBadRequest with default headers values +func NewPostOrganisationNameverificationsBadRequest() *PostOrganisationNameverificationsBadRequest { + return &PostOrganisationNameverificationsBadRequest{} +} + +/*PostOrganisationNameverificationsBadRequest handles this case with default header values. + +Bad Request +*/ +type PostOrganisationNameverificationsBadRequest struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PostOrganisationNameverificationsBadRequest) Error() string { + return fmt.Sprintf("[POST /organisation/nameverifications][%d] postOrganisationNameverificationsBadRequest", 400) +} + +func (o *PostOrganisationNameverificationsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrganisationNameverificationsForbidden creates a PostOrganisationNameverificationsForbidden with default headers values +func NewPostOrganisationNameverificationsForbidden() *PostOrganisationNameverificationsForbidden { + return &PostOrganisationNameverificationsForbidden{} +} + +/*PostOrganisationNameverificationsForbidden handles this case with default header values. + +Forbidden +*/ +type PostOrganisationNameverificationsForbidden struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PostOrganisationNameverificationsForbidden) Error() string { + return fmt.Sprintf("[POST /organisation/nameverifications][%d] postOrganisationNameverificationsForbidden", 403) +} + +func (o *PostOrganisationNameverificationsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrganisationNameverificationsConflict creates a PostOrganisationNameverificationsConflict with default headers values +func NewPostOrganisationNameverificationsConflict() *PostOrganisationNameverificationsConflict { + return &PostOrganisationNameverificationsConflict{} +} + +/*PostOrganisationNameverificationsConflict handles this case with default header values. + +Conflict +*/ +type PostOrganisationNameverificationsConflict struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PostOrganisationNameverificationsConflict) Error() string { + return fmt.Sprintf("[POST /organisation/nameverifications][%d] postOrganisationNameverificationsConflict", 409) +} + +func (o *PostOrganisationNameverificationsConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostOrganisationNameverificationsInternalServerError creates a PostOrganisationNameverificationsInternalServerError with default headers values +func NewPostOrganisationNameverificationsInternalServerError() *PostOrganisationNameverificationsInternalServerError { + return &PostOrganisationNameverificationsInternalServerError{} +} + +/*PostOrganisationNameverificationsInternalServerError handles this case with default header values. + +Internal Server Error +*/ +type PostOrganisationNameverificationsInternalServerError struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PostOrganisationNameverificationsInternalServerError) Error() string { + return fmt.Sprintf("[POST /organisation/nameverifications][%d] postOrganisationNameverificationsInternalServerError", 500) +} + +func (o *PostOrganisationNameverificationsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.APIError = new(models.APIError) + + // response payload + + if err := consumer.Consume(response.Body(), o.APIError); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/generated/models/account_classification.go b/pkg/generated/models/account_classification.go new file mode 100644 index 00000000..2fda4afd --- /dev/null +++ b/pkg/generated/models/account_classification.go @@ -0,0 +1,72 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// AccountClassification account classification +// swagger:model AccountClassification +type AccountClassification string + +const ( + + // AccountClassificationPersonal captures enum value "personal" + AccountClassificationPersonal AccountClassification = "personal" + + // AccountClassificationBusiness captures enum value "business" + AccountClassificationBusiness AccountClassification = "business" +) + +// for schema +var accountClassificationEnum []interface{} + +func init() { + var res []AccountClassification + if err := json.Unmarshal([]byte(`["personal","business"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + accountClassificationEnum = append(accountClassificationEnum, v) + } +} + +func (m AccountClassification) validateAccountClassificationEnum(path, location string, value AccountClassification) error { + if err := validate.Enum(path, location, value, accountClassificationEnum); err != nil { + return err + } + return nil +} + +// Validate validates this account classification +func (m AccountClassification) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateAccountClassificationEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccountClassification) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/direct_debit_admission_status_reason.go b/pkg/generated/models/direct_debit_admission_status_reason.go index 404dc02d..6d23c87c 100644 --- a/pkg/generated/models/direct_debit_admission_status_reason.go +++ b/pkg/generated/models/direct_debit_admission_status_reason.go @@ -27,6 +27,9 @@ const ( // DirectDebitAdmissionStatusReasonInvalidBeneficiaryDetails captures enum value "invalid_beneficiary_details" DirectDebitAdmissionStatusReasonInvalidBeneficiaryDetails DirectDebitAdmissionStatusReason = "invalid_beneficiary_details" + // DirectDebitAdmissionStatusReasonInvalidTransaction captures enum value "invalid_transaction" + DirectDebitAdmissionStatusReasonInvalidTransaction DirectDebitAdmissionStatusReason = "invalid_transaction" + // DirectDebitAdmissionStatusReasonBankidNotProvisioned captures enum value "bankid_not_provisioned" DirectDebitAdmissionStatusReasonBankidNotProvisioned DirectDebitAdmissionStatusReason = "bankid_not_provisioned" @@ -75,7 +78,7 @@ var directDebitAdmissionStatusReasonEnum []interface{} func init() { var res []DirectDebitAdmissionStatusReason - if err := json.Unmarshal([]byte(`["accepted","invalid_beneficiary_details","bankid_not_provisioned","unknown_accountnumber","pending_settlement","settlement_failed","duplication","not_allowed_amount","mandate_cancelled","no_instruction","account_transferred_to_new_psp","paying_bank_cancellation","cancelled_by_payer","payer_deceased","account_closed","scheme_status_invalid"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["accepted","invalid_beneficiary_details","invalid_transaction","bankid_not_provisioned","unknown_accountnumber","pending_settlement","settlement_failed","duplication","not_allowed_amount","mandate_cancelled","no_instruction","account_transferred_to_new_psp","paying_bank_cancellation","cancelled_by_payer","payer_deceased","account_closed","scheme_status_invalid"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/generated/models/name_verification.go b/pkg/generated/models/name_verification.go new file mode 100644 index 00000000..b9bf1f57 --- /dev/null +++ b/pkg/generated/models/name_verification.go @@ -0,0 +1,349 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerification name verification +// swagger:model NameVerification +type NameVerification struct { + + // attributes + // Required: true + Attributes *NameVerificationAttributes `json:"attributes"` + + // created on + // Format: date-time + CreatedOn *strfmt.DateTime `json:"created_on,omitempty"` + + // id + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // modified on + // Format: date-time + ModifiedOn *strfmt.DateTime `json:"modified_on,omitempty"` + + // organisation id + // Required: true + // Format: uuid + OrganisationID *strfmt.UUID `json:"organisation_id"` + + // relationships + Relationships *NameVerificationRelationships `json:"relationships,omitempty"` + + // type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // version + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func NameVerificationWithDefaults(defaults client.Defaults) *NameVerification { + return &NameVerification{ + + Attributes: NameVerificationAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTimePtr("NameVerification", "created_on"), + + ID: defaults.GetStrfmtUUIDPtr("NameVerification", "id"), + + ModifiedOn: defaults.GetStrfmtDateTimePtr("NameVerification", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUIDPtr("NameVerification", "organisation_id"), + + Relationships: NameVerificationRelationshipsWithDefaults(defaults), + + Type: defaults.GetString("NameVerification", "type"), + + Version: defaults.GetInt64Ptr("NameVerification", "version"), + } +} + +func (m *NameVerification) WithAttributes(attributes NameVerificationAttributes) *NameVerification { + + m.Attributes = &attributes + + return m +} + +func (m *NameVerification) WithoutAttributes() *NameVerification { + m.Attributes = nil + return m +} + +func (m *NameVerification) WithCreatedOn(createdOn strfmt.DateTime) *NameVerification { + + m.CreatedOn = &createdOn + + return m +} + +func (m *NameVerification) WithoutCreatedOn() *NameVerification { + m.CreatedOn = nil + return m +} + +func (m *NameVerification) WithID(id strfmt.UUID) *NameVerification { + + m.ID = &id + + return m +} + +func (m *NameVerification) WithoutID() *NameVerification { + m.ID = nil + return m +} + +func (m *NameVerification) WithModifiedOn(modifiedOn strfmt.DateTime) *NameVerification { + + m.ModifiedOn = &modifiedOn + + return m +} + +func (m *NameVerification) WithoutModifiedOn() *NameVerification { + m.ModifiedOn = nil + return m +} + +func (m *NameVerification) WithOrganisationID(organisationID strfmt.UUID) *NameVerification { + + m.OrganisationID = &organisationID + + return m +} + +func (m *NameVerification) WithoutOrganisationID() *NameVerification { + m.OrganisationID = nil + return m +} + +func (m *NameVerification) WithRelationships(relationships NameVerificationRelationships) *NameVerification { + + m.Relationships = &relationships + + return m +} + +func (m *NameVerification) WithoutRelationships() *NameVerification { + m.Relationships = nil + return m +} + +func (m *NameVerification) WithType(typeVar string) *NameVerification { + + m.Type = typeVar + + return m +} + +func (m *NameVerification) WithVersion(version int64) *NameVerification { + + m.Version = &version + + return m +} + +func (m *NameVerification) WithoutVersion() *NameVerification { + m.Version = nil + return m +} + +// Validate validates this name verification +func (m *NameVerification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModifiedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRelationships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerification) validateAttributes(formats strfmt.Registry) error { + + if err := validate.Required("attributes", "body", m.Attributes); err != nil { + return err + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *NameVerification) validateCreatedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedOn) { // not required + return nil + } + + if err := validate.FormatOf("created_on", "body", "date-time", m.CreatedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerification) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerification) validateModifiedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.ModifiedOn) { // not required + return nil + } + + if err := validate.FormatOf("modified_on", "body", "date-time", m.ModifiedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerification) validateOrganisationID(formats strfmt.Registry) error { + + if err := validate.Required("organisation_id", "body", m.OrganisationID); err != nil { + return err + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerification) validateRelationships(formats strfmt.Registry) error { + + if swag.IsZero(m.Relationships) { // not required + return nil + } + + if m.Relationships != nil { + if err := m.Relationships.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships") + } + return err + } + } + + return nil +} + +func (m *NameVerification) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *NameVerification) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerification) UnmarshalBinary(b []byte) error { + var res NameVerification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerification) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_admission.go b/pkg/generated/models/name_verification_admission.go new file mode 100644 index 00000000..cb7548d0 --- /dev/null +++ b/pkg/generated/models/name_verification_admission.go @@ -0,0 +1,349 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerificationAdmission name verification admission +// swagger:model NameVerificationAdmission +type NameVerificationAdmission struct { + + // attributes + // Required: true + Attributes *NameVerificationAdmissionAttributes `json:"attributes"` + + // created on + // Format: date-time + CreatedOn *strfmt.DateTime `json:"created_on,omitempty"` + + // id + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // modified on + // Format: date-time + ModifiedOn *strfmt.DateTime `json:"modified_on,omitempty"` + + // organisation id + // Required: true + // Format: uuid + OrganisationID *strfmt.UUID `json:"organisation_id"` + + // relationships + Relationships *NameVerificationAdmissionRelationships `json:"relationships,omitempty"` + + // type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // version + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func NameVerificationAdmissionWithDefaults(defaults client.Defaults) *NameVerificationAdmission { + return &NameVerificationAdmission{ + + Attributes: NameVerificationAdmissionAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTimePtr("NameVerificationAdmission", "created_on"), + + ID: defaults.GetStrfmtUUIDPtr("NameVerificationAdmission", "id"), + + ModifiedOn: defaults.GetStrfmtDateTimePtr("NameVerificationAdmission", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUIDPtr("NameVerificationAdmission", "organisation_id"), + + Relationships: NameVerificationAdmissionRelationshipsWithDefaults(defaults), + + Type: defaults.GetString("NameVerificationAdmission", "type"), + + Version: defaults.GetInt64Ptr("NameVerificationAdmission", "version"), + } +} + +func (m *NameVerificationAdmission) WithAttributes(attributes NameVerificationAdmissionAttributes) *NameVerificationAdmission { + + m.Attributes = &attributes + + return m +} + +func (m *NameVerificationAdmission) WithoutAttributes() *NameVerificationAdmission { + m.Attributes = nil + return m +} + +func (m *NameVerificationAdmission) WithCreatedOn(createdOn strfmt.DateTime) *NameVerificationAdmission { + + m.CreatedOn = &createdOn + + return m +} + +func (m *NameVerificationAdmission) WithoutCreatedOn() *NameVerificationAdmission { + m.CreatedOn = nil + return m +} + +func (m *NameVerificationAdmission) WithID(id strfmt.UUID) *NameVerificationAdmission { + + m.ID = &id + + return m +} + +func (m *NameVerificationAdmission) WithoutID() *NameVerificationAdmission { + m.ID = nil + return m +} + +func (m *NameVerificationAdmission) WithModifiedOn(modifiedOn strfmt.DateTime) *NameVerificationAdmission { + + m.ModifiedOn = &modifiedOn + + return m +} + +func (m *NameVerificationAdmission) WithoutModifiedOn() *NameVerificationAdmission { + m.ModifiedOn = nil + return m +} + +func (m *NameVerificationAdmission) WithOrganisationID(organisationID strfmt.UUID) *NameVerificationAdmission { + + m.OrganisationID = &organisationID + + return m +} + +func (m *NameVerificationAdmission) WithoutOrganisationID() *NameVerificationAdmission { + m.OrganisationID = nil + return m +} + +func (m *NameVerificationAdmission) WithRelationships(relationships NameVerificationAdmissionRelationships) *NameVerificationAdmission { + + m.Relationships = &relationships + + return m +} + +func (m *NameVerificationAdmission) WithoutRelationships() *NameVerificationAdmission { + m.Relationships = nil + return m +} + +func (m *NameVerificationAdmission) WithType(typeVar string) *NameVerificationAdmission { + + m.Type = typeVar + + return m +} + +func (m *NameVerificationAdmission) WithVersion(version int64) *NameVerificationAdmission { + + m.Version = &version + + return m +} + +func (m *NameVerificationAdmission) WithoutVersion() *NameVerificationAdmission { + m.Version = nil + return m +} + +// Validate validates this name verification admission +func (m *NameVerificationAdmission) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModifiedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRelationships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationAdmission) validateAttributes(formats strfmt.Registry) error { + + if err := validate.Required("attributes", "body", m.Attributes); err != nil { + return err + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *NameVerificationAdmission) validateCreatedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedOn) { // not required + return nil + } + + if err := validate.FormatOf("created_on", "body", "date-time", m.CreatedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationAdmission) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationAdmission) validateModifiedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.ModifiedOn) { // not required + return nil + } + + if err := validate.FormatOf("modified_on", "body", "date-time", m.ModifiedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationAdmission) validateOrganisationID(formats strfmt.Registry) error { + + if err := validate.Required("organisation_id", "body", m.OrganisationID); err != nil { + return err + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationAdmission) validateRelationships(formats strfmt.Registry) error { + + if swag.IsZero(m.Relationships) { // not required + return nil + } + + if m.Relationships != nil { + if err := m.Relationships.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships") + } + return err + } + } + + return nil +} + +func (m *NameVerificationAdmission) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationAdmission) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationAdmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationAdmission) UnmarshalBinary(b []byte) error { + var res NameVerificationAdmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationAdmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_admission_answer.go b/pkg/generated/models/name_verification_admission_answer.go new file mode 100644 index 00000000..9d01029e --- /dev/null +++ b/pkg/generated/models/name_verification_admission_answer.go @@ -0,0 +1,72 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// NameVerificationAdmissionAnswer name verification admission answer +// swagger:model NameVerificationAdmissionAnswer +type NameVerificationAdmissionAnswer string + +const ( + + // NameVerificationAdmissionAnswerConfirmed captures enum value "confirmed" + NameVerificationAdmissionAnswerConfirmed NameVerificationAdmissionAnswer = "confirmed" + + // NameVerificationAdmissionAnswerRejected captures enum value "rejected" + NameVerificationAdmissionAnswerRejected NameVerificationAdmissionAnswer = "rejected" +) + +// for schema +var nameVerificationAdmissionAnswerEnum []interface{} + +func init() { + var res []NameVerificationAdmissionAnswer + if err := json.Unmarshal([]byte(`["confirmed","rejected"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nameVerificationAdmissionAnswerEnum = append(nameVerificationAdmissionAnswerEnum, v) + } +} + +func (m NameVerificationAdmissionAnswer) validateNameVerificationAdmissionAnswerEnum(path, location string, value NameVerificationAdmissionAnswer) error { + if err := validate.Enum(path, location, value, nameVerificationAdmissionAnswerEnum); err != nil { + return err + } + return nil +} + +// Validate validates this name verification admission answer +func (m NameVerificationAdmissionAnswer) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateNameVerificationAdmissionAnswerEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationAdmissionAnswer) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_admission_attributes.go b/pkg/generated/models/name_verification_admission_attributes.go new file mode 100644 index 00000000..d470b9cc --- /dev/null +++ b/pkg/generated/models/name_verification_admission_attributes.go @@ -0,0 +1,203 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerificationAdmissionAttributes name verification admission attributes +// swagger:model NameVerificationAdmissionAttributes +type NameVerificationAdmissionAttributes struct { + + // actual name + ActualName string `json:"actual_name,omitempty"` + + // answer + Answer NameVerificationAdmissionAnswer `json:"answer,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // reason code + ReasonCode NameVerificationAdmissionReasonCode `json:"reason_code,omitempty"` + + // status + // Required: true + Status *NameVerificationAdmissionStatus `json:"status"` + + // status reason + StatusReason string `json:"status_reason,omitempty"` +} + +func NameVerificationAdmissionAttributesWithDefaults(defaults client.Defaults) *NameVerificationAdmissionAttributes { + return &NameVerificationAdmissionAttributes{ + + ActualName: defaults.GetString("NameVerificationAdmissionAttributes", "actual_name"), + + // TODO Answer: NameVerificationAdmissionAnswer, + + Reason: defaults.GetString("NameVerificationAdmissionAttributes", "reason"), + + // TODO ReasonCode: NameVerificationAdmissionReasonCode, + + // TODO Status: NameVerificationAdmissionStatus, + + StatusReason: defaults.GetString("NameVerificationAdmissionAttributes", "status_reason"), + } +} + +func (m *NameVerificationAdmissionAttributes) WithActualName(actualName string) *NameVerificationAdmissionAttributes { + + m.ActualName = actualName + + return m +} + +func (m *NameVerificationAdmissionAttributes) WithAnswer(answer NameVerificationAdmissionAnswer) *NameVerificationAdmissionAttributes { + + m.Answer = answer + + return m +} + +func (m *NameVerificationAdmissionAttributes) WithReason(reason string) *NameVerificationAdmissionAttributes { + + m.Reason = reason + + return m +} + +func (m *NameVerificationAdmissionAttributes) WithReasonCode(reasonCode NameVerificationAdmissionReasonCode) *NameVerificationAdmissionAttributes { + + m.ReasonCode = reasonCode + + return m +} + +func (m *NameVerificationAdmissionAttributes) WithStatus(status NameVerificationAdmissionStatus) *NameVerificationAdmissionAttributes { + + m.Status = &status + + return m +} + +func (m *NameVerificationAdmissionAttributes) WithoutStatus() *NameVerificationAdmissionAttributes { + m.Status = nil + return m +} + +func (m *NameVerificationAdmissionAttributes) WithStatusReason(statusReason string) *NameVerificationAdmissionAttributes { + + m.StatusReason = statusReason + + return m +} + +// Validate validates this name verification admission attributes +func (m *NameVerificationAdmissionAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAnswer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReasonCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationAdmissionAttributes) validateAnswer(formats strfmt.Registry) error { + + if swag.IsZero(m.Answer) { // not required + return nil + } + + if err := m.Answer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("answer") + } + return err + } + + return nil +} + +func (m *NameVerificationAdmissionAttributes) validateReasonCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReasonCode) { // not required + return nil + } + + if err := m.ReasonCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason_code") + } + return err + } + + return nil +} + +func (m *NameVerificationAdmissionAttributes) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationAdmissionAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationAdmissionAttributes) UnmarshalBinary(b []byte) error { + var res NameVerificationAdmissionAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationAdmissionAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_admission_details_response.go b/pkg/generated/models/name_verification_admission_details_response.go new file mode 100644 index 00000000..9d899756 --- /dev/null +++ b/pkg/generated/models/name_verification_admission_details_response.go @@ -0,0 +1,101 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NameVerificationAdmissionDetailsResponse name verification admission details response +// swagger:model NameVerificationAdmissionDetailsResponse +type NameVerificationAdmissionDetailsResponse struct { + + // data + Data *NameVerificationAdmission `json:"data,omitempty"` +} + +func NameVerificationAdmissionDetailsResponseWithDefaults(defaults client.Defaults) *NameVerificationAdmissionDetailsResponse { + return &NameVerificationAdmissionDetailsResponse{ + + Data: NameVerificationAdmissionWithDefaults(defaults), + } +} + +func (m *NameVerificationAdmissionDetailsResponse) WithData(data NameVerificationAdmission) *NameVerificationAdmissionDetailsResponse { + + m.Data = &data + + return m +} + +func (m *NameVerificationAdmissionDetailsResponse) WithoutData() *NameVerificationAdmissionDetailsResponse { + m.Data = nil + return m +} + +// Validate validates this name verification admission details response +func (m *NameVerificationAdmissionDetailsResponse) 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 *NameVerificationAdmissionDetailsResponse) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationAdmissionDetailsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationAdmissionDetailsResponse) UnmarshalBinary(b []byte) error { + var res NameVerificationAdmissionDetailsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationAdmissionDetailsResponse) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_admission_reason_code.go b/pkg/generated/models/name_verification_admission_reason_code.go new file mode 100644 index 00000000..9b6896cb --- /dev/null +++ b/pkg/generated/models/name_verification_admission_reason_code.go @@ -0,0 +1,102 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// NameVerificationAdmissionReasonCode name verification admission reason code +// swagger:model NameVerificationAdmissionReasonCode +type NameVerificationAdmissionReasonCode string + +const ( + + // NameVerificationAdmissionReasonCodeANNM captures enum value "ANNM" + NameVerificationAdmissionReasonCodeANNM NameVerificationAdmissionReasonCode = "ANNM" + + // NameVerificationAdmissionReasonCodeMBAM captures enum value "MBAM" + NameVerificationAdmissionReasonCodeMBAM NameVerificationAdmissionReasonCode = "MBAM" + + // NameVerificationAdmissionReasonCodeBANM captures enum value "BANM" + NameVerificationAdmissionReasonCodeBANM NameVerificationAdmissionReasonCode = "BANM" + + // NameVerificationAdmissionReasonCodePANM captures enum value "PANM" + NameVerificationAdmissionReasonCodePANM NameVerificationAdmissionReasonCode = "PANM" + + // NameVerificationAdmissionReasonCodeBAMM captures enum value "BAMM" + NameVerificationAdmissionReasonCodeBAMM NameVerificationAdmissionReasonCode = "BAMM" + + // NameVerificationAdmissionReasonCodePAMM captures enum value "PAMM" + NameVerificationAdmissionReasonCodePAMM NameVerificationAdmissionReasonCode = "PAMM" + + // NameVerificationAdmissionReasonCodeAC01 captures enum value "AC01" + NameVerificationAdmissionReasonCodeAC01 NameVerificationAdmissionReasonCode = "AC01" + + // NameVerificationAdmissionReasonCodeIVCR captures enum value "IVCR" + NameVerificationAdmissionReasonCodeIVCR NameVerificationAdmissionReasonCode = "IVCR" + + // NameVerificationAdmissionReasonCodeCASS captures enum value "CASS" + NameVerificationAdmissionReasonCodeCASS NameVerificationAdmissionReasonCode = "CASS" + + // NameVerificationAdmissionReasonCodeSCNS captures enum value "SCNS" + NameVerificationAdmissionReasonCodeSCNS NameVerificationAdmissionReasonCode = "SCNS" + + // NameVerificationAdmissionReasonCodeACNS captures enum value "ACNS" + NameVerificationAdmissionReasonCodeACNS NameVerificationAdmissionReasonCode = "ACNS" + + // NameVerificationAdmissionReasonCodeOPTO captures enum value "OPTO" + NameVerificationAdmissionReasonCodeOPTO NameVerificationAdmissionReasonCode = "OPTO" +) + +// for schema +var nameVerificationAdmissionReasonCodeEnum []interface{} + +func init() { + var res []NameVerificationAdmissionReasonCode + if err := json.Unmarshal([]byte(`["ANNM","MBAM","BANM","PANM","BAMM","PAMM","AC01","IVCR","CASS","SCNS","ACNS","OPTO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nameVerificationAdmissionReasonCodeEnum = append(nameVerificationAdmissionReasonCodeEnum, v) + } +} + +func (m NameVerificationAdmissionReasonCode) validateNameVerificationAdmissionReasonCodeEnum(path, location string, value NameVerificationAdmissionReasonCode) error { + if err := validate.Enum(path, location, value, nameVerificationAdmissionReasonCodeEnum); err != nil { + return err + } + return nil +} + +// Validate validates this name verification admission reason code +func (m NameVerificationAdmissionReasonCode) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateNameVerificationAdmissionReasonCodeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationAdmissionReasonCode) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_admission_relationships.go b/pkg/generated/models/name_verification_admission_relationships.go new file mode 100644 index 00000000..f31778e3 --- /dev/null +++ b/pkg/generated/models/name_verification_admission_relationships.go @@ -0,0 +1,188 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NameVerificationAdmissionRelationships name verification admission relationships +// swagger:model NameVerificationAdmissionRelationships +type NameVerificationAdmissionRelationships struct { + + // name verification + NameVerification *NameVerificationAdmissionRelationshipsNameVerification `json:"name_verification,omitempty"` +} + +func NameVerificationAdmissionRelationshipsWithDefaults(defaults client.Defaults) *NameVerificationAdmissionRelationships { + return &NameVerificationAdmissionRelationships{ + + NameVerification: NameVerificationAdmissionRelationshipsNameVerificationWithDefaults(defaults), + } +} + +func (m *NameVerificationAdmissionRelationships) WithNameVerification(nameVerification NameVerificationAdmissionRelationshipsNameVerification) *NameVerificationAdmissionRelationships { + + m.NameVerification = &nameVerification + + return m +} + +func (m *NameVerificationAdmissionRelationships) WithoutNameVerification() *NameVerificationAdmissionRelationships { + m.NameVerification = nil + return m +} + +// Validate validates this name verification admission relationships +func (m *NameVerificationAdmissionRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNameVerification(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationAdmissionRelationships) validateNameVerification(formats strfmt.Registry) error { + + if swag.IsZero(m.NameVerification) { // not required + return nil + } + + if m.NameVerification != nil { + if err := m.NameVerification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationAdmissionRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationAdmissionRelationships) UnmarshalBinary(b []byte) error { + var res NameVerificationAdmissionRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationAdmissionRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NameVerificationAdmissionRelationshipsNameVerification name verification admission relationships name verification +// swagger:model NameVerificationAdmissionRelationshipsNameVerification +type NameVerificationAdmissionRelationshipsNameVerification struct { + + // data + Data []*NameVerification `json:"data"` +} + +func NameVerificationAdmissionRelationshipsNameVerificationWithDefaults(defaults client.Defaults) *NameVerificationAdmissionRelationshipsNameVerification { + return &NameVerificationAdmissionRelationshipsNameVerification{ + + Data: make([]*NameVerification, 0), + } +} + +func (m *NameVerificationAdmissionRelationshipsNameVerification) WithData(data []*NameVerification) *NameVerificationAdmissionRelationshipsNameVerification { + + m.Data = data + + return m +} + +// Validate validates this name verification admission relationships name verification +func (m *NameVerificationAdmissionRelationshipsNameVerification) 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 *NameVerificationAdmissionRelationshipsNameVerification) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationAdmissionRelationshipsNameVerification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationAdmissionRelationshipsNameVerification) UnmarshalBinary(b []byte) error { + var res NameVerificationAdmissionRelationshipsNameVerification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationAdmissionRelationshipsNameVerification) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_admission_status.go b/pkg/generated/models/name_verification_admission_status.go new file mode 100644 index 00000000..79efaad9 --- /dev/null +++ b/pkg/generated/models/name_verification_admission_status.go @@ -0,0 +1,72 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// NameVerificationAdmissionStatus name verification admission status +// swagger:model NameVerificationAdmissionStatus +type NameVerificationAdmissionStatus string + +const ( + + // NameVerificationAdmissionStatusConfirmed captures enum value "confirmed" + NameVerificationAdmissionStatusConfirmed NameVerificationAdmissionStatus = "confirmed" + + // NameVerificationAdmissionStatusFailed captures enum value "failed" + NameVerificationAdmissionStatusFailed NameVerificationAdmissionStatus = "failed" +) + +// for schema +var nameVerificationAdmissionStatusEnum []interface{} + +func init() { + var res []NameVerificationAdmissionStatus + if err := json.Unmarshal([]byte(`["confirmed","failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nameVerificationAdmissionStatusEnum = append(nameVerificationAdmissionStatusEnum, v) + } +} + +func (m NameVerificationAdmissionStatus) validateNameVerificationAdmissionStatusEnum(path, location string, value NameVerificationAdmissionStatus) error { + if err := validate.Enum(path, location, value, nameVerificationAdmissionStatusEnum); err != nil { + return err + } + return nil +} + +// Validate validates this name verification admission status +func (m NameVerificationAdmissionStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateNameVerificationAdmissionStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationAdmissionStatus) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_attributes.go b/pkg/generated/models/name_verification_attributes.go new file mode 100644 index 00000000..bc306ec8 --- /dev/null +++ b/pkg/generated/models/name_verification_attributes.go @@ -0,0 +1,327 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerificationAttributes name verification attributes +// swagger:model NameVerificationAttributes +type NameVerificationAttributes struct { + + // account classification + // Required: true + AccountClassification *AccountClassification `json:"account_classification"` + + // account number + // Required: true + // Pattern: ^[A-Z0-9]{6,34}$ + AccountNumber *string `json:"account_number"` + + // account number code + // Required: true + AccountNumberCode *AccountNumberCode `json:"account_number_code"` + + // bank id + // Required: true + BankID *string `json:"bank_id"` + + // bank id code + // Required: true + BankIDCode *BankIDCode `json:"bank_id_code"` + + // Account holder names (for example title, first name, last name). Used for Confirmation of Payee matching. + // Required: true + // Max Items: 4 + Name []string `json:"name"` + + // secondary identification + // Required: true + SecondaryIdentification *string `json:"secondary_identification"` +} + +func NameVerificationAttributesWithDefaults(defaults client.Defaults) *NameVerificationAttributes { + return &NameVerificationAttributes{ + + // TODO AccountClassification: AccountClassification, + + AccountNumber: defaults.GetStringPtr("NameVerificationAttributes", "account_number"), + + // TODO AccountNumberCode: AccountNumberCode, + + BankID: defaults.GetStringPtr("NameVerificationAttributes", "bank_id"), + + // TODO BankIDCode: BankIDCode, + + Name: make([]string, 0), + + SecondaryIdentification: defaults.GetStringPtr("NameVerificationAttributes", "secondary_identification"), + } +} + +func (m *NameVerificationAttributes) WithAccountClassification(accountClassification AccountClassification) *NameVerificationAttributes { + + m.AccountClassification = &accountClassification + + return m +} + +func (m *NameVerificationAttributes) WithoutAccountClassification() *NameVerificationAttributes { + m.AccountClassification = nil + return m +} + +func (m *NameVerificationAttributes) WithAccountNumber(accountNumber string) *NameVerificationAttributes { + + m.AccountNumber = &accountNumber + + return m +} + +func (m *NameVerificationAttributes) WithoutAccountNumber() *NameVerificationAttributes { + m.AccountNumber = nil + return m +} + +func (m *NameVerificationAttributes) WithAccountNumberCode(accountNumberCode AccountNumberCode) *NameVerificationAttributes { + + m.AccountNumberCode = &accountNumberCode + + return m +} + +func (m *NameVerificationAttributes) WithoutAccountNumberCode() *NameVerificationAttributes { + m.AccountNumberCode = nil + return m +} + +func (m *NameVerificationAttributes) WithBankID(bankID string) *NameVerificationAttributes { + + m.BankID = &bankID + + return m +} + +func (m *NameVerificationAttributes) WithoutBankID() *NameVerificationAttributes { + m.BankID = nil + return m +} + +func (m *NameVerificationAttributes) WithBankIDCode(bankIDCode BankIDCode) *NameVerificationAttributes { + + m.BankIDCode = &bankIDCode + + return m +} + +func (m *NameVerificationAttributes) WithoutBankIDCode() *NameVerificationAttributes { + m.BankIDCode = nil + return m +} + +func (m *NameVerificationAttributes) WithName(name []string) *NameVerificationAttributes { + + m.Name = name + + return m +} + +func (m *NameVerificationAttributes) WithSecondaryIdentification(secondaryIdentification string) *NameVerificationAttributes { + + m.SecondaryIdentification = &secondaryIdentification + + return m +} + +func (m *NameVerificationAttributes) WithoutSecondaryIdentification() *NameVerificationAttributes { + m.SecondaryIdentification = nil + return m +} + +// Validate validates this name verification attributes +func (m *NameVerificationAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccountClassification(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAccountNumber(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAccountNumberCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBankID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBankIDCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryIdentification(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationAttributes) validateAccountClassification(formats strfmt.Registry) error { + + if err := validate.Required("account_classification", "body", m.AccountClassification); err != nil { + return err + } + + if m.AccountClassification != nil { + if err := m.AccountClassification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("account_classification") + } + return err + } + } + + return nil +} + +func (m *NameVerificationAttributes) validateAccountNumber(formats strfmt.Registry) error { + + if err := validate.Required("account_number", "body", m.AccountNumber); err != nil { + return err + } + + if err := validate.Pattern("account_number", "body", string(*m.AccountNumber), `^[A-Z0-9]{6,34}$`); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationAttributes) validateAccountNumberCode(formats strfmt.Registry) error { + + if err := validate.Required("account_number_code", "body", m.AccountNumberCode); err != nil { + return err + } + + if m.AccountNumberCode != nil { + if err := m.AccountNumberCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("account_number_code") + } + return err + } + } + + return nil +} + +func (m *NameVerificationAttributes) validateBankID(formats strfmt.Registry) error { + + if err := validate.Required("bank_id", "body", m.BankID); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationAttributes) validateBankIDCode(formats strfmt.Registry) error { + + if err := validate.Required("bank_id_code", "body", m.BankIDCode); err != nil { + return err + } + + if m.BankIDCode != nil { + if err := m.BankIDCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bank_id_code") + } + return err + } + } + + return nil +} + +func (m *NameVerificationAttributes) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + iNameSize := int64(len(m.Name)) + + if err := validate.MaxItems("name", "body", iNameSize, 4); err != nil { + return err + } + + for i := 0; i < len(m.Name); i++ { + + if err := validate.MinLength("name"+"."+strconv.Itoa(i), "body", string(m.Name[i]), 1); err != nil { + return err + } + + if err := validate.MaxLength("name"+"."+strconv.Itoa(i), "body", string(m.Name[i]), 140); err != nil { + return err + } + + } + + return nil +} + +func (m *NameVerificationAttributes) validateSecondaryIdentification(formats strfmt.Registry) error { + + if err := validate.Required("secondary_identification", "body", m.SecondaryIdentification); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationAttributes) UnmarshalBinary(b []byte) error { + var res NameVerificationAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_creation.go b/pkg/generated/models/name_verification_creation.go new file mode 100644 index 00000000..28e2bb4f --- /dev/null +++ b/pkg/generated/models/name_verification_creation.go @@ -0,0 +1,103 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerificationCreation name verification creation +// swagger:model NameVerificationCreation +type NameVerificationCreation struct { + + // data + // Required: true + Data *NameVerification `json:"data"` +} + +func NameVerificationCreationWithDefaults(defaults client.Defaults) *NameVerificationCreation { + return &NameVerificationCreation{ + + Data: NameVerificationWithDefaults(defaults), + } +} + +func (m *NameVerificationCreation) WithData(data NameVerification) *NameVerificationCreation { + + m.Data = &data + + return m +} + +func (m *NameVerificationCreation) WithoutData() *NameVerificationCreation { + m.Data = nil + return m +} + +// Validate validates this name verification creation +func (m *NameVerificationCreation) 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 *NameVerificationCreation) 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 { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationCreation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationCreation) UnmarshalBinary(b []byte) error { + var res NameVerificationCreation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationCreation) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_creation_response.go b/pkg/generated/models/name_verification_creation_response.go new file mode 100644 index 00000000..84475bec --- /dev/null +++ b/pkg/generated/models/name_verification_creation_response.go @@ -0,0 +1,101 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NameVerificationCreationResponse name verification creation response +// swagger:model NameVerificationCreationResponse +type NameVerificationCreationResponse struct { + + // data + Data *NameVerification `json:"data,omitempty"` +} + +func NameVerificationCreationResponseWithDefaults(defaults client.Defaults) *NameVerificationCreationResponse { + return &NameVerificationCreationResponse{ + + Data: NameVerificationWithDefaults(defaults), + } +} + +func (m *NameVerificationCreationResponse) WithData(data NameVerification) *NameVerificationCreationResponse { + + m.Data = &data + + return m +} + +func (m *NameVerificationCreationResponse) WithoutData() *NameVerificationCreationResponse { + m.Data = nil + return m +} + +// Validate validates this name verification creation response +func (m *NameVerificationCreationResponse) 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 *NameVerificationCreationResponse) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationCreationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationCreationResponse) UnmarshalBinary(b []byte) error { + var res NameVerificationCreationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationCreationResponse) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_details_list_response.go b/pkg/generated/models/name_verification_details_list_response.go new file mode 100644 index 00000000..ea65d2f7 --- /dev/null +++ b/pkg/generated/models/name_verification_details_list_response.go @@ -0,0 +1,143 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NameVerificationDetailsListResponse name verification details list response +// swagger:model NameVerificationDetailsListResponse +type NameVerificationDetailsListResponse struct { + + // data + Data []*NameVerification `json:"data"` + + // links + Links *Links `json:"links,omitempty"` +} + +func NameVerificationDetailsListResponseWithDefaults(defaults client.Defaults) *NameVerificationDetailsListResponse { + return &NameVerificationDetailsListResponse{ + + Data: make([]*NameVerification, 0), + + Links: LinksWithDefaults(defaults), + } +} + +func (m *NameVerificationDetailsListResponse) WithData(data []*NameVerification) *NameVerificationDetailsListResponse { + + m.Data = data + + return m +} + +func (m *NameVerificationDetailsListResponse) WithLinks(links Links) *NameVerificationDetailsListResponse { + + m.Links = &links + + return m +} + +func (m *NameVerificationDetailsListResponse) WithoutLinks() *NameVerificationDetailsListResponse { + m.Links = nil + return m +} + +// Validate validates this name verification details list response +func (m *NameVerificationDetailsListResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationDetailsListResponse) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *NameVerificationDetailsListResponse) validateLinks(formats strfmt.Registry) error { + + if swag.IsZero(m.Links) { // not required + return nil + } + + if m.Links != nil { + if err := m.Links.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("links") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationDetailsListResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationDetailsListResponse) UnmarshalBinary(b []byte) error { + var res NameVerificationDetailsListResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationDetailsListResponse) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_details_response.go b/pkg/generated/models/name_verification_details_response.go new file mode 100644 index 00000000..e8aec263 --- /dev/null +++ b/pkg/generated/models/name_verification_details_response.go @@ -0,0 +1,101 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NameVerificationDetailsResponse name verification details response +// swagger:model NameVerificationDetailsResponse +type NameVerificationDetailsResponse struct { + + // data + Data *NameVerification `json:"data,omitempty"` +} + +func NameVerificationDetailsResponseWithDefaults(defaults client.Defaults) *NameVerificationDetailsResponse { + return &NameVerificationDetailsResponse{ + + Data: NameVerificationWithDefaults(defaults), + } +} + +func (m *NameVerificationDetailsResponse) WithData(data NameVerification) *NameVerificationDetailsResponse { + + m.Data = &data + + return m +} + +func (m *NameVerificationDetailsResponse) WithoutData() *NameVerificationDetailsResponse { + m.Data = nil + return m +} + +// Validate validates this name verification details response +func (m *NameVerificationDetailsResponse) 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 *NameVerificationDetailsResponse) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationDetailsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationDetailsResponse) UnmarshalBinary(b []byte) error { + var res NameVerificationDetailsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationDetailsResponse) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_relationships.go b/pkg/generated/models/name_verification_relationships.go new file mode 100644 index 00000000..e0f8a33c --- /dev/null +++ b/pkg/generated/models/name_verification_relationships.go @@ -0,0 +1,338 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerificationRelationships name verification relationships +// swagger:model NameVerificationRelationships +type NameVerificationRelationships struct { + + // name verification admission + NameVerificationAdmission *NameVerificationRelationshipsNameVerificationAdmission `json:"name_verification_admission,omitempty"` + + // name verification submission + NameVerificationSubmission *NameVerificationRelationshipsNameVerificationSubmission `json:"name_verification_submission,omitempty"` +} + +func NameVerificationRelationshipsWithDefaults(defaults client.Defaults) *NameVerificationRelationships { + return &NameVerificationRelationships{ + + NameVerificationAdmission: NameVerificationRelationshipsNameVerificationAdmissionWithDefaults(defaults), + + NameVerificationSubmission: NameVerificationRelationshipsNameVerificationSubmissionWithDefaults(defaults), + } +} + +func (m *NameVerificationRelationships) WithNameVerificationAdmission(nameVerificationAdmission NameVerificationRelationshipsNameVerificationAdmission) *NameVerificationRelationships { + + m.NameVerificationAdmission = &nameVerificationAdmission + + return m +} + +func (m *NameVerificationRelationships) WithoutNameVerificationAdmission() *NameVerificationRelationships { + m.NameVerificationAdmission = nil + return m +} + +func (m *NameVerificationRelationships) WithNameVerificationSubmission(nameVerificationSubmission NameVerificationRelationshipsNameVerificationSubmission) *NameVerificationRelationships { + + m.NameVerificationSubmission = &nameVerificationSubmission + + return m +} + +func (m *NameVerificationRelationships) WithoutNameVerificationSubmission() *NameVerificationRelationships { + m.NameVerificationSubmission = nil + return m +} + +// Validate validates this name verification relationships +func (m *NameVerificationRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNameVerificationAdmission(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNameVerificationSubmission(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationRelationships) validateNameVerificationAdmission(formats strfmt.Registry) error { + + if swag.IsZero(m.NameVerificationAdmission) { // not required + return nil + } + + if m.NameVerificationAdmission != nil { + if err := m.NameVerificationAdmission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification_admission") + } + return err + } + } + + return nil +} + +func (m *NameVerificationRelationships) validateNameVerificationSubmission(formats strfmt.Registry) error { + + if swag.IsZero(m.NameVerificationSubmission) { // not required + return nil + } + + if m.NameVerificationSubmission != nil { + if err := m.NameVerificationSubmission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification_submission") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationRelationships) UnmarshalBinary(b []byte) error { + var res NameVerificationRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NameVerificationRelationshipsNameVerificationAdmission name verification relationships name verification admission +// swagger:model NameVerificationRelationshipsNameVerificationAdmission +type NameVerificationRelationshipsNameVerificationAdmission struct { + + // data + // Max Items: 1 + // Min Items: 0 + Data []*NameVerificationAdmission `json:"data"` +} + +func NameVerificationRelationshipsNameVerificationAdmissionWithDefaults(defaults client.Defaults) *NameVerificationRelationshipsNameVerificationAdmission { + return &NameVerificationRelationshipsNameVerificationAdmission{ + + Data: make([]*NameVerificationAdmission, 0), + } +} + +func (m *NameVerificationRelationshipsNameVerificationAdmission) WithData(data []*NameVerificationAdmission) *NameVerificationRelationshipsNameVerificationAdmission { + + m.Data = data + + return m +} + +// Validate validates this name verification relationships name verification admission +func (m *NameVerificationRelationshipsNameVerificationAdmission) 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 *NameVerificationRelationshipsNameVerificationAdmission) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + iDataSize := int64(len(m.Data)) + + if err := validate.MinItems("name_verification_admission"+"."+"data", "body", iDataSize, 0); err != nil { + return err + } + + if err := validate.MaxItems("name_verification_admission"+"."+"data", "body", iDataSize, 1); err != nil { + return err + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification_admission" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationRelationshipsNameVerificationAdmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationRelationshipsNameVerificationAdmission) UnmarshalBinary(b []byte) error { + var res NameVerificationRelationshipsNameVerificationAdmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationRelationshipsNameVerificationAdmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NameVerificationRelationshipsNameVerificationSubmission name verification relationships name verification submission +// swagger:model NameVerificationRelationshipsNameVerificationSubmission +type NameVerificationRelationshipsNameVerificationSubmission struct { + + // data + // Max Items: 1 + // Min Items: 0 + Data []*NameVerificationSubmission `json:"data"` +} + +func NameVerificationRelationshipsNameVerificationSubmissionWithDefaults(defaults client.Defaults) *NameVerificationRelationshipsNameVerificationSubmission { + return &NameVerificationRelationshipsNameVerificationSubmission{ + + Data: make([]*NameVerificationSubmission, 0), + } +} + +func (m *NameVerificationRelationshipsNameVerificationSubmission) WithData(data []*NameVerificationSubmission) *NameVerificationRelationshipsNameVerificationSubmission { + + m.Data = data + + return m +} + +// Validate validates this name verification relationships name verification submission +func (m *NameVerificationRelationshipsNameVerificationSubmission) 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 *NameVerificationRelationshipsNameVerificationSubmission) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + iDataSize := int64(len(m.Data)) + + if err := validate.MinItems("name_verification_submission"+"."+"data", "body", iDataSize, 0); err != nil { + return err + } + + if err := validate.MaxItems("name_verification_submission"+"."+"data", "body", iDataSize, 1); err != nil { + return err + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification_submission" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationRelationshipsNameVerificationSubmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationRelationshipsNameVerificationSubmission) UnmarshalBinary(b []byte) error { + var res NameVerificationRelationshipsNameVerificationSubmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationRelationshipsNameVerificationSubmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_submission.go b/pkg/generated/models/name_verification_submission.go new file mode 100644 index 00000000..181f4f49 --- /dev/null +++ b/pkg/generated/models/name_verification_submission.go @@ -0,0 +1,348 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerificationSubmission name verification submission +// swagger:model NameVerificationSubmission +type NameVerificationSubmission struct { + + // attributes + Attributes *NameVerificationSubmissionAttributes `json:"attributes,omitempty"` + + // created on + // Format: date-time + CreatedOn *strfmt.DateTime `json:"created_on,omitempty"` + + // id + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // modified on + // Format: date-time + ModifiedOn *strfmt.DateTime `json:"modified_on,omitempty"` + + // organisation id + // Required: true + // Format: uuid + OrganisationID *strfmt.UUID `json:"organisation_id"` + + // relationships + Relationships *NameVerificationSubmissionRelationships `json:"relationships,omitempty"` + + // type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // version + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func NameVerificationSubmissionWithDefaults(defaults client.Defaults) *NameVerificationSubmission { + return &NameVerificationSubmission{ + + Attributes: NameVerificationSubmissionAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTimePtr("NameVerificationSubmission", "created_on"), + + ID: defaults.GetStrfmtUUIDPtr("NameVerificationSubmission", "id"), + + ModifiedOn: defaults.GetStrfmtDateTimePtr("NameVerificationSubmission", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUIDPtr("NameVerificationSubmission", "organisation_id"), + + Relationships: NameVerificationSubmissionRelationshipsWithDefaults(defaults), + + Type: defaults.GetString("NameVerificationSubmission", "type"), + + Version: defaults.GetInt64Ptr("NameVerificationSubmission", "version"), + } +} + +func (m *NameVerificationSubmission) WithAttributes(attributes NameVerificationSubmissionAttributes) *NameVerificationSubmission { + + m.Attributes = &attributes + + return m +} + +func (m *NameVerificationSubmission) WithoutAttributes() *NameVerificationSubmission { + m.Attributes = nil + return m +} + +func (m *NameVerificationSubmission) WithCreatedOn(createdOn strfmt.DateTime) *NameVerificationSubmission { + + m.CreatedOn = &createdOn + + return m +} + +func (m *NameVerificationSubmission) WithoutCreatedOn() *NameVerificationSubmission { + m.CreatedOn = nil + return m +} + +func (m *NameVerificationSubmission) WithID(id strfmt.UUID) *NameVerificationSubmission { + + m.ID = &id + + return m +} + +func (m *NameVerificationSubmission) WithoutID() *NameVerificationSubmission { + m.ID = nil + return m +} + +func (m *NameVerificationSubmission) WithModifiedOn(modifiedOn strfmt.DateTime) *NameVerificationSubmission { + + m.ModifiedOn = &modifiedOn + + return m +} + +func (m *NameVerificationSubmission) WithoutModifiedOn() *NameVerificationSubmission { + m.ModifiedOn = nil + return m +} + +func (m *NameVerificationSubmission) WithOrganisationID(organisationID strfmt.UUID) *NameVerificationSubmission { + + m.OrganisationID = &organisationID + + return m +} + +func (m *NameVerificationSubmission) WithoutOrganisationID() *NameVerificationSubmission { + m.OrganisationID = nil + return m +} + +func (m *NameVerificationSubmission) WithRelationships(relationships NameVerificationSubmissionRelationships) *NameVerificationSubmission { + + m.Relationships = &relationships + + return m +} + +func (m *NameVerificationSubmission) WithoutRelationships() *NameVerificationSubmission { + m.Relationships = nil + return m +} + +func (m *NameVerificationSubmission) WithType(typeVar string) *NameVerificationSubmission { + + m.Type = typeVar + + return m +} + +func (m *NameVerificationSubmission) WithVersion(version int64) *NameVerificationSubmission { + + m.Version = &version + + return m +} + +func (m *NameVerificationSubmission) WithoutVersion() *NameVerificationSubmission { + m.Version = nil + return m +} + +// Validate validates this name verification submission +func (m *NameVerificationSubmission) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModifiedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRelationships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationSubmission) validateAttributes(formats strfmt.Registry) error { + + if swag.IsZero(m.Attributes) { // not required + return nil + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *NameVerificationSubmission) validateCreatedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedOn) { // not required + return nil + } + + if err := validate.FormatOf("created_on", "body", "date-time", m.CreatedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationSubmission) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationSubmission) validateModifiedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.ModifiedOn) { // not required + return nil + } + + if err := validate.FormatOf("modified_on", "body", "date-time", m.ModifiedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationSubmission) validateOrganisationID(formats strfmt.Registry) error { + + if err := validate.Required("organisation_id", "body", m.OrganisationID); err != nil { + return err + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationSubmission) validateRelationships(formats strfmt.Registry) error { + + if swag.IsZero(m.Relationships) { // not required + return nil + } + + if m.Relationships != nil { + if err := m.Relationships.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships") + } + return err + } + } + + return nil +} + +func (m *NameVerificationSubmission) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *NameVerificationSubmission) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationSubmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationSubmission) UnmarshalBinary(b []byte) error { + var res NameVerificationSubmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationSubmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_submission_answer.go b/pkg/generated/models/name_verification_submission_answer.go new file mode 100644 index 00000000..03c2e037 --- /dev/null +++ b/pkg/generated/models/name_verification_submission_answer.go @@ -0,0 +1,72 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// NameVerificationSubmissionAnswer name verification submission answer +// swagger:model NameVerificationSubmissionAnswer +type NameVerificationSubmissionAnswer string + +const ( + + // NameVerificationSubmissionAnswerConfirmed captures enum value "confirmed" + NameVerificationSubmissionAnswerConfirmed NameVerificationSubmissionAnswer = "confirmed" + + // NameVerificationSubmissionAnswerRejected captures enum value "rejected" + NameVerificationSubmissionAnswerRejected NameVerificationSubmissionAnswer = "rejected" +) + +// for schema +var nameVerificationSubmissionAnswerEnum []interface{} + +func init() { + var res []NameVerificationSubmissionAnswer + if err := json.Unmarshal([]byte(`["confirmed","rejected"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nameVerificationSubmissionAnswerEnum = append(nameVerificationSubmissionAnswerEnum, v) + } +} + +func (m NameVerificationSubmissionAnswer) validateNameVerificationSubmissionAnswerEnum(path, location string, value NameVerificationSubmissionAnswer) error { + if err := validate.Enum(path, location, value, nameVerificationSubmissionAnswerEnum); err != nil { + return err + } + return nil +} + +// Validate validates this name verification submission answer +func (m NameVerificationSubmissionAnswer) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateNameVerificationSubmissionAnswerEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationSubmissionAnswer) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_submission_attributes.go b/pkg/generated/models/name_verification_submission_attributes.go new file mode 100644 index 00000000..92e1bddc --- /dev/null +++ b/pkg/generated/models/name_verification_submission_attributes.go @@ -0,0 +1,203 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NameVerificationSubmissionAttributes name verification submission attributes +// swagger:model NameVerificationSubmissionAttributes +type NameVerificationSubmissionAttributes struct { + + // actual name + ActualName string `json:"actual_name,omitempty"` + + // answer + Answer NameVerificationSubmissionAnswer `json:"answer,omitempty"` + + // reason + Reason string `json:"reason,omitempty"` + + // reason code + ReasonCode NameVerificationSubmissionReasonCode `json:"reason_code,omitempty"` + + // status + // Required: true + Status *NameVerificationSubmissionStatus `json:"status"` + + // status reason + StatusReason string `json:"status_reason,omitempty"` +} + +func NameVerificationSubmissionAttributesWithDefaults(defaults client.Defaults) *NameVerificationSubmissionAttributes { + return &NameVerificationSubmissionAttributes{ + + ActualName: defaults.GetString("NameVerificationSubmissionAttributes", "actual_name"), + + // TODO Answer: NameVerificationSubmissionAnswer, + + Reason: defaults.GetString("NameVerificationSubmissionAttributes", "reason"), + + // TODO ReasonCode: NameVerificationSubmissionReasonCode, + + // TODO Status: NameVerificationSubmissionStatus, + + StatusReason: defaults.GetString("NameVerificationSubmissionAttributes", "status_reason"), + } +} + +func (m *NameVerificationSubmissionAttributes) WithActualName(actualName string) *NameVerificationSubmissionAttributes { + + m.ActualName = actualName + + return m +} + +func (m *NameVerificationSubmissionAttributes) WithAnswer(answer NameVerificationSubmissionAnswer) *NameVerificationSubmissionAttributes { + + m.Answer = answer + + return m +} + +func (m *NameVerificationSubmissionAttributes) WithReason(reason string) *NameVerificationSubmissionAttributes { + + m.Reason = reason + + return m +} + +func (m *NameVerificationSubmissionAttributes) WithReasonCode(reasonCode NameVerificationSubmissionReasonCode) *NameVerificationSubmissionAttributes { + + m.ReasonCode = reasonCode + + return m +} + +func (m *NameVerificationSubmissionAttributes) WithStatus(status NameVerificationSubmissionStatus) *NameVerificationSubmissionAttributes { + + m.Status = &status + + return m +} + +func (m *NameVerificationSubmissionAttributes) WithoutStatus() *NameVerificationSubmissionAttributes { + m.Status = nil + return m +} + +func (m *NameVerificationSubmissionAttributes) WithStatusReason(statusReason string) *NameVerificationSubmissionAttributes { + + m.StatusReason = statusReason + + return m +} + +// Validate validates this name verification submission attributes +func (m *NameVerificationSubmissionAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAnswer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReasonCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationSubmissionAttributes) validateAnswer(formats strfmt.Registry) error { + + if swag.IsZero(m.Answer) { // not required + return nil + } + + if err := m.Answer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("answer") + } + return err + } + + return nil +} + +func (m *NameVerificationSubmissionAttributes) validateReasonCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReasonCode) { // not required + return nil + } + + if err := m.ReasonCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason_code") + } + return err + } + + return nil +} + +func (m *NameVerificationSubmissionAttributes) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationSubmissionAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationSubmissionAttributes) UnmarshalBinary(b []byte) error { + var res NameVerificationSubmissionAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationSubmissionAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_submission_details_response.go b/pkg/generated/models/name_verification_submission_details_response.go new file mode 100644 index 00000000..300639e0 --- /dev/null +++ b/pkg/generated/models/name_verification_submission_details_response.go @@ -0,0 +1,101 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NameVerificationSubmissionDetailsResponse name verification submission details response +// swagger:model NameVerificationSubmissionDetailsResponse +type NameVerificationSubmissionDetailsResponse struct { + + // data + Data *NameVerificationSubmission `json:"data,omitempty"` +} + +func NameVerificationSubmissionDetailsResponseWithDefaults(defaults client.Defaults) *NameVerificationSubmissionDetailsResponse { + return &NameVerificationSubmissionDetailsResponse{ + + Data: NameVerificationSubmissionWithDefaults(defaults), + } +} + +func (m *NameVerificationSubmissionDetailsResponse) WithData(data NameVerificationSubmission) *NameVerificationSubmissionDetailsResponse { + + m.Data = &data + + return m +} + +func (m *NameVerificationSubmissionDetailsResponse) WithoutData() *NameVerificationSubmissionDetailsResponse { + m.Data = nil + return m +} + +// Validate validates this name verification submission details response +func (m *NameVerificationSubmissionDetailsResponse) 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 *NameVerificationSubmissionDetailsResponse) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if m.Data != nil { + if err := m.Data.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationSubmissionDetailsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationSubmissionDetailsResponse) UnmarshalBinary(b []byte) error { + var res NameVerificationSubmissionDetailsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationSubmissionDetailsResponse) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_submission_reason_code.go b/pkg/generated/models/name_verification_submission_reason_code.go new file mode 100644 index 00000000..c7060beb --- /dev/null +++ b/pkg/generated/models/name_verification_submission_reason_code.go @@ -0,0 +1,102 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// NameVerificationSubmissionReasonCode name verification submission reason code +// swagger:model NameVerificationSubmissionReasonCode +type NameVerificationSubmissionReasonCode string + +const ( + + // NameVerificationSubmissionReasonCodeANNM captures enum value "ANNM" + NameVerificationSubmissionReasonCodeANNM NameVerificationSubmissionReasonCode = "ANNM" + + // NameVerificationSubmissionReasonCodeMBAM captures enum value "MBAM" + NameVerificationSubmissionReasonCodeMBAM NameVerificationSubmissionReasonCode = "MBAM" + + // NameVerificationSubmissionReasonCodeBANM captures enum value "BANM" + NameVerificationSubmissionReasonCodeBANM NameVerificationSubmissionReasonCode = "BANM" + + // NameVerificationSubmissionReasonCodePANM captures enum value "PANM" + NameVerificationSubmissionReasonCodePANM NameVerificationSubmissionReasonCode = "PANM" + + // NameVerificationSubmissionReasonCodeBAMM captures enum value "BAMM" + NameVerificationSubmissionReasonCodeBAMM NameVerificationSubmissionReasonCode = "BAMM" + + // NameVerificationSubmissionReasonCodePAMM captures enum value "PAMM" + NameVerificationSubmissionReasonCodePAMM NameVerificationSubmissionReasonCode = "PAMM" + + // NameVerificationSubmissionReasonCodeAC01 captures enum value "AC01" + NameVerificationSubmissionReasonCodeAC01 NameVerificationSubmissionReasonCode = "AC01" + + // NameVerificationSubmissionReasonCodeIVCR captures enum value "IVCR" + NameVerificationSubmissionReasonCodeIVCR NameVerificationSubmissionReasonCode = "IVCR" + + // NameVerificationSubmissionReasonCodeCASS captures enum value "CASS" + NameVerificationSubmissionReasonCodeCASS NameVerificationSubmissionReasonCode = "CASS" + + // NameVerificationSubmissionReasonCodeSCNS captures enum value "SCNS" + NameVerificationSubmissionReasonCodeSCNS NameVerificationSubmissionReasonCode = "SCNS" + + // NameVerificationSubmissionReasonCodeACNS captures enum value "ACNS" + NameVerificationSubmissionReasonCodeACNS NameVerificationSubmissionReasonCode = "ACNS" + + // NameVerificationSubmissionReasonCodeOPTO captures enum value "OPTO" + NameVerificationSubmissionReasonCodeOPTO NameVerificationSubmissionReasonCode = "OPTO" +) + +// for schema +var nameVerificationSubmissionReasonCodeEnum []interface{} + +func init() { + var res []NameVerificationSubmissionReasonCode + if err := json.Unmarshal([]byte(`["ANNM","MBAM","BANM","PANM","BAMM","PAMM","AC01","IVCR","CASS","SCNS","ACNS","OPTO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nameVerificationSubmissionReasonCodeEnum = append(nameVerificationSubmissionReasonCodeEnum, v) + } +} + +func (m NameVerificationSubmissionReasonCode) validateNameVerificationSubmissionReasonCodeEnum(path, location string, value NameVerificationSubmissionReasonCode) error { + if err := validate.Enum(path, location, value, nameVerificationSubmissionReasonCodeEnum); err != nil { + return err + } + return nil +} + +// Validate validates this name verification submission reason code +func (m NameVerificationSubmissionReasonCode) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateNameVerificationSubmissionReasonCodeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationSubmissionReasonCode) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_submission_relationships.go b/pkg/generated/models/name_verification_submission_relationships.go new file mode 100644 index 00000000..e3c35041 --- /dev/null +++ b/pkg/generated/models/name_verification_submission_relationships.go @@ -0,0 +1,188 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NameVerificationSubmissionRelationships name verification submission relationships +// swagger:model NameVerificationSubmissionRelationships +type NameVerificationSubmissionRelationships struct { + + // name verification + NameVerification *NameVerificationSubmissionRelationshipsNameVerification `json:"name_verification,omitempty"` +} + +func NameVerificationSubmissionRelationshipsWithDefaults(defaults client.Defaults) *NameVerificationSubmissionRelationships { + return &NameVerificationSubmissionRelationships{ + + NameVerification: NameVerificationSubmissionRelationshipsNameVerificationWithDefaults(defaults), + } +} + +func (m *NameVerificationSubmissionRelationships) WithNameVerification(nameVerification NameVerificationSubmissionRelationshipsNameVerification) *NameVerificationSubmissionRelationships { + + m.NameVerification = &nameVerification + + return m +} + +func (m *NameVerificationSubmissionRelationships) WithoutNameVerification() *NameVerificationSubmissionRelationships { + m.NameVerification = nil + return m +} + +// Validate validates this name verification submission relationships +func (m *NameVerificationSubmissionRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNameVerification(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationSubmissionRelationships) validateNameVerification(formats strfmt.Registry) error { + + if swag.IsZero(m.NameVerification) { // not required + return nil + } + + if m.NameVerification != nil { + if err := m.NameVerification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationSubmissionRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationSubmissionRelationships) UnmarshalBinary(b []byte) error { + var res NameVerificationSubmissionRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationSubmissionRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NameVerificationSubmissionRelationshipsNameVerification name verification submission relationships name verification +// swagger:model NameVerificationSubmissionRelationshipsNameVerification +type NameVerificationSubmissionRelationshipsNameVerification struct { + + // data + Data []*NameVerification `json:"data"` +} + +func NameVerificationSubmissionRelationshipsNameVerificationWithDefaults(defaults client.Defaults) *NameVerificationSubmissionRelationshipsNameVerification { + return &NameVerificationSubmissionRelationshipsNameVerification{ + + Data: make([]*NameVerification, 0), + } +} + +func (m *NameVerificationSubmissionRelationshipsNameVerification) WithData(data []*NameVerification) *NameVerificationSubmissionRelationshipsNameVerification { + + m.Data = data + + return m +} + +// Validate validates this name verification submission relationships name verification +func (m *NameVerificationSubmissionRelationshipsNameVerification) 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 *NameVerificationSubmissionRelationshipsNameVerification) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name_verification" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NameVerificationSubmissionRelationshipsNameVerification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NameVerificationSubmissionRelationshipsNameVerification) UnmarshalBinary(b []byte) error { + var res NameVerificationSubmissionRelationshipsNameVerification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NameVerificationSubmissionRelationshipsNameVerification) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/name_verification_submission_status.go b/pkg/generated/models/name_verification_submission_status.go new file mode 100644 index 00000000..bc7a1dcc --- /dev/null +++ b/pkg/generated/models/name_verification_submission_status.go @@ -0,0 +1,72 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// NameVerificationSubmissionStatus name verification submission status +// swagger:model NameVerificationSubmissionStatus +type NameVerificationSubmissionStatus string + +const ( + + // NameVerificationSubmissionStatusDeliveryConfirmed captures enum value "delivery_confirmed" + NameVerificationSubmissionStatusDeliveryConfirmed NameVerificationSubmissionStatus = "delivery_confirmed" + + // NameVerificationSubmissionStatusDeliveryFailed captures enum value "delivery_failed" + NameVerificationSubmissionStatusDeliveryFailed NameVerificationSubmissionStatus = "delivery_failed" +) + +// for schema +var nameVerificationSubmissionStatusEnum []interface{} + +func init() { + var res []NameVerificationSubmissionStatus + if err := json.Unmarshal([]byte(`["delivery_confirmed","delivery_failed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nameVerificationSubmissionStatusEnum = append(nameVerificationSubmissionStatusEnum, v) + } +} + +func (m NameVerificationSubmissionStatus) validateNameVerificationSubmissionStatusEnum(path, location string, value NameVerificationSubmissionStatus) error { + if err := validate.Enum(path, location, value, nameVerificationSubmissionStatusEnum); err != nil { + return err + } + return nil +} + +// Validate validates this name verification submission status +func (m NameVerificationSubmissionStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateNameVerificationSubmissionStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NameVerificationSubmissionStatus) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/new_payment.go b/pkg/generated/models/new_payment.go new file mode 100644 index 00000000..88f003d0 --- /dev/null +++ b/pkg/generated/models/new_payment.go @@ -0,0 +1,349 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewPayment new payment +// swagger:model NewPayment +type NewPayment struct { + + // attributes + // Required: true + Attributes *PaymentAttributes `json:"attributes"` + + // created on + // Format: date-time + CreatedOn *strfmt.DateTime `json:"created_on,omitempty"` + + // Unique resource ID + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // modified on + // Format: date-time + ModifiedOn *strfmt.DateTime `json:"modified_on,omitempty"` + + // Unique ID of the organisation this resource is created by + // Required: true + // Format: uuid + OrganisationID *strfmt.UUID `json:"organisation_id"` + + // relationships + Relationships *NewPaymentRelationships `json:"relationships,omitempty"` + + // Name of the resource type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // Version number + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func NewPaymentWithDefaults(defaults client.Defaults) *NewPayment { + return &NewPayment{ + + Attributes: PaymentAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTimePtr("NewPayment", "created_on"), + + ID: defaults.GetStrfmtUUIDPtr("NewPayment", "id"), + + ModifiedOn: defaults.GetStrfmtDateTimePtr("NewPayment", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUIDPtr("NewPayment", "organisation_id"), + + Relationships: NewPaymentRelationshipsWithDefaults(defaults), + + Type: defaults.GetString("NewPayment", "type"), + + Version: defaults.GetInt64Ptr("NewPayment", "version"), + } +} + +func (m *NewPayment) WithAttributes(attributes PaymentAttributes) *NewPayment { + + m.Attributes = &attributes + + return m +} + +func (m *NewPayment) WithoutAttributes() *NewPayment { + m.Attributes = nil + return m +} + +func (m *NewPayment) WithCreatedOn(createdOn strfmt.DateTime) *NewPayment { + + m.CreatedOn = &createdOn + + return m +} + +func (m *NewPayment) WithoutCreatedOn() *NewPayment { + m.CreatedOn = nil + return m +} + +func (m *NewPayment) WithID(id strfmt.UUID) *NewPayment { + + m.ID = &id + + return m +} + +func (m *NewPayment) WithoutID() *NewPayment { + m.ID = nil + return m +} + +func (m *NewPayment) WithModifiedOn(modifiedOn strfmt.DateTime) *NewPayment { + + m.ModifiedOn = &modifiedOn + + return m +} + +func (m *NewPayment) WithoutModifiedOn() *NewPayment { + m.ModifiedOn = nil + return m +} + +func (m *NewPayment) WithOrganisationID(organisationID strfmt.UUID) *NewPayment { + + m.OrganisationID = &organisationID + + return m +} + +func (m *NewPayment) WithoutOrganisationID() *NewPayment { + m.OrganisationID = nil + return m +} + +func (m *NewPayment) WithRelationships(relationships NewPaymentRelationships) *NewPayment { + + m.Relationships = &relationships + + return m +} + +func (m *NewPayment) WithoutRelationships() *NewPayment { + m.Relationships = nil + return m +} + +func (m *NewPayment) WithType(typeVar string) *NewPayment { + + m.Type = typeVar + + return m +} + +func (m *NewPayment) WithVersion(version int64) *NewPayment { + + m.Version = &version + + return m +} + +func (m *NewPayment) WithoutVersion() *NewPayment { + m.Version = nil + return m +} + +// Validate validates this new payment +func (m *NewPayment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModifiedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRelationships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NewPayment) validateAttributes(formats strfmt.Registry) error { + + if err := validate.Required("attributes", "body", m.Attributes); err != nil { + return err + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *NewPayment) validateCreatedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedOn) { // not required + return nil + } + + if err := validate.FormatOf("created_on", "body", "date-time", m.CreatedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NewPayment) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NewPayment) validateModifiedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.ModifiedOn) { // not required + return nil + } + + if err := validate.FormatOf("modified_on", "body", "date-time", m.ModifiedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NewPayment) validateOrganisationID(formats strfmt.Registry) error { + + if err := validate.Required("organisation_id", "body", m.OrganisationID); err != nil { + return err + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *NewPayment) validateRelationships(formats strfmt.Registry) error { + + if swag.IsZero(m.Relationships) { // not required + return nil + } + + if m.Relationships != nil { + if err := m.Relationships.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships") + } + return err + } + } + + return nil +} + +func (m *NewPayment) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *NewPayment) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPayment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPayment) UnmarshalBinary(b []byte) error { + var res NewPayment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPayment) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/new_payment_relationships.go b/pkg/generated/models/new_payment_relationships.go new file mode 100644 index 00000000..94a676b0 --- /dev/null +++ b/pkg/generated/models/new_payment_relationships.go @@ -0,0 +1,1563 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// NewPaymentRelationships new payment relationships +// swagger:model NewPaymentRelationships +type NewPaymentRelationships struct { + + // beneficiary + Beneficiary *NewPaymentRelationshipsBeneficiary `json:"beneficiary,omitempty"` + + // beneficiary account + BeneficiaryAccount *NewPaymentRelationshipsBeneficiaryAccount `json:"beneficiary_account,omitempty"` + + // debtor + Debtor *NewPaymentRelationshipsDebtor `json:"debtor,omitempty"` + + // debtor account + DebtorAccount *NewPaymentRelationshipsDebtorAccount `json:"debtor_account,omitempty"` + + // forwarded payment + ForwardedPayment *NewPaymentRelationshipsForwardedPayment `json:"forwarded_payment,omitempty"` + + // fx deal + FxDeal *NewPaymentRelationshipsFxDeal `json:"fx_deal,omitempty"` + + // payment admission + PaymentAdmission *NewPaymentRelationshipsPaymentAdmission `json:"payment_admission,omitempty"` + + // payment advice + PaymentAdvice *NewPaymentRelationshipsPaymentAdvice `json:"payment_advice,omitempty"` + + // payment recall + PaymentRecall *NewPaymentRelationshipsPaymentRecall `json:"payment_recall,omitempty"` + + // payment return + PaymentReturn *NewPaymentRelationshipsPaymentReturn `json:"payment_return,omitempty"` + + // payment reversal + PaymentReversal *NewPaymentRelationshipsPaymentReversal `json:"payment_reversal,omitempty"` + + // payment submission + PaymentSubmission *NewPaymentRelationshipsPaymentSubmission `json:"payment_submission,omitempty"` +} + +func NewPaymentRelationshipsWithDefaults(defaults client.Defaults) *NewPaymentRelationships { + return &NewPaymentRelationships{ + + Beneficiary: NewPaymentRelationshipsBeneficiaryWithDefaults(defaults), + + BeneficiaryAccount: NewPaymentRelationshipsBeneficiaryAccountWithDefaults(defaults), + + Debtor: NewPaymentRelationshipsDebtorWithDefaults(defaults), + + DebtorAccount: NewPaymentRelationshipsDebtorAccountWithDefaults(defaults), + + ForwardedPayment: NewPaymentRelationshipsForwardedPaymentWithDefaults(defaults), + + FxDeal: NewPaymentRelationshipsFxDealWithDefaults(defaults), + + PaymentAdmission: NewPaymentRelationshipsPaymentAdmissionWithDefaults(defaults), + + PaymentAdvice: NewPaymentRelationshipsPaymentAdviceWithDefaults(defaults), + + PaymentRecall: NewPaymentRelationshipsPaymentRecallWithDefaults(defaults), + + PaymentReturn: NewPaymentRelationshipsPaymentReturnWithDefaults(defaults), + + PaymentReversal: NewPaymentRelationshipsPaymentReversalWithDefaults(defaults), + + PaymentSubmission: NewPaymentRelationshipsPaymentSubmissionWithDefaults(defaults), + } +} + +func (m *NewPaymentRelationships) WithBeneficiary(beneficiary NewPaymentRelationshipsBeneficiary) *NewPaymentRelationships { + + m.Beneficiary = &beneficiary + + return m +} + +func (m *NewPaymentRelationships) WithoutBeneficiary() *NewPaymentRelationships { + m.Beneficiary = nil + return m +} + +func (m *NewPaymentRelationships) WithBeneficiaryAccount(beneficiaryAccount NewPaymentRelationshipsBeneficiaryAccount) *NewPaymentRelationships { + + m.BeneficiaryAccount = &beneficiaryAccount + + return m +} + +func (m *NewPaymentRelationships) WithoutBeneficiaryAccount() *NewPaymentRelationships { + m.BeneficiaryAccount = nil + return m +} + +func (m *NewPaymentRelationships) WithDebtor(debtor NewPaymentRelationshipsDebtor) *NewPaymentRelationships { + + m.Debtor = &debtor + + return m +} + +func (m *NewPaymentRelationships) WithoutDebtor() *NewPaymentRelationships { + m.Debtor = nil + return m +} + +func (m *NewPaymentRelationships) WithDebtorAccount(debtorAccount NewPaymentRelationshipsDebtorAccount) *NewPaymentRelationships { + + m.DebtorAccount = &debtorAccount + + return m +} + +func (m *NewPaymentRelationships) WithoutDebtorAccount() *NewPaymentRelationships { + m.DebtorAccount = nil + return m +} + +func (m *NewPaymentRelationships) WithForwardedPayment(forwardedPayment NewPaymentRelationshipsForwardedPayment) *NewPaymentRelationships { + + m.ForwardedPayment = &forwardedPayment + + return m +} + +func (m *NewPaymentRelationships) WithoutForwardedPayment() *NewPaymentRelationships { + m.ForwardedPayment = nil + return m +} + +func (m *NewPaymentRelationships) WithFxDeal(fxDeal NewPaymentRelationshipsFxDeal) *NewPaymentRelationships { + + m.FxDeal = &fxDeal + + return m +} + +func (m *NewPaymentRelationships) WithoutFxDeal() *NewPaymentRelationships { + m.FxDeal = nil + return m +} + +func (m *NewPaymentRelationships) WithPaymentAdmission(paymentAdmission NewPaymentRelationshipsPaymentAdmission) *NewPaymentRelationships { + + m.PaymentAdmission = &paymentAdmission + + return m +} + +func (m *NewPaymentRelationships) WithoutPaymentAdmission() *NewPaymentRelationships { + m.PaymentAdmission = nil + return m +} + +func (m *NewPaymentRelationships) WithPaymentAdvice(paymentAdvice NewPaymentRelationshipsPaymentAdvice) *NewPaymentRelationships { + + m.PaymentAdvice = &paymentAdvice + + return m +} + +func (m *NewPaymentRelationships) WithoutPaymentAdvice() *NewPaymentRelationships { + m.PaymentAdvice = nil + return m +} + +func (m *NewPaymentRelationships) WithPaymentRecall(paymentRecall NewPaymentRelationshipsPaymentRecall) *NewPaymentRelationships { + + m.PaymentRecall = &paymentRecall + + return m +} + +func (m *NewPaymentRelationships) WithoutPaymentRecall() *NewPaymentRelationships { + m.PaymentRecall = nil + return m +} + +func (m *NewPaymentRelationships) WithPaymentReturn(paymentReturn NewPaymentRelationshipsPaymentReturn) *NewPaymentRelationships { + + m.PaymentReturn = &paymentReturn + + return m +} + +func (m *NewPaymentRelationships) WithoutPaymentReturn() *NewPaymentRelationships { + m.PaymentReturn = nil + return m +} + +func (m *NewPaymentRelationships) WithPaymentReversal(paymentReversal NewPaymentRelationshipsPaymentReversal) *NewPaymentRelationships { + + m.PaymentReversal = &paymentReversal + + return m +} + +func (m *NewPaymentRelationships) WithoutPaymentReversal() *NewPaymentRelationships { + m.PaymentReversal = nil + return m +} + +func (m *NewPaymentRelationships) WithPaymentSubmission(paymentSubmission NewPaymentRelationshipsPaymentSubmission) *NewPaymentRelationships { + + m.PaymentSubmission = &paymentSubmission + + return m +} + +func (m *NewPaymentRelationships) WithoutPaymentSubmission() *NewPaymentRelationships { + m.PaymentSubmission = nil + return m +} + +// Validate validates this new payment relationships +func (m *NewPaymentRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBeneficiary(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBeneficiaryAccount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDebtor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDebtorAccount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateForwardedPayment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFxDeal(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentAdmission(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentAdvice(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRecall(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentReturn(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentReversal(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentSubmission(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NewPaymentRelationships) validateBeneficiary(formats strfmt.Registry) error { + + if swag.IsZero(m.Beneficiary) { // not required + return nil + } + + if m.Beneficiary != nil { + if err := m.Beneficiary.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validateBeneficiaryAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.BeneficiaryAccount) { // not required + return nil + } + + if m.BeneficiaryAccount != nil { + if err := m.BeneficiaryAccount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_account") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validateDebtor(formats strfmt.Registry) error { + + if swag.IsZero(m.Debtor) { // not required + return nil + } + + if m.Debtor != nil { + if err := m.Debtor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validateDebtorAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.DebtorAccount) { // not required + return nil + } + + if m.DebtorAccount != nil { + if err := m.DebtorAccount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_account") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validateForwardedPayment(formats strfmt.Registry) error { + + if swag.IsZero(m.ForwardedPayment) { // not required + return nil + } + + if m.ForwardedPayment != nil { + if err := m.ForwardedPayment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarded_payment") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validateFxDeal(formats strfmt.Registry) error { + + if swag.IsZero(m.FxDeal) { // not required + return nil + } + + if m.FxDeal != nil { + if err := m.FxDeal.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fx_deal") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validatePaymentAdmission(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentAdmission) { // not required + return nil + } + + if m.PaymentAdmission != nil { + if err := m.PaymentAdmission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_admission") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validatePaymentAdvice(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentAdvice) { // not required + return nil + } + + if m.PaymentAdvice != nil { + if err := m.PaymentAdvice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_advice") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validatePaymentRecall(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentRecall) { // not required + return nil + } + + if m.PaymentRecall != nil { + if err := m.PaymentRecall.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_recall") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validatePaymentReturn(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentReturn) { // not required + return nil + } + + if m.PaymentReturn != nil { + if err := m.PaymentReturn.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_return") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validatePaymentReversal(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentReversal) { // not required + return nil + } + + if m.PaymentReversal != nil { + if err := m.PaymentReversal.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_reversal") + } + return err + } + } + + return nil +} + +func (m *NewPaymentRelationships) validatePaymentSubmission(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentSubmission) { // not required + return nil + } + + if m.PaymentSubmission != nil { + if err := m.PaymentSubmission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_submission") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationships) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsBeneficiary new payment relationships beneficiary +// swagger:model NewPaymentRelationshipsBeneficiary +type NewPaymentRelationshipsBeneficiary struct { + + // Array of beneficiary resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func NewPaymentRelationshipsBeneficiaryWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsBeneficiary { + return &NewPaymentRelationshipsBeneficiary{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *NewPaymentRelationshipsBeneficiary) WithData(data []*RelationshipData) *NewPaymentRelationshipsBeneficiary { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships beneficiary +func (m *NewPaymentRelationshipsBeneficiary) 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 *NewPaymentRelationshipsBeneficiary) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsBeneficiary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsBeneficiary) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsBeneficiary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsBeneficiary) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsBeneficiaryAccount new payment relationships beneficiary account +// swagger:model NewPaymentRelationshipsBeneficiaryAccount +type NewPaymentRelationshipsBeneficiaryAccount struct { + + // Array of beneficiary account resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func NewPaymentRelationshipsBeneficiaryAccountWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsBeneficiaryAccount { + return &NewPaymentRelationshipsBeneficiaryAccount{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *NewPaymentRelationshipsBeneficiaryAccount) WithData(data []*RelationshipData) *NewPaymentRelationshipsBeneficiaryAccount { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships beneficiary account +func (m *NewPaymentRelationshipsBeneficiaryAccount) 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 *NewPaymentRelationshipsBeneficiaryAccount) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_account" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsBeneficiaryAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsBeneficiaryAccount) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsBeneficiaryAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsBeneficiaryAccount) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsDebtor new payment relationships debtor +// swagger:model NewPaymentRelationshipsDebtor +type NewPaymentRelationshipsDebtor struct { + + // Array of debtor resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func NewPaymentRelationshipsDebtorWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsDebtor { + return &NewPaymentRelationshipsDebtor{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *NewPaymentRelationshipsDebtor) WithData(data []*RelationshipData) *NewPaymentRelationshipsDebtor { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships debtor +func (m *NewPaymentRelationshipsDebtor) 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 *NewPaymentRelationshipsDebtor) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsDebtor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsDebtor) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsDebtor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsDebtor) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsDebtorAccount new payment relationships debtor account +// swagger:model NewPaymentRelationshipsDebtorAccount +type NewPaymentRelationshipsDebtorAccount struct { + + // Array of debtor account resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func NewPaymentRelationshipsDebtorAccountWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsDebtorAccount { + return &NewPaymentRelationshipsDebtorAccount{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *NewPaymentRelationshipsDebtorAccount) WithData(data []*RelationshipData) *NewPaymentRelationshipsDebtorAccount { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships debtor account +func (m *NewPaymentRelationshipsDebtorAccount) 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 *NewPaymentRelationshipsDebtorAccount) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_account" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsDebtorAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsDebtorAccount) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsDebtorAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsDebtorAccount) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsForwardedPayment new payment relationships forwarded payment +// swagger:model NewPaymentRelationshipsForwardedPayment +type NewPaymentRelationshipsForwardedPayment struct { + + // Array of Inbound Payments that triggered the creation of this Forwarding Payment. + Data []*RelationshipData `json:"data"` +} + +func NewPaymentRelationshipsForwardedPaymentWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsForwardedPayment { + return &NewPaymentRelationshipsForwardedPayment{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *NewPaymentRelationshipsForwardedPayment) WithData(data []*RelationshipData) *NewPaymentRelationshipsForwardedPayment { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships forwarded payment +func (m *NewPaymentRelationshipsForwardedPayment) 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 *NewPaymentRelationshipsForwardedPayment) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarded_payment" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsForwardedPayment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsForwardedPayment) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsForwardedPayment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsForwardedPayment) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsFxDeal new payment relationships fx deal +// swagger:model NewPaymentRelationshipsFxDeal +type NewPaymentRelationshipsFxDeal struct { + + // Array of FXDeal resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func NewPaymentRelationshipsFxDealWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsFxDeal { + return &NewPaymentRelationshipsFxDeal{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *NewPaymentRelationshipsFxDeal) WithData(data []*RelationshipData) *NewPaymentRelationshipsFxDeal { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships fx deal +func (m *NewPaymentRelationshipsFxDeal) 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 *NewPaymentRelationshipsFxDeal) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fx_deal" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsFxDeal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsFxDeal) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsFxDeal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsFxDeal) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsPaymentAdmission new payment relationships payment admission +// swagger:model NewPaymentRelationshipsPaymentAdmission +type NewPaymentRelationshipsPaymentAdmission struct { + + // Array of Payment Admission resources related to the payment + Data []*PaymentAdmission `json:"data"` +} + +func NewPaymentRelationshipsPaymentAdmissionWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsPaymentAdmission { + return &NewPaymentRelationshipsPaymentAdmission{ + + Data: make([]*PaymentAdmission, 0), + } +} + +func (m *NewPaymentRelationshipsPaymentAdmission) WithData(data []*PaymentAdmission) *NewPaymentRelationshipsPaymentAdmission { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships payment admission +func (m *NewPaymentRelationshipsPaymentAdmission) 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 *NewPaymentRelationshipsPaymentAdmission) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_admission" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentAdmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentAdmission) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsPaymentAdmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsPaymentAdmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsPaymentAdvice new payment relationships payment advice +// swagger:model NewPaymentRelationshipsPaymentAdvice +type NewPaymentRelationshipsPaymentAdvice struct { + + // Array of Payment Advice resources related to the payment + Data []*PaymentAdvice `json:"data"` +} + +func NewPaymentRelationshipsPaymentAdviceWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsPaymentAdvice { + return &NewPaymentRelationshipsPaymentAdvice{ + + Data: make([]*PaymentAdvice, 0), + } +} + +func (m *NewPaymentRelationshipsPaymentAdvice) WithData(data []*PaymentAdvice) *NewPaymentRelationshipsPaymentAdvice { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships payment advice +func (m *NewPaymentRelationshipsPaymentAdvice) 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 *NewPaymentRelationshipsPaymentAdvice) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_advice" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentAdvice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentAdvice) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsPaymentAdvice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsPaymentAdvice) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsPaymentRecall new payment relationships payment recall +// swagger:model NewPaymentRelationshipsPaymentRecall +type NewPaymentRelationshipsPaymentRecall struct { + + // Array of Payment Recall resources related to the payment + Data []*Recall `json:"data"` +} + +func NewPaymentRelationshipsPaymentRecallWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsPaymentRecall { + return &NewPaymentRelationshipsPaymentRecall{ + + Data: make([]*Recall, 0), + } +} + +func (m *NewPaymentRelationshipsPaymentRecall) WithData(data []*Recall) *NewPaymentRelationshipsPaymentRecall { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships payment recall +func (m *NewPaymentRelationshipsPaymentRecall) 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 *NewPaymentRelationshipsPaymentRecall) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_recall" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentRecall) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentRecall) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsPaymentRecall + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsPaymentRecall) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsPaymentReturn new payment relationships payment return +// swagger:model NewPaymentRelationshipsPaymentReturn +type NewPaymentRelationshipsPaymentReturn struct { + + // Array of Payment Return resources related to the payment + Data []*ReturnPayment `json:"data"` +} + +func NewPaymentRelationshipsPaymentReturnWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsPaymentReturn { + return &NewPaymentRelationshipsPaymentReturn{ + + Data: make([]*ReturnPayment, 0), + } +} + +func (m *NewPaymentRelationshipsPaymentReturn) WithData(data []*ReturnPayment) *NewPaymentRelationshipsPaymentReturn { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships payment return +func (m *NewPaymentRelationshipsPaymentReturn) 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 *NewPaymentRelationshipsPaymentReturn) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_return" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentReturn) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentReturn) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsPaymentReturn + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsPaymentReturn) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsPaymentReversal new payment relationships payment reversal +// swagger:model NewPaymentRelationshipsPaymentReversal +type NewPaymentRelationshipsPaymentReversal struct { + + // Array of Payment Reversal resources related to the payment + Data []*ReversalPayment `json:"data"` +} + +func NewPaymentRelationshipsPaymentReversalWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsPaymentReversal { + return &NewPaymentRelationshipsPaymentReversal{ + + Data: make([]*ReversalPayment, 0), + } +} + +func (m *NewPaymentRelationshipsPaymentReversal) WithData(data []*ReversalPayment) *NewPaymentRelationshipsPaymentReversal { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships payment reversal +func (m *NewPaymentRelationshipsPaymentReversal) 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 *NewPaymentRelationshipsPaymentReversal) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_reversal" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentReversal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentReversal) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsPaymentReversal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsPaymentReversal) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// NewPaymentRelationshipsPaymentSubmission new payment relationships payment submission +// swagger:model NewPaymentRelationshipsPaymentSubmission +type NewPaymentRelationshipsPaymentSubmission struct { + + // Array of Payment Submission resources related to the payment + Data []*PaymentSubmission `json:"data"` +} + +func NewPaymentRelationshipsPaymentSubmissionWithDefaults(defaults client.Defaults) *NewPaymentRelationshipsPaymentSubmission { + return &NewPaymentRelationshipsPaymentSubmission{ + + Data: make([]*PaymentSubmission, 0), + } +} + +func (m *NewPaymentRelationshipsPaymentSubmission) WithData(data []*PaymentSubmission) *NewPaymentRelationshipsPaymentSubmission { + + m.Data = data + + return m +} + +// Validate validates this new payment relationships payment submission +func (m *NewPaymentRelationshipsPaymentSubmission) 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 *NewPaymentRelationshipsPaymentSubmission) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_submission" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentSubmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NewPaymentRelationshipsPaymentSubmission) UnmarshalBinary(b []byte) error { + var res NewPaymentRelationshipsPaymentSubmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *NewPaymentRelationshipsPaymentSubmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment.go b/pkg/generated/models/payment.go index 15988f2f..7bcd2a9e 100644 --- a/pkg/generated/models/payment.go +++ b/pkg/generated/models/payment.go @@ -8,7 +8,6 @@ package models import ( "encoding/json" "log" - "strconv" "github.com/form3tech-oss/go-form3/v6/pkg/client" strfmt "github.com/go-openapi/strfmt" @@ -348,2299 +347,3 @@ func (m *Payment) Json() string { } return string(json) } - -// PaymentAttributes payment attributes -// swagger:model PaymentAttributes -type PaymentAttributes struct { - - // Block to represent a Financial Institution/agent in the payment chain - Agents []*Agent `json:"agents,omitempty"` - - // Amount of money moved between the instructing agent and instructed agent - // Pattern: ^[0-9.]{0,20}$ - Amount string `json:"amount,omitempty"` - - // batch booking indicator - BatchBookingIndicator string `json:"batch_booking_indicator,omitempty"` - - // batch id - BatchID string `json:"batch_id,omitempty"` - - // batch type - BatchType string `json:"batch_type,omitempty"` - - // beneficiary party - BeneficiaryParty *PaymentAttributesBeneficiaryParty `json:"beneficiary_party,omitempty"` - - // Category purpose in proprietary form. Specifies the high level purpose of the instruction. Cannot be used at the same time as `category_purpose_coded`. - CategoryPurpose string `json:"category_purpose,omitempty"` - - // Category purpose in a coded form. Specifies the high level purpose of the instruction. Cannot be used at the same time as `category_purpose`. - CategoryPurposeCoded string `json:"category_purpose_coded,omitempty"` - - // charges information - ChargesInformation *ChargesInformation `json:"charges_information,omitempty"` - - // Unique identifier for organisations collecting payments - ClearingID string `json:"clearing_id,omitempty"` - - // Currency of the transaction amount. Currency code as defined in [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm) - Currency string `json:"currency,omitempty"` - - // debtor party - DebtorParty *PaymentAttributesDebtorParty `json:"debtor_party,omitempty"` - - // Unique identification, as assigned by the initiating party, to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain. - EndToEndReference string `json:"end_to_end_reference,omitempty"` - - // file number - FileNumber string `json:"file_number,omitempty"` - - // fx - Fx *PaymentAttributesFx `json:"fx,omitempty"` - - // Unique identification, as assigned by the initiating party to unambiguously identify the transaction. This identification is an point-to-point reference and is passed on, unchanged, throughout the entire chain. Cannot include leading, trailing or internal spaces. - InstructionID string `json:"instruction_id,omitempty"` - - // intermediary bank - IntermediaryBank *IntermediaryBankAccountHoldingEntity `json:"intermediary_bank,omitempty"` - - // Numeric reference field, see scheme specific descriptions for usage - NumericReference string `json:"numeric_reference,omitempty"` - - // Timestamp of when the payment instruction meets the set processing conditions. Format: YYYY-MM-DDThh:mm:ss:mmm+hh:mm - // Format: date-time - PaymentAcceptanceDatetime *strfmt.DateTime `json:"payment_acceptance_datetime,omitempty"` - - // Purpose of the payment in a proprietary form - PaymentPurpose string `json:"payment_purpose,omitempty"` - - // Purpose of the payment in a coded form - PaymentPurposeCoded string `json:"payment_purpose_coded,omitempty"` - - // Clearing infrastructure through which the payment instruction is to be processed. Default for given organisation ID is used if left empty. Has to be a valid [scheme identifier](http://draft-api-docs.form3.tech/api.html#enumerations-schemes). - PaymentScheme string `json:"payment_scheme,omitempty"` - - // payment type - PaymentType string `json:"payment_type,omitempty"` - - // Date on which the payment is to be debited from the debtor account. Formatted according to ISO 8601 format: YYYY-MM-DD. - // Format: date - ProcessingDate *strfmt.Date `json:"processing_date,omitempty"` - - // receivers correspondent - ReceiversCorrespondent *ReceiversCorrespondentAccountHoldingEntity `json:"receivers_correspondent,omitempty"` - - // Payment reference for beneficiary use - Reference string `json:"reference,omitempty"` - - // Regulatory reporting information - RegulatoryReporting string `json:"regulatory_reporting,omitempty"` - - // reimbursement - Reimbursement *ReimbursementAccountHoldingEntity `json:"reimbursement,omitempty"` - - // Information supplied to enable the matching of an entry with the items that the transfer is intended to settle, such as commercial invoices in an accounts receivable system provided by the debtor for the beneficiary. - RemittanceInformation string `json:"remittance_information,omitempty"` - - // The scheme specific payment [sub type](http://api-docs.form3.tech/api.html#enumerations-scheme-specific-payment-sub-types) - SchemePaymentSubType string `json:"scheme_payment_sub_type,omitempty"` - - // The [scheme-specific payment type](#enumerations-scheme-payment-types) - SchemePaymentType string `json:"scheme_payment_type,omitempty"` - - // Date on which the payment is processed by the scheme. Only used if different from `processing_date`. - // Format: date - SchemeProcessingDate *strfmt.Date `json:"scheme_processing_date,omitempty"` - - // Unique identification, as assigned by the first instructing agent, to unambiguously identify the transaction that is passed on, unchanged, throughout the entire interbank chain. - SchemeTransactionID string `json:"scheme_transaction_id,omitempty"` - - // senders correspondent - SendersCorrespondent *SendersCorrespondentAccountHoldingEntity `json:"senders_correspondent,omitempty"` - - // settlement - Settlement *Settlement `json:"settlement,omitempty"` - - // structured reference - StructuredReference *PaymentAttributesStructuredReference `json:"structured_reference,omitempty"` - - // swift - Swift *PaymentAttributesSwift `json:"swift,omitempty"` - - // ultimate beneficiary - UltimateBeneficiary *UltimateEntity `json:"ultimate_beneficiary,omitempty"` - - // ultimate debtor - UltimateDebtor *UltimateEntity `json:"ultimate_debtor,omitempty"` - - // The scheme-specific unique transaction ID. Populated by the scheme. - UniqueSchemeID string `json:"unique_scheme_id,omitempty"` - - // All purpose list of key-value pairs specific data stored on the payment. - // Max Items: 5 - UserDefinedData []*UserDefinedDataForPayment `json:"user_defined_data"` -} - -func PaymentAttributesWithDefaults(defaults client.Defaults) *PaymentAttributes { - return &PaymentAttributes{ - - Agents: make([]*Agent, 0), - - Amount: defaults.GetString("PaymentAttributes", "amount"), - - BatchBookingIndicator: defaults.GetString("PaymentAttributes", "batch_booking_indicator"), - - BatchID: defaults.GetString("PaymentAttributes", "batch_id"), - - BatchType: defaults.GetString("PaymentAttributes", "batch_type"), - - BeneficiaryParty: PaymentAttributesBeneficiaryPartyWithDefaults(defaults), - - CategoryPurpose: defaults.GetString("PaymentAttributes", "category_purpose"), - - CategoryPurposeCoded: defaults.GetString("PaymentAttributes", "category_purpose_coded"), - - ChargesInformation: ChargesInformationWithDefaults(defaults), - - ClearingID: defaults.GetString("PaymentAttributes", "clearing_id"), - - Currency: defaults.GetString("PaymentAttributes", "currency"), - - DebtorParty: PaymentAttributesDebtorPartyWithDefaults(defaults), - - EndToEndReference: defaults.GetString("PaymentAttributes", "end_to_end_reference"), - - FileNumber: defaults.GetString("PaymentAttributes", "file_number"), - - Fx: PaymentAttributesFxWithDefaults(defaults), - - InstructionID: defaults.GetString("PaymentAttributes", "instruction_id"), - - IntermediaryBank: IntermediaryBankAccountHoldingEntityWithDefaults(defaults), - - NumericReference: defaults.GetString("PaymentAttributes", "numeric_reference"), - - PaymentAcceptanceDatetime: defaults.GetStrfmtDateTimePtr("PaymentAttributes", "payment_acceptance_datetime"), - - PaymentPurpose: defaults.GetString("PaymentAttributes", "payment_purpose"), - - PaymentPurposeCoded: defaults.GetString("PaymentAttributes", "payment_purpose_coded"), - - PaymentScheme: defaults.GetString("PaymentAttributes", "payment_scheme"), - - PaymentType: defaults.GetString("PaymentAttributes", "payment_type"), - - ProcessingDate: defaults.GetStrfmtDatePtr("PaymentAttributes", "processing_date"), - - ReceiversCorrespondent: ReceiversCorrespondentAccountHoldingEntityWithDefaults(defaults), - - Reference: defaults.GetString("PaymentAttributes", "reference"), - - RegulatoryReporting: defaults.GetString("PaymentAttributes", "regulatory_reporting"), - - Reimbursement: ReimbursementAccountHoldingEntityWithDefaults(defaults), - - RemittanceInformation: defaults.GetString("PaymentAttributes", "remittance_information"), - - SchemePaymentSubType: defaults.GetString("PaymentAttributes", "scheme_payment_sub_type"), - - SchemePaymentType: defaults.GetString("PaymentAttributes", "scheme_payment_type"), - - SchemeProcessingDate: defaults.GetStrfmtDatePtr("PaymentAttributes", "scheme_processing_date"), - - SchemeTransactionID: defaults.GetString("PaymentAttributes", "scheme_transaction_id"), - - SendersCorrespondent: SendersCorrespondentAccountHoldingEntityWithDefaults(defaults), - - Settlement: SettlementWithDefaults(defaults), - - StructuredReference: PaymentAttributesStructuredReferenceWithDefaults(defaults), - - Swift: PaymentAttributesSwiftWithDefaults(defaults), - - UltimateBeneficiary: UltimateEntityWithDefaults(defaults), - - UltimateDebtor: UltimateEntityWithDefaults(defaults), - - UniqueSchemeID: defaults.GetString("PaymentAttributes", "unique_scheme_id"), - - UserDefinedData: make([]*UserDefinedDataForPayment, 0), - } -} - -func (m *PaymentAttributes) WithAgents(agents []*Agent) *PaymentAttributes { - - m.Agents = agents - - return m -} - -func (m *PaymentAttributes) WithAmount(amount string) *PaymentAttributes { - - m.Amount = amount - - return m -} - -func (m *PaymentAttributes) WithBatchBookingIndicator(batchBookingIndicator string) *PaymentAttributes { - - m.BatchBookingIndicator = batchBookingIndicator - - return m -} - -func (m *PaymentAttributes) WithBatchID(batchID string) *PaymentAttributes { - - m.BatchID = batchID - - return m -} - -func (m *PaymentAttributes) WithBatchType(batchType string) *PaymentAttributes { - - m.BatchType = batchType - - return m -} - -func (m *PaymentAttributes) WithBeneficiaryParty(beneficiaryParty PaymentAttributesBeneficiaryParty) *PaymentAttributes { - - m.BeneficiaryParty = &beneficiaryParty - - return m -} - -func (m *PaymentAttributes) WithoutBeneficiaryParty() *PaymentAttributes { - m.BeneficiaryParty = nil - return m -} - -func (m *PaymentAttributes) WithCategoryPurpose(categoryPurpose string) *PaymentAttributes { - - m.CategoryPurpose = categoryPurpose - - return m -} - -func (m *PaymentAttributes) WithCategoryPurposeCoded(categoryPurposeCoded string) *PaymentAttributes { - - m.CategoryPurposeCoded = categoryPurposeCoded - - return m -} - -func (m *PaymentAttributes) WithChargesInformation(chargesInformation ChargesInformation) *PaymentAttributes { - - m.ChargesInformation = &chargesInformation - - return m -} - -func (m *PaymentAttributes) WithoutChargesInformation() *PaymentAttributes { - m.ChargesInformation = nil - return m -} - -func (m *PaymentAttributes) WithClearingID(clearingID string) *PaymentAttributes { - - m.ClearingID = clearingID - - return m -} - -func (m *PaymentAttributes) WithCurrency(currency string) *PaymentAttributes { - - m.Currency = currency - - return m -} - -func (m *PaymentAttributes) WithDebtorParty(debtorParty PaymentAttributesDebtorParty) *PaymentAttributes { - - m.DebtorParty = &debtorParty - - return m -} - -func (m *PaymentAttributes) WithoutDebtorParty() *PaymentAttributes { - m.DebtorParty = nil - return m -} - -func (m *PaymentAttributes) WithEndToEndReference(endToEndReference string) *PaymentAttributes { - - m.EndToEndReference = endToEndReference - - return m -} - -func (m *PaymentAttributes) WithFileNumber(fileNumber string) *PaymentAttributes { - - m.FileNumber = fileNumber - - return m -} - -func (m *PaymentAttributes) WithFx(fx PaymentAttributesFx) *PaymentAttributes { - - m.Fx = &fx - - return m -} - -func (m *PaymentAttributes) WithoutFx() *PaymentAttributes { - m.Fx = nil - return m -} - -func (m *PaymentAttributes) WithInstructionID(instructionID string) *PaymentAttributes { - - m.InstructionID = instructionID - - return m -} - -func (m *PaymentAttributes) WithIntermediaryBank(intermediaryBank IntermediaryBankAccountHoldingEntity) *PaymentAttributes { - - m.IntermediaryBank = &intermediaryBank - - return m -} - -func (m *PaymentAttributes) WithoutIntermediaryBank() *PaymentAttributes { - m.IntermediaryBank = nil - return m -} - -func (m *PaymentAttributes) WithNumericReference(numericReference string) *PaymentAttributes { - - m.NumericReference = numericReference - - return m -} - -func (m *PaymentAttributes) WithPaymentAcceptanceDatetime(paymentAcceptanceDatetime strfmt.DateTime) *PaymentAttributes { - - m.PaymentAcceptanceDatetime = &paymentAcceptanceDatetime - - return m -} - -func (m *PaymentAttributes) WithoutPaymentAcceptanceDatetime() *PaymentAttributes { - m.PaymentAcceptanceDatetime = nil - return m -} - -func (m *PaymentAttributes) WithPaymentPurpose(paymentPurpose string) *PaymentAttributes { - - m.PaymentPurpose = paymentPurpose - - return m -} - -func (m *PaymentAttributes) WithPaymentPurposeCoded(paymentPurposeCoded string) *PaymentAttributes { - - m.PaymentPurposeCoded = paymentPurposeCoded - - return m -} - -func (m *PaymentAttributes) WithPaymentScheme(paymentScheme string) *PaymentAttributes { - - m.PaymentScheme = paymentScheme - - return m -} - -func (m *PaymentAttributes) WithPaymentType(paymentType string) *PaymentAttributes { - - m.PaymentType = paymentType - - return m -} - -func (m *PaymentAttributes) WithProcessingDate(processingDate strfmt.Date) *PaymentAttributes { - - m.ProcessingDate = &processingDate - - return m -} - -func (m *PaymentAttributes) WithoutProcessingDate() *PaymentAttributes { - m.ProcessingDate = nil - return m -} - -func (m *PaymentAttributes) WithReceiversCorrespondent(receiversCorrespondent ReceiversCorrespondentAccountHoldingEntity) *PaymentAttributes { - - m.ReceiversCorrespondent = &receiversCorrespondent - - return m -} - -func (m *PaymentAttributes) WithoutReceiversCorrespondent() *PaymentAttributes { - m.ReceiversCorrespondent = nil - return m -} - -func (m *PaymentAttributes) WithReference(reference string) *PaymentAttributes { - - m.Reference = reference - - return m -} - -func (m *PaymentAttributes) WithRegulatoryReporting(regulatoryReporting string) *PaymentAttributes { - - m.RegulatoryReporting = regulatoryReporting - - return m -} - -func (m *PaymentAttributes) WithReimbursement(reimbursement ReimbursementAccountHoldingEntity) *PaymentAttributes { - - m.Reimbursement = &reimbursement - - return m -} - -func (m *PaymentAttributes) WithoutReimbursement() *PaymentAttributes { - m.Reimbursement = nil - return m -} - -func (m *PaymentAttributes) WithRemittanceInformation(remittanceInformation string) *PaymentAttributes { - - m.RemittanceInformation = remittanceInformation - - return m -} - -func (m *PaymentAttributes) WithSchemePaymentSubType(schemePaymentSubType string) *PaymentAttributes { - - m.SchemePaymentSubType = schemePaymentSubType - - return m -} - -func (m *PaymentAttributes) WithSchemePaymentType(schemePaymentType string) *PaymentAttributes { - - m.SchemePaymentType = schemePaymentType - - return m -} - -func (m *PaymentAttributes) WithSchemeProcessingDate(schemeProcessingDate strfmt.Date) *PaymentAttributes { - - m.SchemeProcessingDate = &schemeProcessingDate - - return m -} - -func (m *PaymentAttributes) WithoutSchemeProcessingDate() *PaymentAttributes { - m.SchemeProcessingDate = nil - return m -} - -func (m *PaymentAttributes) WithSchemeTransactionID(schemeTransactionID string) *PaymentAttributes { - - m.SchemeTransactionID = schemeTransactionID - - return m -} - -func (m *PaymentAttributes) WithSendersCorrespondent(sendersCorrespondent SendersCorrespondentAccountHoldingEntity) *PaymentAttributes { - - m.SendersCorrespondent = &sendersCorrespondent - - return m -} - -func (m *PaymentAttributes) WithoutSendersCorrespondent() *PaymentAttributes { - m.SendersCorrespondent = nil - return m -} - -func (m *PaymentAttributes) WithSettlement(settlement Settlement) *PaymentAttributes { - - m.Settlement = &settlement - - return m -} - -func (m *PaymentAttributes) WithoutSettlement() *PaymentAttributes { - m.Settlement = nil - return m -} - -func (m *PaymentAttributes) WithStructuredReference(structuredReference PaymentAttributesStructuredReference) *PaymentAttributes { - - m.StructuredReference = &structuredReference - - return m -} - -func (m *PaymentAttributes) WithoutStructuredReference() *PaymentAttributes { - m.StructuredReference = nil - return m -} - -func (m *PaymentAttributes) WithSwift(swift PaymentAttributesSwift) *PaymentAttributes { - - m.Swift = &swift - - return m -} - -func (m *PaymentAttributes) WithoutSwift() *PaymentAttributes { - m.Swift = nil - return m -} - -func (m *PaymentAttributes) WithUltimateBeneficiary(ultimateBeneficiary UltimateEntity) *PaymentAttributes { - - m.UltimateBeneficiary = &ultimateBeneficiary - - return m -} - -func (m *PaymentAttributes) WithoutUltimateBeneficiary() *PaymentAttributes { - m.UltimateBeneficiary = nil - return m -} - -func (m *PaymentAttributes) WithUltimateDebtor(ultimateDebtor UltimateEntity) *PaymentAttributes { - - m.UltimateDebtor = &ultimateDebtor - - return m -} - -func (m *PaymentAttributes) WithoutUltimateDebtor() *PaymentAttributes { - m.UltimateDebtor = nil - return m -} - -func (m *PaymentAttributes) WithUniqueSchemeID(uniqueSchemeID string) *PaymentAttributes { - - m.UniqueSchemeID = uniqueSchemeID - - return m -} - -func (m *PaymentAttributes) WithUserDefinedData(userDefinedData []*UserDefinedDataForPayment) *PaymentAttributes { - - m.UserDefinedData = userDefinedData - - return m -} - -// Validate validates this payment attributes -func (m *PaymentAttributes) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAmount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBeneficiaryParty(formats); err != nil { - res = append(res, err) - } - - if err := m.validateChargesInformation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDebtorParty(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFx(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIntermediaryBank(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentAcceptanceDatetime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcessingDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReceiversCorrespondent(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReimbursement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSchemeProcessingDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSendersCorrespondent(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSettlement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStructuredReference(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSwift(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUltimateBeneficiary(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUltimateDebtor(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserDefinedData(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentAttributes) validateAgents(formats strfmt.Registry) error { - - if swag.IsZero(m.Agents) { // not required - return nil - } - - for i := 0; i < len(m.Agents); i++ { - if swag.IsZero(m.Agents[i]) { // not required - continue - } - - if m.Agents[i] != nil { - if err := m.Agents[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "agents" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PaymentAttributes) validateAmount(formats strfmt.Registry) error { - - if swag.IsZero(m.Amount) { // not required - return nil - } - - if err := validate.Pattern("attributes"+"."+"amount", "body", string(m.Amount), `^[0-9.]{0,20}$`); err != nil { - return err - } - - return nil -} - -func (m *PaymentAttributes) validateBeneficiaryParty(formats strfmt.Registry) error { - - if swag.IsZero(m.BeneficiaryParty) { // not required - return nil - } - - if m.BeneficiaryParty != nil { - if err := m.BeneficiaryParty.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "beneficiary_party") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateChargesInformation(formats strfmt.Registry) error { - - if swag.IsZero(m.ChargesInformation) { // not required - return nil - } - - if m.ChargesInformation != nil { - if err := m.ChargesInformation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "charges_information") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateDebtorParty(formats strfmt.Registry) error { - - if swag.IsZero(m.DebtorParty) { // not required - return nil - } - - if m.DebtorParty != nil { - if err := m.DebtorParty.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "debtor_party") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateFx(formats strfmt.Registry) error { - - if swag.IsZero(m.Fx) { // not required - return nil - } - - if m.Fx != nil { - if err := m.Fx.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "fx") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateIntermediaryBank(formats strfmt.Registry) error { - - if swag.IsZero(m.IntermediaryBank) { // not required - return nil - } - - if m.IntermediaryBank != nil { - if err := m.IntermediaryBank.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "intermediary_bank") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validatePaymentAcceptanceDatetime(formats strfmt.Registry) error { - - if swag.IsZero(m.PaymentAcceptanceDatetime) { // not required - return nil - } - - if err := validate.FormatOf("attributes"+"."+"payment_acceptance_datetime", "body", "date-time", m.PaymentAcceptanceDatetime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentAttributes) validateProcessingDate(formats strfmt.Registry) error { - - if swag.IsZero(m.ProcessingDate) { // not required - return nil - } - - if err := validate.FormatOf("attributes"+"."+"processing_date", "body", "date", m.ProcessingDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentAttributes) validateReceiversCorrespondent(formats strfmt.Registry) error { - - if swag.IsZero(m.ReceiversCorrespondent) { // not required - return nil - } - - if m.ReceiversCorrespondent != nil { - if err := m.ReceiversCorrespondent.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "receivers_correspondent") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateReimbursement(formats strfmt.Registry) error { - - if swag.IsZero(m.Reimbursement) { // not required - return nil - } - - if m.Reimbursement != nil { - if err := m.Reimbursement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "reimbursement") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateSchemeProcessingDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SchemeProcessingDate) { // not required - return nil - } - - if err := validate.FormatOf("attributes"+"."+"scheme_processing_date", "body", "date", m.SchemeProcessingDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentAttributes) validateSendersCorrespondent(formats strfmt.Registry) error { - - if swag.IsZero(m.SendersCorrespondent) { // not required - return nil - } - - if m.SendersCorrespondent != nil { - if err := m.SendersCorrespondent.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "senders_correspondent") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateSettlement(formats strfmt.Registry) error { - - if swag.IsZero(m.Settlement) { // not required - return nil - } - - if m.Settlement != nil { - if err := m.Settlement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "settlement") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateStructuredReference(formats strfmt.Registry) error { - - if swag.IsZero(m.StructuredReference) { // not required - return nil - } - - if m.StructuredReference != nil { - if err := m.StructuredReference.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "structured_reference") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateSwift(formats strfmt.Registry) error { - - if swag.IsZero(m.Swift) { // not required - return nil - } - - if m.Swift != nil { - if err := m.Swift.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "swift") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateUltimateBeneficiary(formats strfmt.Registry) error { - - if swag.IsZero(m.UltimateBeneficiary) { // not required - return nil - } - - if m.UltimateBeneficiary != nil { - if err := m.UltimateBeneficiary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "ultimate_beneficiary") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateUltimateDebtor(formats strfmt.Registry) error { - - if swag.IsZero(m.UltimateDebtor) { // not required - return nil - } - - if m.UltimateDebtor != nil { - if err := m.UltimateDebtor.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "ultimate_debtor") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributes) validateUserDefinedData(formats strfmt.Registry) error { - - if swag.IsZero(m.UserDefinedData) { // not required - return nil - } - - iUserDefinedDataSize := int64(len(m.UserDefinedData)) - - if err := validate.MaxItems("attributes"+"."+"user_defined_data", "body", iUserDefinedDataSize, 5); err != nil { - return err - } - - for i := 0; i < len(m.UserDefinedData); i++ { - if swag.IsZero(m.UserDefinedData[i]) { // not required - continue - } - - if m.UserDefinedData[i] != nil { - if err := m.UserDefinedData[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "user_defined_data" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentAttributes) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentAttributes) UnmarshalBinary(b []byte) error { - var res PaymentAttributes - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *PaymentAttributes) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -} - -// PaymentAttributesBeneficiaryParty payment attributes beneficiary party -// swagger:model PaymentAttributesBeneficiaryParty -type PaymentAttributesBeneficiaryParty struct { - - // Name of beneficiary as given with account - AccountName string `json:"account_name,omitempty"` - - // Beneficiary account number - AccountNumber string `json:"account_number,omitempty"` - - // account number code - AccountNumberCode AccountNumberCode `json:"account_number_code,omitempty"` - - // The type of the account given with `beneficiary_party.account_number`. Single digit number. Only required if requested by the beneficiary party. Defaults to 0. - AccountType int64 `json:"account_type,omitempty"` - - // account with - AccountWith *BeneficiaryDebtorAccountHoldingEntity `json:"account_with,omitempty"` - - // Additional address line of the beneficiary address - AdditionalAddressLine string `json:"additional_address_line,omitempty"` - - // Beneficiary address - Address []string `json:"address,omitempty"` - - // Beneficiary birth city - BirthCity string `json:"birth_city,omitempty"` - - // Beneficiary birth country, ISO 3166 format country code - BirthCountry string `json:"birth_country,omitempty"` - - // Beneficiary birth date. Formatted according to ISO 8601 format: YYYY-MM-DD - // Format: date - BirthDate *strfmt.Date `json:"birth_date,omitempty"` - - // Beneficiary birth province - BirthProvince string `json:"birth_province,omitempty"` - - // Building number of the beneficiary address - BuildingNumber string `json:"building_number,omitempty"` - - // City/Town of the Beneficiary address - City string `json:"city,omitempty"` - - // Country of the beneficiary address, ISO 3166 format country code - Country string `json:"country,omitempty"` - - // Beneficiary name - Name string `json:"name,omitempty"` - - // Organisation identification of a beneficiary, used in the case that the beneficiary is an organisation and not a private person - OrganisationIdentification string `json:"organisation_identification,omitempty"` - - // The code that specifies the type of `organisation_identification` - OrganisationIdentificationCode string `json:"organisation_identification_code,omitempty"` - - // Issuer of the `organisation_identification` - OrganisationIdentificationIssuer string `json:"organisation_identification_issuer,omitempty"` - - // The code that specifies the scheme of `organisation_identification` - OrganisationIdentificationScheme string `json:"organisation_identification_scheme,omitempty"` - - // Post code of the beneficiary address - PostCode string `json:"post_code,omitempty"` - - // private identification - PrivateIdentification *PrivateIdentification `json:"private_identification,omitempty"` - - // Province of the beneficiary address - Province string `json:"province,omitempty"` - - // Street name of the beneficiary address - StreetName string `json:"street_name,omitempty"` - - // Beneficiary phone number - TelephoneNumber string `json:"telephone_number,omitempty"` -} - -func PaymentAttributesBeneficiaryPartyWithDefaults(defaults client.Defaults) *PaymentAttributesBeneficiaryParty { - return &PaymentAttributesBeneficiaryParty{ - - AccountName: defaults.GetString("PaymentAttributesBeneficiaryParty", "account_name"), - - AccountNumber: defaults.GetString("PaymentAttributesBeneficiaryParty", "account_number"), - - // TODO AccountNumberCode: AccountNumberCode, - - AccountType: defaults.GetInt64("PaymentAttributesBeneficiaryParty", "account_type"), - - AccountWith: BeneficiaryDebtorAccountHoldingEntityWithDefaults(defaults), - - AdditionalAddressLine: defaults.GetString("PaymentAttributesBeneficiaryParty", "additional_address_line"), - - Address: make([]string, 0), - - BirthCity: defaults.GetString("PaymentAttributesBeneficiaryParty", "birth_city"), - - BirthCountry: defaults.GetString("PaymentAttributesBeneficiaryParty", "birth_country"), - - BirthDate: defaults.GetStrfmtDatePtr("PaymentAttributesBeneficiaryParty", "birth_date"), - - BirthProvince: defaults.GetString("PaymentAttributesBeneficiaryParty", "birth_province"), - - BuildingNumber: defaults.GetString("PaymentAttributesBeneficiaryParty", "building_number"), - - City: defaults.GetString("PaymentAttributesBeneficiaryParty", "city"), - - Country: defaults.GetString("PaymentAttributesBeneficiaryParty", "country"), - - Name: defaults.GetString("PaymentAttributesBeneficiaryParty", "name"), - - OrganisationIdentification: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification"), - - OrganisationIdentificationCode: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification_code"), - - OrganisationIdentificationIssuer: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification_issuer"), - - OrganisationIdentificationScheme: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification_scheme"), - - PostCode: defaults.GetString("PaymentAttributesBeneficiaryParty", "post_code"), - - PrivateIdentification: PrivateIdentificationWithDefaults(defaults), - - Province: defaults.GetString("PaymentAttributesBeneficiaryParty", "province"), - - StreetName: defaults.GetString("PaymentAttributesBeneficiaryParty", "street_name"), - - TelephoneNumber: defaults.GetString("PaymentAttributesBeneficiaryParty", "telephone_number"), - } -} - -func (m *PaymentAttributesBeneficiaryParty) WithAccountName(accountName string) *PaymentAttributesBeneficiaryParty { - - m.AccountName = accountName - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithAccountNumber(accountNumber string) *PaymentAttributesBeneficiaryParty { - - m.AccountNumber = accountNumber - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithAccountNumberCode(accountNumberCode AccountNumberCode) *PaymentAttributesBeneficiaryParty { - - m.AccountNumberCode = accountNumberCode - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithAccountType(accountType int64) *PaymentAttributesBeneficiaryParty { - - m.AccountType = accountType - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithAccountWith(accountWith BeneficiaryDebtorAccountHoldingEntity) *PaymentAttributesBeneficiaryParty { - - m.AccountWith = &accountWith - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithoutAccountWith() *PaymentAttributesBeneficiaryParty { - m.AccountWith = nil - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithAdditionalAddressLine(additionalAddressLine string) *PaymentAttributesBeneficiaryParty { - - m.AdditionalAddressLine = additionalAddressLine - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithAddress(address []string) *PaymentAttributesBeneficiaryParty { - - m.Address = address - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithBirthCity(birthCity string) *PaymentAttributesBeneficiaryParty { - - m.BirthCity = birthCity - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithBirthCountry(birthCountry string) *PaymentAttributesBeneficiaryParty { - - m.BirthCountry = birthCountry - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithBirthDate(birthDate strfmt.Date) *PaymentAttributesBeneficiaryParty { - - m.BirthDate = &birthDate - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithoutBirthDate() *PaymentAttributesBeneficiaryParty { - m.BirthDate = nil - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithBirthProvince(birthProvince string) *PaymentAttributesBeneficiaryParty { - - m.BirthProvince = birthProvince - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithBuildingNumber(buildingNumber string) *PaymentAttributesBeneficiaryParty { - - m.BuildingNumber = buildingNumber - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithCity(city string) *PaymentAttributesBeneficiaryParty { - - m.City = city - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithCountry(country string) *PaymentAttributesBeneficiaryParty { - - m.Country = country - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithName(name string) *PaymentAttributesBeneficiaryParty { - - m.Name = name - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentification(organisationIdentification string) *PaymentAttributesBeneficiaryParty { - - m.OrganisationIdentification = organisationIdentification - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentificationCode(organisationIdentificationCode string) *PaymentAttributesBeneficiaryParty { - - m.OrganisationIdentificationCode = organisationIdentificationCode - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentificationIssuer(organisationIdentificationIssuer string) *PaymentAttributesBeneficiaryParty { - - m.OrganisationIdentificationIssuer = organisationIdentificationIssuer - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentificationScheme(organisationIdentificationScheme string) *PaymentAttributesBeneficiaryParty { - - m.OrganisationIdentificationScheme = organisationIdentificationScheme - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithPostCode(postCode string) *PaymentAttributesBeneficiaryParty { - - m.PostCode = postCode - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithPrivateIdentification(privateIdentification PrivateIdentification) *PaymentAttributesBeneficiaryParty { - - m.PrivateIdentification = &privateIdentification - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithoutPrivateIdentification() *PaymentAttributesBeneficiaryParty { - m.PrivateIdentification = nil - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithProvince(province string) *PaymentAttributesBeneficiaryParty { - - m.Province = province - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithStreetName(streetName string) *PaymentAttributesBeneficiaryParty { - - m.StreetName = streetName - - return m -} - -func (m *PaymentAttributesBeneficiaryParty) WithTelephoneNumber(telephoneNumber string) *PaymentAttributesBeneficiaryParty { - - m.TelephoneNumber = telephoneNumber - - return m -} - -// Validate validates this payment attributes beneficiary party -func (m *PaymentAttributesBeneficiaryParty) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccountNumberCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAccountWith(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBirthDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrivateIdentification(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentAttributesBeneficiaryParty) validateAccountNumberCode(formats strfmt.Registry) error { - - if swag.IsZero(m.AccountNumberCode) { // not required - return nil - } - - if err := m.AccountNumberCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "beneficiary_party" + "." + "account_number_code") - } - return err - } - - return nil -} - -func (m *PaymentAttributesBeneficiaryParty) validateAccountWith(formats strfmt.Registry) error { - - if swag.IsZero(m.AccountWith) { // not required - return nil - } - - if m.AccountWith != nil { - if err := m.AccountWith.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "beneficiary_party" + "." + "account_with") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributesBeneficiaryParty) validateBirthDate(formats strfmt.Registry) error { - - if swag.IsZero(m.BirthDate) { // not required - return nil - } - - if err := validate.FormatOf("attributes"+"."+"beneficiary_party"+"."+"birth_date", "body", "date", m.BirthDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentAttributesBeneficiaryParty) validatePrivateIdentification(formats strfmt.Registry) error { - - if swag.IsZero(m.PrivateIdentification) { // not required - return nil - } - - if m.PrivateIdentification != nil { - if err := m.PrivateIdentification.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "beneficiary_party" + "." + "private_identification") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentAttributesBeneficiaryParty) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentAttributesBeneficiaryParty) UnmarshalBinary(b []byte) error { - var res PaymentAttributesBeneficiaryParty - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *PaymentAttributesBeneficiaryParty) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -} - -// PaymentAttributesDebtorParty payment attributes debtor party -// swagger:model PaymentAttributesDebtorParty -type PaymentAttributesDebtorParty struct { - - // Name of debtor as given with account - AccountName string `json:"account_name,omitempty"` - - // Debtor account number. Allows upper case and numeric characters. - AccountNumber string `json:"account_number,omitempty"` - - // account number code - AccountNumberCode AccountNumberCode `json:"account_number_code,omitempty"` - - // account with - AccountWith *BeneficiaryDebtorAccountHoldingEntity `json:"account_with,omitempty"` - - // Additional address line of the Debtor address - AdditionalAddressLine string `json:"additional_address_line,omitempty"` - - // Debtor address - Address []string `json:"address,omitempty"` - - // Debtor birth city - BirthCity string `json:"birth_city,omitempty"` - - // Debtor birth country. ISO 3166 format country code - BirthCountry string `json:"birth_country,omitempty"` - - // Debtor birth date. Formatted according to ISO 8601 format: YYYY-MM-DD - // Format: date - BirthDate *strfmt.Date `json:"birth_date,omitempty"` - - // Debtor birth province - BirthProvince string `json:"birth_province,omitempty"` - - // Building number of the Debtor address - BuildingNumber string `json:"building_number,omitempty"` - - // City/Town of the Debtor address - City string `json:"city,omitempty"` - - // Country of debtor address. ISO 3166 format country code" - Country string `json:"country,omitempty"` - - // SWIFT BIC for ordering customer, either BIC8 or BIC11 - CustomerID string `json:"customer_id,omitempty"` - - // Code for `customer_id` - CustomerIDCode string `json:"customer_id_code,omitempty"` - - // Debtor name - Name string `json:"name,omitempty"` - - // Organisation identification of a debtor, in the case that the debtor is an organisation and not a private person - OrganisationIdentification string `json:"organisation_identification,omitempty"` - - // The code that specifies the type of `organisation_identification` - OrganisationIdentificationCode string `json:"organisation_identification_code,omitempty"` - - // Issuer of the `organisation_identification` - OrganisationIdentificationIssuer string `json:"organisation_identification_issuer,omitempty"` - - // The code that specifies the scheme of `organisation_identification` - OrganisationIdentificationScheme string `json:"organisation_identification_scheme,omitempty"` - - // Post code of the Debtor address - PostCode string `json:"post_code,omitempty"` - - // private identification - PrivateIdentification *PrivateIdentification `json:"private_identification,omitempty"` - - // Province of the Debtor address - Province string `json:"province,omitempty"` - - // Street name of the Debtor address - StreetName string `json:"street_name,omitempty"` -} - -func PaymentAttributesDebtorPartyWithDefaults(defaults client.Defaults) *PaymentAttributesDebtorParty { - return &PaymentAttributesDebtorParty{ - - AccountName: defaults.GetString("PaymentAttributesDebtorParty", "account_name"), - - AccountNumber: defaults.GetString("PaymentAttributesDebtorParty", "account_number"), - - // TODO AccountNumberCode: AccountNumberCode, - - AccountWith: BeneficiaryDebtorAccountHoldingEntityWithDefaults(defaults), - - AdditionalAddressLine: defaults.GetString("PaymentAttributesDebtorParty", "additional_address_line"), - - Address: make([]string, 0), - - BirthCity: defaults.GetString("PaymentAttributesDebtorParty", "birth_city"), - - BirthCountry: defaults.GetString("PaymentAttributesDebtorParty", "birth_country"), - - BirthDate: defaults.GetStrfmtDatePtr("PaymentAttributesDebtorParty", "birth_date"), - - BirthProvince: defaults.GetString("PaymentAttributesDebtorParty", "birth_province"), - - BuildingNumber: defaults.GetString("PaymentAttributesDebtorParty", "building_number"), - - City: defaults.GetString("PaymentAttributesDebtorParty", "city"), - - Country: defaults.GetString("PaymentAttributesDebtorParty", "country"), - - CustomerID: defaults.GetString("PaymentAttributesDebtorParty", "customer_id"), - - CustomerIDCode: defaults.GetString("PaymentAttributesDebtorParty", "customer_id_code"), - - Name: defaults.GetString("PaymentAttributesDebtorParty", "name"), - - OrganisationIdentification: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification"), - - OrganisationIdentificationCode: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification_code"), - - OrganisationIdentificationIssuer: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification_issuer"), - - OrganisationIdentificationScheme: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification_scheme"), - - PostCode: defaults.GetString("PaymentAttributesDebtorParty", "post_code"), - - PrivateIdentification: PrivateIdentificationWithDefaults(defaults), - - Province: defaults.GetString("PaymentAttributesDebtorParty", "province"), - - StreetName: defaults.GetString("PaymentAttributesDebtorParty", "street_name"), - } -} - -func (m *PaymentAttributesDebtorParty) WithAccountName(accountName string) *PaymentAttributesDebtorParty { - - m.AccountName = accountName - - return m -} - -func (m *PaymentAttributesDebtorParty) WithAccountNumber(accountNumber string) *PaymentAttributesDebtorParty { - - m.AccountNumber = accountNumber - - return m -} - -func (m *PaymentAttributesDebtorParty) WithAccountNumberCode(accountNumberCode AccountNumberCode) *PaymentAttributesDebtorParty { - - m.AccountNumberCode = accountNumberCode - - return m -} - -func (m *PaymentAttributesDebtorParty) WithAccountWith(accountWith BeneficiaryDebtorAccountHoldingEntity) *PaymentAttributesDebtorParty { - - m.AccountWith = &accountWith - - return m -} - -func (m *PaymentAttributesDebtorParty) WithoutAccountWith() *PaymentAttributesDebtorParty { - m.AccountWith = nil - return m -} - -func (m *PaymentAttributesDebtorParty) WithAdditionalAddressLine(additionalAddressLine string) *PaymentAttributesDebtorParty { - - m.AdditionalAddressLine = additionalAddressLine - - return m -} - -func (m *PaymentAttributesDebtorParty) WithAddress(address []string) *PaymentAttributesDebtorParty { - - m.Address = address - - return m -} - -func (m *PaymentAttributesDebtorParty) WithBirthCity(birthCity string) *PaymentAttributesDebtorParty { - - m.BirthCity = birthCity - - return m -} - -func (m *PaymentAttributesDebtorParty) WithBirthCountry(birthCountry string) *PaymentAttributesDebtorParty { - - m.BirthCountry = birthCountry - - return m -} - -func (m *PaymentAttributesDebtorParty) WithBirthDate(birthDate strfmt.Date) *PaymentAttributesDebtorParty { - - m.BirthDate = &birthDate - - return m -} - -func (m *PaymentAttributesDebtorParty) WithoutBirthDate() *PaymentAttributesDebtorParty { - m.BirthDate = nil - return m -} - -func (m *PaymentAttributesDebtorParty) WithBirthProvince(birthProvince string) *PaymentAttributesDebtorParty { - - m.BirthProvince = birthProvince - - return m -} - -func (m *PaymentAttributesDebtorParty) WithBuildingNumber(buildingNumber string) *PaymentAttributesDebtorParty { - - m.BuildingNumber = buildingNumber - - return m -} - -func (m *PaymentAttributesDebtorParty) WithCity(city string) *PaymentAttributesDebtorParty { - - m.City = city - - return m -} - -func (m *PaymentAttributesDebtorParty) WithCountry(country string) *PaymentAttributesDebtorParty { - - m.Country = country - - return m -} - -func (m *PaymentAttributesDebtorParty) WithCustomerID(customerID string) *PaymentAttributesDebtorParty { - - m.CustomerID = customerID - - return m -} - -func (m *PaymentAttributesDebtorParty) WithCustomerIDCode(customerIDCode string) *PaymentAttributesDebtorParty { - - m.CustomerIDCode = customerIDCode - - return m -} - -func (m *PaymentAttributesDebtorParty) WithName(name string) *PaymentAttributesDebtorParty { - - m.Name = name - - return m -} - -func (m *PaymentAttributesDebtorParty) WithOrganisationIdentification(organisationIdentification string) *PaymentAttributesDebtorParty { - - m.OrganisationIdentification = organisationIdentification - - return m -} - -func (m *PaymentAttributesDebtorParty) WithOrganisationIdentificationCode(organisationIdentificationCode string) *PaymentAttributesDebtorParty { - - m.OrganisationIdentificationCode = organisationIdentificationCode - - return m -} - -func (m *PaymentAttributesDebtorParty) WithOrganisationIdentificationIssuer(organisationIdentificationIssuer string) *PaymentAttributesDebtorParty { - - m.OrganisationIdentificationIssuer = organisationIdentificationIssuer - - return m -} - -func (m *PaymentAttributesDebtorParty) WithOrganisationIdentificationScheme(organisationIdentificationScheme string) *PaymentAttributesDebtorParty { - - m.OrganisationIdentificationScheme = organisationIdentificationScheme - - return m -} - -func (m *PaymentAttributesDebtorParty) WithPostCode(postCode string) *PaymentAttributesDebtorParty { - - m.PostCode = postCode - - return m -} - -func (m *PaymentAttributesDebtorParty) WithPrivateIdentification(privateIdentification PrivateIdentification) *PaymentAttributesDebtorParty { - - m.PrivateIdentification = &privateIdentification - - return m -} - -func (m *PaymentAttributesDebtorParty) WithoutPrivateIdentification() *PaymentAttributesDebtorParty { - m.PrivateIdentification = nil - return m -} - -func (m *PaymentAttributesDebtorParty) WithProvince(province string) *PaymentAttributesDebtorParty { - - m.Province = province - - return m -} - -func (m *PaymentAttributesDebtorParty) WithStreetName(streetName string) *PaymentAttributesDebtorParty { - - m.StreetName = streetName - - return m -} - -// Validate validates this payment attributes debtor party -func (m *PaymentAttributesDebtorParty) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccountNumberCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAccountWith(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBirthDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrivateIdentification(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentAttributesDebtorParty) validateAccountNumberCode(formats strfmt.Registry) error { - - if swag.IsZero(m.AccountNumberCode) { // not required - return nil - } - - if err := m.AccountNumberCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "debtor_party" + "." + "account_number_code") - } - return err - } - - return nil -} - -func (m *PaymentAttributesDebtorParty) validateAccountWith(formats strfmt.Registry) error { - - if swag.IsZero(m.AccountWith) { // not required - return nil - } - - if m.AccountWith != nil { - if err := m.AccountWith.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "debtor_party" + "." + "account_with") - } - return err - } - } - - return nil -} - -func (m *PaymentAttributesDebtorParty) validateBirthDate(formats strfmt.Registry) error { - - if swag.IsZero(m.BirthDate) { // not required - return nil - } - - if err := validate.FormatOf("attributes"+"."+"debtor_party"+"."+"birth_date", "body", "date", m.BirthDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentAttributesDebtorParty) validatePrivateIdentification(formats strfmt.Registry) error { - - if swag.IsZero(m.PrivateIdentification) { // not required - return nil - } - - if m.PrivateIdentification != nil { - if err := m.PrivateIdentification.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "debtor_party" + "." + "private_identification") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentAttributesDebtorParty) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentAttributesDebtorParty) UnmarshalBinary(b []byte) error { - var res PaymentAttributesDebtorParty - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *PaymentAttributesDebtorParty) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -} - -// PaymentAttributesFx payment attributes fx -// swagger:model PaymentAttributesFx -type PaymentAttributesFx struct { - - // Reference to the foreign exchange contract associated with the transaction - ContractReference string `json:"contract_reference,omitempty"` - - // Factor used to convert an amount from the instructed currency into the transaction currency: i.e. to convert the `fx.original_amount`, expressed in the `fx.original_currency`, to `amount` specified in `currency`. Decimal value, represented as a string, maximum length 12. Must be > 0. - ExchangeRate string `json:"exchange_rate,omitempty"` - - // Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as instructed by the initiating party. Decimal value. Must be > 0. - OriginalAmount string `json:"original_amount,omitempty"` - - // Currency of `original_amount`. Currency code as defined in ISO 4217. - OriginalCurrency string `json:"original_currency,omitempty"` -} - -func PaymentAttributesFxWithDefaults(defaults client.Defaults) *PaymentAttributesFx { - return &PaymentAttributesFx{ - - ContractReference: defaults.GetString("PaymentAttributesFx", "contract_reference"), - - ExchangeRate: defaults.GetString("PaymentAttributesFx", "exchange_rate"), - - OriginalAmount: defaults.GetString("PaymentAttributesFx", "original_amount"), - - OriginalCurrency: defaults.GetString("PaymentAttributesFx", "original_currency"), - } -} - -func (m *PaymentAttributesFx) WithContractReference(contractReference string) *PaymentAttributesFx { - - m.ContractReference = contractReference - - return m -} - -func (m *PaymentAttributesFx) WithExchangeRate(exchangeRate string) *PaymentAttributesFx { - - m.ExchangeRate = exchangeRate - - return m -} - -func (m *PaymentAttributesFx) WithOriginalAmount(originalAmount string) *PaymentAttributesFx { - - m.OriginalAmount = originalAmount - - return m -} - -func (m *PaymentAttributesFx) WithOriginalCurrency(originalCurrency string) *PaymentAttributesFx { - - m.OriginalCurrency = originalCurrency - - return m -} - -// Validate validates this payment attributes fx -func (m *PaymentAttributesFx) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentAttributesFx) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentAttributesFx) UnmarshalBinary(b []byte) error { - var res PaymentAttributesFx - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *PaymentAttributesFx) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -} - -// PaymentAttributesStructuredReference payment attributes structured reference -// swagger:model PaymentAttributesStructuredReference -type PaymentAttributesStructuredReference struct { - - // Issuer of remittance reference - Issuer string `json:"issuer,omitempty"` - - // Unique reference to unambiguously refer to the payment originated by the creditor, this reference enables reconciliation by the creditor upon receipt of the amount of money. - Reference string `json:"reference,omitempty"` -} - -func PaymentAttributesStructuredReferenceWithDefaults(defaults client.Defaults) *PaymentAttributesStructuredReference { - return &PaymentAttributesStructuredReference{ - - Issuer: defaults.GetString("PaymentAttributesStructuredReference", "issuer"), - - Reference: defaults.GetString("PaymentAttributesStructuredReference", "reference"), - } -} - -func (m *PaymentAttributesStructuredReference) WithIssuer(issuer string) *PaymentAttributesStructuredReference { - - m.Issuer = issuer - - return m -} - -func (m *PaymentAttributesStructuredReference) WithReference(reference string) *PaymentAttributesStructuredReference { - - m.Reference = reference - - return m -} - -// Validate validates this payment attributes structured reference -func (m *PaymentAttributesStructuredReference) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentAttributesStructuredReference) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentAttributesStructuredReference) UnmarshalBinary(b []byte) error { - var res PaymentAttributesStructuredReference - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *PaymentAttributesStructuredReference) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -} - -// PaymentAttributesSwift payment attributes swift -// swagger:model PaymentAttributesSwift -type PaymentAttributesSwift struct { - - // SWIFT service level - BankOperationCode string `json:"bank_operation_code,omitempty"` - - // header - Header *PaymentAttributesSwiftHeader `json:"header,omitempty"` - - // A SWIFT instruction code - InstructionCode string `json:"instruction_code,omitempty"` - - // This field specifies additional information for the Receiver or other party specified. - SenderReceiverInformation string `json:"sender_receiver_information,omitempty"` - - // This repetitive field specifies one or several time indication(s) related to the processing of the payment instruction. - TimeIndication string `json:"time_indication,omitempty"` -} - -func PaymentAttributesSwiftWithDefaults(defaults client.Defaults) *PaymentAttributesSwift { - return &PaymentAttributesSwift{ - - BankOperationCode: defaults.GetString("PaymentAttributesSwift", "bank_operation_code"), - - Header: PaymentAttributesSwiftHeaderWithDefaults(defaults), - - InstructionCode: defaults.GetString("PaymentAttributesSwift", "instruction_code"), - - SenderReceiverInformation: defaults.GetString("PaymentAttributesSwift", "sender_receiver_information"), - - TimeIndication: defaults.GetString("PaymentAttributesSwift", "time_indication"), - } -} - -func (m *PaymentAttributesSwift) WithBankOperationCode(bankOperationCode string) *PaymentAttributesSwift { - - m.BankOperationCode = bankOperationCode - - return m -} - -func (m *PaymentAttributesSwift) WithHeader(header PaymentAttributesSwiftHeader) *PaymentAttributesSwift { - - m.Header = &header - - return m -} - -func (m *PaymentAttributesSwift) WithoutHeader() *PaymentAttributesSwift { - m.Header = nil - return m -} - -func (m *PaymentAttributesSwift) WithInstructionCode(instructionCode string) *PaymentAttributesSwift { - - m.InstructionCode = instructionCode - - return m -} - -func (m *PaymentAttributesSwift) WithSenderReceiverInformation(senderReceiverInformation string) *PaymentAttributesSwift { - - m.SenderReceiverInformation = senderReceiverInformation - - return m -} - -func (m *PaymentAttributesSwift) WithTimeIndication(timeIndication string) *PaymentAttributesSwift { - - m.TimeIndication = timeIndication - - return m -} - -// Validate validates this payment attributes swift -func (m *PaymentAttributesSwift) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHeader(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentAttributesSwift) validateHeader(formats strfmt.Registry) error { - - if swag.IsZero(m.Header) { // not required - return nil - } - - if m.Header != nil { - if err := m.Header.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("attributes" + "." + "swift" + "." + "header") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentAttributesSwift) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentAttributesSwift) UnmarshalBinary(b []byte) error { - var res PaymentAttributesSwift - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *PaymentAttributesSwift) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -} - -// PaymentAttributesSwiftHeader payment attributes swift header -// swagger:model PaymentAttributesSwiftHeader -type PaymentAttributesSwiftHeader struct { - - // Destination SWIFT logical terminal address. Complete 12-character SWIFT destination, including BIC (x8), logical terminal code (x1) and branch code (x). - Destination string `json:"destination,omitempty"` - - // The message type of the SWIFT payment, has to match `[A-Z]{2}[0-9]{3}`. Currently `MT103` is the only supported value - MessageType string `json:"message_type,omitempty"` - - // SWIFT priority. Either `Normal` or `Priority`. - Priority string `json:"priority,omitempty"` - - // The destination SWIFT BIC for SWIFT MT messages being sent by Form3 client to SWIFT. Formatted as BIC8 or BIC11. - Recipient string `json:"recipient,omitempty"` - - // The source SWIFT BIC for SWIFT MT messages being received by Form3 client from SWIFT. Formatted as BIC8 or BIC11. - Source string `json:"source,omitempty"` - - // Message User Reference (MUR) value, which can be up to 16 characters, and will be returned in the ACK - UserReference string `json:"user_reference,omitempty"` -} - -func PaymentAttributesSwiftHeaderWithDefaults(defaults client.Defaults) *PaymentAttributesSwiftHeader { - return &PaymentAttributesSwiftHeader{ - - Destination: defaults.GetString("PaymentAttributesSwiftHeader", "destination"), - - MessageType: defaults.GetString("PaymentAttributesSwiftHeader", "message_type"), - - Priority: defaults.GetString("PaymentAttributesSwiftHeader", "priority"), - - Recipient: defaults.GetString("PaymentAttributesSwiftHeader", "recipient"), - - Source: defaults.GetString("PaymentAttributesSwiftHeader", "source"), - - UserReference: defaults.GetString("PaymentAttributesSwiftHeader", "user_reference"), - } -} - -func (m *PaymentAttributesSwiftHeader) WithDestination(destination string) *PaymentAttributesSwiftHeader { - - m.Destination = destination - - return m -} - -func (m *PaymentAttributesSwiftHeader) WithMessageType(messageType string) *PaymentAttributesSwiftHeader { - - m.MessageType = messageType - - return m -} - -func (m *PaymentAttributesSwiftHeader) WithPriority(priority string) *PaymentAttributesSwiftHeader { - - m.Priority = priority - - return m -} - -func (m *PaymentAttributesSwiftHeader) WithRecipient(recipient string) *PaymentAttributesSwiftHeader { - - m.Recipient = recipient - - return m -} - -func (m *PaymentAttributesSwiftHeader) WithSource(source string) *PaymentAttributesSwiftHeader { - - m.Source = source - - return m -} - -func (m *PaymentAttributesSwiftHeader) WithUserReference(userReference string) *PaymentAttributesSwiftHeader { - - m.UserReference = userReference - - return m -} - -// Validate validates this payment attributes swift header -func (m *PaymentAttributesSwiftHeader) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentAttributesSwiftHeader) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentAttributesSwiftHeader) UnmarshalBinary(b []byte) error { - var res PaymentAttributesSwiftHeader - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *PaymentAttributesSwiftHeader) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -} diff --git a/pkg/generated/models/payment_admission_task_name.go b/pkg/generated/models/payment_admission_task_name.go index cfaa4329..48990b04 100644 --- a/pkg/generated/models/payment_admission_task_name.go +++ b/pkg/generated/models/payment_admission_task_name.go @@ -10,65 +10,16 @@ import ( "log" strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/validate" ) // PaymentAdmissionTaskName Identifies the payment admission task to be executed // swagger:model PaymentAdmissionTaskName type PaymentAdmissionTaskName string -const ( - - // PaymentAdmissionTaskNameCustomerCheck captures enum value "customer_check" - PaymentAdmissionTaskNameCustomerCheck PaymentAdmissionTaskName = "customer_check" - - // PaymentAdmissionTaskNameAccountCheck captures enum value "account_check" - PaymentAdmissionTaskNameAccountCheck PaymentAdmissionTaskName = "account_check" - - // PaymentAdmissionTaskNameConfirmToScheme captures enum value "confirm_to_scheme" - PaymentAdmissionTaskNameConfirmToScheme PaymentAdmissionTaskName = "confirm_to_scheme" - - // PaymentAdmissionTaskNameRejectToScheme captures enum value "reject_to_scheme" - PaymentAdmissionTaskNameRejectToScheme PaymentAdmissionTaskName = "reject_to_scheme" -) - -// for schema -var paymentAdmissionTaskNameEnum []interface{} - -func init() { - var res []PaymentAdmissionTaskName - if err := json.Unmarshal([]byte(`["customer_check","account_check","confirm_to_scheme","reject_to_scheme"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentAdmissionTaskNameEnum = append(paymentAdmissionTaskNameEnum, v) - } -} - -func (m PaymentAdmissionTaskName) validatePaymentAdmissionTaskNameEnum(path, location string, value PaymentAdmissionTaskName) error { - if err := validate.Enum(path, location, value, paymentAdmissionTaskNameEnum); err != nil { - return err - } - return nil -} - // Validate validates this payment admission task name func (m PaymentAdmissionTaskName) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentAdmissionTaskNameEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } - func (m *PaymentAdmissionTaskName) Json() string { json, err := json.MarshalIndent(m, " ", " ") if err != nil { diff --git a/pkg/generated/models/payment_admission_task_status.go b/pkg/generated/models/payment_admission_task_status.go index deec862d..0b7bb7cb 100644 --- a/pkg/generated/models/payment_admission_task_status.go +++ b/pkg/generated/models/payment_admission_task_status.go @@ -29,6 +29,9 @@ const ( // PaymentAdmissionTaskStatusPending captures enum value "pending" PaymentAdmissionTaskStatusPending PaymentAdmissionTaskStatus = "pending" + + // PaymentAdmissionTaskStatusOnHold captures enum value "on_hold" + PaymentAdmissionTaskStatusOnHold PaymentAdmissionTaskStatus = "on_hold" ) // for schema @@ -36,7 +39,7 @@ var paymentAdmissionTaskStatusEnum []interface{} func init() { var res []PaymentAdmissionTaskStatus - if err := json.Unmarshal([]byte(`["completed","failed","pending"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["completed","failed","pending","on_hold"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/generated/models/payment_admission_update_relationships.go b/pkg/generated/models/payment_admission_update_relationships.go new file mode 100644 index 00000000..72233d31 --- /dev/null +++ b/pkg/generated/models/payment_admission_update_relationships.go @@ -0,0 +1,104 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// PaymentAdmissionUpdateRelationships payment admission update relationships +// swagger:model PaymentAdmissionUpdateRelationships +type PaymentAdmissionUpdateRelationships struct { + + // payment admission tasks + PaymentAdmissionTasks []*PaymentAdmissionTask `json:"payment_admission_tasks"` +} + +func PaymentAdmissionUpdateRelationshipsWithDefaults(defaults client.Defaults) *PaymentAdmissionUpdateRelationships { + return &PaymentAdmissionUpdateRelationships{ + + PaymentAdmissionTasks: make([]*PaymentAdmissionTask, 0), + } +} + +func (m *PaymentAdmissionUpdateRelationships) WithPaymentAdmissionTasks(paymentAdmissionTasks []*PaymentAdmissionTask) *PaymentAdmissionUpdateRelationships { + + m.PaymentAdmissionTasks = paymentAdmissionTasks + + return m +} + +// Validate validates this payment admission update relationships +func (m *PaymentAdmissionUpdateRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePaymentAdmissionTasks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentAdmissionUpdateRelationships) validatePaymentAdmissionTasks(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentAdmissionTasks) { // not required + return nil + } + + for i := 0; i < len(m.PaymentAdmissionTasks); i++ { + if swag.IsZero(m.PaymentAdmissionTasks[i]) { // not required + continue + } + + if m.PaymentAdmissionTasks[i] != nil { + if err := m.PaymentAdmissionTasks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_admission_tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAdmissionUpdateRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAdmissionUpdateRelationships) UnmarshalBinary(b []byte) error { + var res PaymentAdmissionUpdateRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAdmissionUpdateRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_attributes.go b/pkg/generated/models/payment_attributes.go new file mode 100644 index 00000000..7423222d --- /dev/null +++ b/pkg/generated/models/payment_attributes.go @@ -0,0 +1,2315 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentAttributes payment attributes +// swagger:model PaymentAttributes +type PaymentAttributes struct { + + // Block to represent a Financial Institution/agent in the payment chain + Agents []*Agent `json:"agents,omitempty"` + + // Amount of money moved between the instructing agent and instructed agent + // Pattern: ^[0-9.]{0,20}$ + Amount string `json:"amount,omitempty"` + + // batch booking indicator + BatchBookingIndicator string `json:"batch_booking_indicator,omitempty"` + + // batch id + BatchID string `json:"batch_id,omitempty"` + + // batch type + BatchType string `json:"batch_type,omitempty"` + + // beneficiary party + BeneficiaryParty *PaymentAttributesBeneficiaryParty `json:"beneficiary_party,omitempty"` + + // Category purpose in proprietary form. Specifies the high level purpose of the instruction. Cannot be used at the same time as `category_purpose_coded`. + CategoryPurpose string `json:"category_purpose,omitempty"` + + // Category purpose in a coded form. Specifies the high level purpose of the instruction. Cannot be used at the same time as `category_purpose`. + CategoryPurposeCoded string `json:"category_purpose_coded,omitempty"` + + // charges information + ChargesInformation *ChargesInformation `json:"charges_information,omitempty"` + + // Unique identifier for organisations collecting payments + ClearingID string `json:"clearing_id,omitempty"` + + // Currency of the transaction amount. Currency code as defined in [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm) + Currency string `json:"currency,omitempty"` + + // debtor party + DebtorParty *PaymentAttributesDebtorParty `json:"debtor_party,omitempty"` + + // Unique identification, as assigned by the initiating party, to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain. + EndToEndReference string `json:"end_to_end_reference,omitempty"` + + // file number + FileNumber string `json:"file_number,omitempty"` + + // fx + Fx *PaymentAttributesFx `json:"fx,omitempty"` + + // Unique identification, as assigned by the initiating party to unambiguously identify the transaction. This identification is an point-to-point reference and is passed on, unchanged, throughout the entire chain. Cannot include leading, trailing or internal spaces. + InstructionID string `json:"instruction_id,omitempty"` + + // intermediary bank + IntermediaryBank *IntermediaryBankAccountHoldingEntity `json:"intermediary_bank,omitempty"` + + // Numeric reference field, see scheme specific descriptions for usage + NumericReference string `json:"numeric_reference,omitempty"` + + // Timestamp of when the payment instruction meets the set processing conditions. Format: YYYY-MM-DDThh:mm:ss:mmm+hh:mm + // Format: date-time + PaymentAcceptanceDatetime *strfmt.DateTime `json:"payment_acceptance_datetime,omitempty"` + + // Purpose of the payment in a proprietary form + PaymentPurpose string `json:"payment_purpose,omitempty"` + + // Purpose of the payment in a coded form + PaymentPurposeCoded string `json:"payment_purpose_coded,omitempty"` + + // Clearing infrastructure through which the payment instruction is to be processed. Default for given organisation ID is used if left empty. Has to be a valid [scheme identifier](http://draft-api-docs.form3.tech/api.html#enumerations-schemes). + PaymentScheme string `json:"payment_scheme,omitempty"` + + // payment type + PaymentType string `json:"payment_type,omitempty"` + + // Date on which the payment is to be debited from the debtor account. Formatted according to ISO 8601 format: YYYY-MM-DD. + // Format: date + ProcessingDate *strfmt.Date `json:"processing_date,omitempty"` + + // receivers correspondent + ReceiversCorrespondent *ReceiversCorrespondentAccountHoldingEntity `json:"receivers_correspondent,omitempty"` + + // Payment reference for beneficiary use + Reference string `json:"reference,omitempty"` + + // Regulatory reporting information + RegulatoryReporting string `json:"regulatory_reporting,omitempty"` + + // reimbursement + Reimbursement *ReimbursementAccountHoldingEntity `json:"reimbursement,omitempty"` + + // Information supplied to enable the matching of an entry with the items that the transfer is intended to settle, such as commercial invoices in an accounts receivable system provided by the debtor for the beneficiary. + RemittanceInformation string `json:"remittance_information,omitempty"` + + // The scheme specific payment [sub type](http://api-docs.form3.tech/api.html#enumerations-scheme-specific-payment-sub-types) + SchemePaymentSubType string `json:"scheme_payment_sub_type,omitempty"` + + // The [scheme-specific payment type](#enumerations-scheme-payment-types) + SchemePaymentType string `json:"scheme_payment_type,omitempty"` + + // Date on which the payment is processed by the scheme. Only used if different from `processing_date`. + // Format: date + SchemeProcessingDate *strfmt.Date `json:"scheme_processing_date,omitempty"` + + // Unique identification, as assigned by the first instructing agent, to unambiguously identify the transaction that is passed on, unchanged, throughout the entire interbank chain. + SchemeTransactionID string `json:"scheme_transaction_id,omitempty"` + + // senders correspondent + SendersCorrespondent *SendersCorrespondentAccountHoldingEntity `json:"senders_correspondent,omitempty"` + + // settlement + Settlement *Settlement `json:"settlement,omitempty"` + + // structured reference + StructuredReference *PaymentAttributesStructuredReference `json:"structured_reference,omitempty"` + + // swift + Swift *PaymentAttributesSwift `json:"swift,omitempty"` + + // ultimate beneficiary + UltimateBeneficiary *UltimateEntity `json:"ultimate_beneficiary,omitempty"` + + // ultimate debtor + UltimateDebtor *UltimateEntity `json:"ultimate_debtor,omitempty"` + + // The scheme-specific unique transaction ID. Populated by the scheme. + UniqueSchemeID string `json:"unique_scheme_id,omitempty"` + + // All purpose list of key-value pairs specific data stored on the payment. + // Max Items: 5 + UserDefinedData []*UserDefinedData `json:"user_defined_data"` +} + +func PaymentAttributesWithDefaults(defaults client.Defaults) *PaymentAttributes { + return &PaymentAttributes{ + + Agents: make([]*Agent, 0), + + Amount: defaults.GetString("PaymentAttributes", "amount"), + + BatchBookingIndicator: defaults.GetString("PaymentAttributes", "batch_booking_indicator"), + + BatchID: defaults.GetString("PaymentAttributes", "batch_id"), + + BatchType: defaults.GetString("PaymentAttributes", "batch_type"), + + BeneficiaryParty: PaymentAttributesBeneficiaryPartyWithDefaults(defaults), + + CategoryPurpose: defaults.GetString("PaymentAttributes", "category_purpose"), + + CategoryPurposeCoded: defaults.GetString("PaymentAttributes", "category_purpose_coded"), + + ChargesInformation: ChargesInformationWithDefaults(defaults), + + ClearingID: defaults.GetString("PaymentAttributes", "clearing_id"), + + Currency: defaults.GetString("PaymentAttributes", "currency"), + + DebtorParty: PaymentAttributesDebtorPartyWithDefaults(defaults), + + EndToEndReference: defaults.GetString("PaymentAttributes", "end_to_end_reference"), + + FileNumber: defaults.GetString("PaymentAttributes", "file_number"), + + Fx: PaymentAttributesFxWithDefaults(defaults), + + InstructionID: defaults.GetString("PaymentAttributes", "instruction_id"), + + IntermediaryBank: IntermediaryBankAccountHoldingEntityWithDefaults(defaults), + + NumericReference: defaults.GetString("PaymentAttributes", "numeric_reference"), + + PaymentAcceptanceDatetime: defaults.GetStrfmtDateTimePtr("PaymentAttributes", "payment_acceptance_datetime"), + + PaymentPurpose: defaults.GetString("PaymentAttributes", "payment_purpose"), + + PaymentPurposeCoded: defaults.GetString("PaymentAttributes", "payment_purpose_coded"), + + PaymentScheme: defaults.GetString("PaymentAttributes", "payment_scheme"), + + PaymentType: defaults.GetString("PaymentAttributes", "payment_type"), + + ProcessingDate: defaults.GetStrfmtDatePtr("PaymentAttributes", "processing_date"), + + ReceiversCorrespondent: ReceiversCorrespondentAccountHoldingEntityWithDefaults(defaults), + + Reference: defaults.GetString("PaymentAttributes", "reference"), + + RegulatoryReporting: defaults.GetString("PaymentAttributes", "regulatory_reporting"), + + Reimbursement: ReimbursementAccountHoldingEntityWithDefaults(defaults), + + RemittanceInformation: defaults.GetString("PaymentAttributes", "remittance_information"), + + SchemePaymentSubType: defaults.GetString("PaymentAttributes", "scheme_payment_sub_type"), + + SchemePaymentType: defaults.GetString("PaymentAttributes", "scheme_payment_type"), + + SchemeProcessingDate: defaults.GetStrfmtDatePtr("PaymentAttributes", "scheme_processing_date"), + + SchemeTransactionID: defaults.GetString("PaymentAttributes", "scheme_transaction_id"), + + SendersCorrespondent: SendersCorrespondentAccountHoldingEntityWithDefaults(defaults), + + Settlement: SettlementWithDefaults(defaults), + + StructuredReference: PaymentAttributesStructuredReferenceWithDefaults(defaults), + + Swift: PaymentAttributesSwiftWithDefaults(defaults), + + UltimateBeneficiary: UltimateEntityWithDefaults(defaults), + + UltimateDebtor: UltimateEntityWithDefaults(defaults), + + UniqueSchemeID: defaults.GetString("PaymentAttributes", "unique_scheme_id"), + + UserDefinedData: make([]*UserDefinedData, 0), + } +} + +func (m *PaymentAttributes) WithAgents(agents []*Agent) *PaymentAttributes { + + m.Agents = agents + + return m +} + +func (m *PaymentAttributes) WithAmount(amount string) *PaymentAttributes { + + m.Amount = amount + + return m +} + +func (m *PaymentAttributes) WithBatchBookingIndicator(batchBookingIndicator string) *PaymentAttributes { + + m.BatchBookingIndicator = batchBookingIndicator + + return m +} + +func (m *PaymentAttributes) WithBatchID(batchID string) *PaymentAttributes { + + m.BatchID = batchID + + return m +} + +func (m *PaymentAttributes) WithBatchType(batchType string) *PaymentAttributes { + + m.BatchType = batchType + + return m +} + +func (m *PaymentAttributes) WithBeneficiaryParty(beneficiaryParty PaymentAttributesBeneficiaryParty) *PaymentAttributes { + + m.BeneficiaryParty = &beneficiaryParty + + return m +} + +func (m *PaymentAttributes) WithoutBeneficiaryParty() *PaymentAttributes { + m.BeneficiaryParty = nil + return m +} + +func (m *PaymentAttributes) WithCategoryPurpose(categoryPurpose string) *PaymentAttributes { + + m.CategoryPurpose = categoryPurpose + + return m +} + +func (m *PaymentAttributes) WithCategoryPurposeCoded(categoryPurposeCoded string) *PaymentAttributes { + + m.CategoryPurposeCoded = categoryPurposeCoded + + return m +} + +func (m *PaymentAttributes) WithChargesInformation(chargesInformation ChargesInformation) *PaymentAttributes { + + m.ChargesInformation = &chargesInformation + + return m +} + +func (m *PaymentAttributes) WithoutChargesInformation() *PaymentAttributes { + m.ChargesInformation = nil + return m +} + +func (m *PaymentAttributes) WithClearingID(clearingID string) *PaymentAttributes { + + m.ClearingID = clearingID + + return m +} + +func (m *PaymentAttributes) WithCurrency(currency string) *PaymentAttributes { + + m.Currency = currency + + return m +} + +func (m *PaymentAttributes) WithDebtorParty(debtorParty PaymentAttributesDebtorParty) *PaymentAttributes { + + m.DebtorParty = &debtorParty + + return m +} + +func (m *PaymentAttributes) WithoutDebtorParty() *PaymentAttributes { + m.DebtorParty = nil + return m +} + +func (m *PaymentAttributes) WithEndToEndReference(endToEndReference string) *PaymentAttributes { + + m.EndToEndReference = endToEndReference + + return m +} + +func (m *PaymentAttributes) WithFileNumber(fileNumber string) *PaymentAttributes { + + m.FileNumber = fileNumber + + return m +} + +func (m *PaymentAttributes) WithFx(fx PaymentAttributesFx) *PaymentAttributes { + + m.Fx = &fx + + return m +} + +func (m *PaymentAttributes) WithoutFx() *PaymentAttributes { + m.Fx = nil + return m +} + +func (m *PaymentAttributes) WithInstructionID(instructionID string) *PaymentAttributes { + + m.InstructionID = instructionID + + return m +} + +func (m *PaymentAttributes) WithIntermediaryBank(intermediaryBank IntermediaryBankAccountHoldingEntity) *PaymentAttributes { + + m.IntermediaryBank = &intermediaryBank + + return m +} + +func (m *PaymentAttributes) WithoutIntermediaryBank() *PaymentAttributes { + m.IntermediaryBank = nil + return m +} + +func (m *PaymentAttributes) WithNumericReference(numericReference string) *PaymentAttributes { + + m.NumericReference = numericReference + + return m +} + +func (m *PaymentAttributes) WithPaymentAcceptanceDatetime(paymentAcceptanceDatetime strfmt.DateTime) *PaymentAttributes { + + m.PaymentAcceptanceDatetime = &paymentAcceptanceDatetime + + return m +} + +func (m *PaymentAttributes) WithoutPaymentAcceptanceDatetime() *PaymentAttributes { + m.PaymentAcceptanceDatetime = nil + return m +} + +func (m *PaymentAttributes) WithPaymentPurpose(paymentPurpose string) *PaymentAttributes { + + m.PaymentPurpose = paymentPurpose + + return m +} + +func (m *PaymentAttributes) WithPaymentPurposeCoded(paymentPurposeCoded string) *PaymentAttributes { + + m.PaymentPurposeCoded = paymentPurposeCoded + + return m +} + +func (m *PaymentAttributes) WithPaymentScheme(paymentScheme string) *PaymentAttributes { + + m.PaymentScheme = paymentScheme + + return m +} + +func (m *PaymentAttributes) WithPaymentType(paymentType string) *PaymentAttributes { + + m.PaymentType = paymentType + + return m +} + +func (m *PaymentAttributes) WithProcessingDate(processingDate strfmt.Date) *PaymentAttributes { + + m.ProcessingDate = &processingDate + + return m +} + +func (m *PaymentAttributes) WithoutProcessingDate() *PaymentAttributes { + m.ProcessingDate = nil + return m +} + +func (m *PaymentAttributes) WithReceiversCorrespondent(receiversCorrespondent ReceiversCorrespondentAccountHoldingEntity) *PaymentAttributes { + + m.ReceiversCorrespondent = &receiversCorrespondent + + return m +} + +func (m *PaymentAttributes) WithoutReceiversCorrespondent() *PaymentAttributes { + m.ReceiversCorrespondent = nil + return m +} + +func (m *PaymentAttributes) WithReference(reference string) *PaymentAttributes { + + m.Reference = reference + + return m +} + +func (m *PaymentAttributes) WithRegulatoryReporting(regulatoryReporting string) *PaymentAttributes { + + m.RegulatoryReporting = regulatoryReporting + + return m +} + +func (m *PaymentAttributes) WithReimbursement(reimbursement ReimbursementAccountHoldingEntity) *PaymentAttributes { + + m.Reimbursement = &reimbursement + + return m +} + +func (m *PaymentAttributes) WithoutReimbursement() *PaymentAttributes { + m.Reimbursement = nil + return m +} + +func (m *PaymentAttributes) WithRemittanceInformation(remittanceInformation string) *PaymentAttributes { + + m.RemittanceInformation = remittanceInformation + + return m +} + +func (m *PaymentAttributes) WithSchemePaymentSubType(schemePaymentSubType string) *PaymentAttributes { + + m.SchemePaymentSubType = schemePaymentSubType + + return m +} + +func (m *PaymentAttributes) WithSchemePaymentType(schemePaymentType string) *PaymentAttributes { + + m.SchemePaymentType = schemePaymentType + + return m +} + +func (m *PaymentAttributes) WithSchemeProcessingDate(schemeProcessingDate strfmt.Date) *PaymentAttributes { + + m.SchemeProcessingDate = &schemeProcessingDate + + return m +} + +func (m *PaymentAttributes) WithoutSchemeProcessingDate() *PaymentAttributes { + m.SchemeProcessingDate = nil + return m +} + +func (m *PaymentAttributes) WithSchemeTransactionID(schemeTransactionID string) *PaymentAttributes { + + m.SchemeTransactionID = schemeTransactionID + + return m +} + +func (m *PaymentAttributes) WithSendersCorrespondent(sendersCorrespondent SendersCorrespondentAccountHoldingEntity) *PaymentAttributes { + + m.SendersCorrespondent = &sendersCorrespondent + + return m +} + +func (m *PaymentAttributes) WithoutSendersCorrespondent() *PaymentAttributes { + m.SendersCorrespondent = nil + return m +} + +func (m *PaymentAttributes) WithSettlement(settlement Settlement) *PaymentAttributes { + + m.Settlement = &settlement + + return m +} + +func (m *PaymentAttributes) WithoutSettlement() *PaymentAttributes { + m.Settlement = nil + return m +} + +func (m *PaymentAttributes) WithStructuredReference(structuredReference PaymentAttributesStructuredReference) *PaymentAttributes { + + m.StructuredReference = &structuredReference + + return m +} + +func (m *PaymentAttributes) WithoutStructuredReference() *PaymentAttributes { + m.StructuredReference = nil + return m +} + +func (m *PaymentAttributes) WithSwift(swift PaymentAttributesSwift) *PaymentAttributes { + + m.Swift = &swift + + return m +} + +func (m *PaymentAttributes) WithoutSwift() *PaymentAttributes { + m.Swift = nil + return m +} + +func (m *PaymentAttributes) WithUltimateBeneficiary(ultimateBeneficiary UltimateEntity) *PaymentAttributes { + + m.UltimateBeneficiary = &ultimateBeneficiary + + return m +} + +func (m *PaymentAttributes) WithoutUltimateBeneficiary() *PaymentAttributes { + m.UltimateBeneficiary = nil + return m +} + +func (m *PaymentAttributes) WithUltimateDebtor(ultimateDebtor UltimateEntity) *PaymentAttributes { + + m.UltimateDebtor = &ultimateDebtor + + return m +} + +func (m *PaymentAttributes) WithoutUltimateDebtor() *PaymentAttributes { + m.UltimateDebtor = nil + return m +} + +func (m *PaymentAttributes) WithUniqueSchemeID(uniqueSchemeID string) *PaymentAttributes { + + m.UniqueSchemeID = uniqueSchemeID + + return m +} + +func (m *PaymentAttributes) WithUserDefinedData(userDefinedData []*UserDefinedData) *PaymentAttributes { + + m.UserDefinedData = userDefinedData + + return m +} + +// Validate validates this payment attributes +func (m *PaymentAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAmount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBeneficiaryParty(formats); err != nil { + res = append(res, err) + } + + if err := m.validateChargesInformation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDebtorParty(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFx(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIntermediaryBank(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentAcceptanceDatetime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProcessingDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceiversCorrespondent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReimbursement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSchemeProcessingDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSendersCorrespondent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSettlement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStructuredReference(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSwift(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUltimateBeneficiary(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUltimateDebtor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserDefinedData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentAttributes) validateAgents(formats strfmt.Registry) error { + + if swag.IsZero(m.Agents) { // not required + return nil + } + + for i := 0; i < len(m.Agents); i++ { + if swag.IsZero(m.Agents[i]) { // not required + continue + } + + if m.Agents[i] != nil { + if err := m.Agents[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PaymentAttributes) validateAmount(formats strfmt.Registry) error { + + if swag.IsZero(m.Amount) { // not required + return nil + } + + if err := validate.Pattern("amount", "body", string(m.Amount), `^[0-9.]{0,20}$`); err != nil { + return err + } + + return nil +} + +func (m *PaymentAttributes) validateBeneficiaryParty(formats strfmt.Registry) error { + + if swag.IsZero(m.BeneficiaryParty) { // not required + return nil + } + + if m.BeneficiaryParty != nil { + if err := m.BeneficiaryParty.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_party") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateChargesInformation(formats strfmt.Registry) error { + + if swag.IsZero(m.ChargesInformation) { // not required + return nil + } + + if m.ChargesInformation != nil { + if err := m.ChargesInformation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("charges_information") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateDebtorParty(formats strfmt.Registry) error { + + if swag.IsZero(m.DebtorParty) { // not required + return nil + } + + if m.DebtorParty != nil { + if err := m.DebtorParty.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_party") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateFx(formats strfmt.Registry) error { + + if swag.IsZero(m.Fx) { // not required + return nil + } + + if m.Fx != nil { + if err := m.Fx.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fx") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateIntermediaryBank(formats strfmt.Registry) error { + + if swag.IsZero(m.IntermediaryBank) { // not required + return nil + } + + if m.IntermediaryBank != nil { + if err := m.IntermediaryBank.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("intermediary_bank") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validatePaymentAcceptanceDatetime(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentAcceptanceDatetime) { // not required + return nil + } + + if err := validate.FormatOf("payment_acceptance_datetime", "body", "date-time", m.PaymentAcceptanceDatetime.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentAttributes) validateProcessingDate(formats strfmt.Registry) error { + + if swag.IsZero(m.ProcessingDate) { // not required + return nil + } + + if err := validate.FormatOf("processing_date", "body", "date", m.ProcessingDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentAttributes) validateReceiversCorrespondent(formats strfmt.Registry) error { + + if swag.IsZero(m.ReceiversCorrespondent) { // not required + return nil + } + + if m.ReceiversCorrespondent != nil { + if err := m.ReceiversCorrespondent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("receivers_correspondent") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateReimbursement(formats strfmt.Registry) error { + + if swag.IsZero(m.Reimbursement) { // not required + return nil + } + + if m.Reimbursement != nil { + if err := m.Reimbursement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reimbursement") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateSchemeProcessingDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SchemeProcessingDate) { // not required + return nil + } + + if err := validate.FormatOf("scheme_processing_date", "body", "date", m.SchemeProcessingDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentAttributes) validateSendersCorrespondent(formats strfmt.Registry) error { + + if swag.IsZero(m.SendersCorrespondent) { // not required + return nil + } + + if m.SendersCorrespondent != nil { + if err := m.SendersCorrespondent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("senders_correspondent") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateSettlement(formats strfmt.Registry) error { + + if swag.IsZero(m.Settlement) { // not required + return nil + } + + if m.Settlement != nil { + if err := m.Settlement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("settlement") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateStructuredReference(formats strfmt.Registry) error { + + if swag.IsZero(m.StructuredReference) { // not required + return nil + } + + if m.StructuredReference != nil { + if err := m.StructuredReference.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("structured_reference") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateSwift(formats strfmt.Registry) error { + + if swag.IsZero(m.Swift) { // not required + return nil + } + + if m.Swift != nil { + if err := m.Swift.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("swift") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateUltimateBeneficiary(formats strfmt.Registry) error { + + if swag.IsZero(m.UltimateBeneficiary) { // not required + return nil + } + + if m.UltimateBeneficiary != nil { + if err := m.UltimateBeneficiary.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ultimate_beneficiary") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateUltimateDebtor(formats strfmt.Registry) error { + + if swag.IsZero(m.UltimateDebtor) { // not required + return nil + } + + if m.UltimateDebtor != nil { + if err := m.UltimateDebtor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ultimate_debtor") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributes) validateUserDefinedData(formats strfmt.Registry) error { + + if swag.IsZero(m.UserDefinedData) { // not required + return nil + } + + iUserDefinedDataSize := int64(len(m.UserDefinedData)) + + if err := validate.MaxItems("user_defined_data", "body", iUserDefinedDataSize, 5); err != nil { + return err + } + + for i := 0; i < len(m.UserDefinedData); i++ { + if swag.IsZero(m.UserDefinedData[i]) { // not required + continue + } + + if m.UserDefinedData[i] != nil { + if err := m.UserDefinedData[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user_defined_data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAttributes) UnmarshalBinary(b []byte) error { + var res PaymentAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentAttributesBeneficiaryParty payment attributes beneficiary party +// swagger:model PaymentAttributesBeneficiaryParty +type PaymentAttributesBeneficiaryParty struct { + + // Name of beneficiary as given with account + AccountName string `json:"account_name,omitempty"` + + // Beneficiary account number + AccountNumber string `json:"account_number,omitempty"` + + // account number code + AccountNumberCode AccountNumberCode `json:"account_number_code,omitempty"` + + // The type of the account given with `beneficiary_party.account_number`. Single digit number. Only required if requested by the beneficiary party. Defaults to 0. + AccountType int64 `json:"account_type,omitempty"` + + // account with + AccountWith *BeneficiaryDebtorAccountHoldingEntity `json:"account_with,omitempty"` + + // Additional address line of the beneficiary address + AdditionalAddressLine string `json:"additional_address_line,omitempty"` + + // Beneficiary address + Address []string `json:"address,omitempty"` + + // Beneficiary birth city + BirthCity string `json:"birth_city,omitempty"` + + // Beneficiary birth country, ISO 3166 format country code + BirthCountry string `json:"birth_country,omitempty"` + + // Beneficiary birth date. Formatted according to ISO 8601 format: YYYY-MM-DD + // Format: date + BirthDate *strfmt.Date `json:"birth_date,omitempty"` + + // Beneficiary birth province + BirthProvince string `json:"birth_province,omitempty"` + + // Building number of the beneficiary address + BuildingNumber string `json:"building_number,omitempty"` + + // City/Town of the Beneficiary address + City string `json:"city,omitempty"` + + // Country of the beneficiary address, ISO 3166 format country code + Country string `json:"country,omitempty"` + + // Beneficiary name + Name string `json:"name,omitempty"` + + // Organisation identification of a beneficiary, used in the case that the beneficiary is an organisation and not a private person + OrganisationIdentification string `json:"organisation_identification,omitempty"` + + // The code that specifies the type of `organisation_identification` + OrganisationIdentificationCode string `json:"organisation_identification_code,omitempty"` + + // Issuer of the `organisation_identification` + OrganisationIdentificationIssuer string `json:"organisation_identification_issuer,omitempty"` + + // The code that specifies the scheme of `organisation_identification` + OrganisationIdentificationScheme string `json:"organisation_identification_scheme,omitempty"` + + // Post code of the beneficiary address + PostCode string `json:"post_code,omitempty"` + + // private identification + PrivateIdentification *PrivateIdentification `json:"private_identification,omitempty"` + + // Province of the beneficiary address + Province string `json:"province,omitempty"` + + // Street name of the beneficiary address + StreetName string `json:"street_name,omitempty"` + + // Beneficiary phone number + TelephoneNumber string `json:"telephone_number,omitempty"` +} + +func PaymentAttributesBeneficiaryPartyWithDefaults(defaults client.Defaults) *PaymentAttributesBeneficiaryParty { + return &PaymentAttributesBeneficiaryParty{ + + AccountName: defaults.GetString("PaymentAttributesBeneficiaryParty", "account_name"), + + AccountNumber: defaults.GetString("PaymentAttributesBeneficiaryParty", "account_number"), + + // TODO AccountNumberCode: AccountNumberCode, + + AccountType: defaults.GetInt64("PaymentAttributesBeneficiaryParty", "account_type"), + + AccountWith: BeneficiaryDebtorAccountHoldingEntityWithDefaults(defaults), + + AdditionalAddressLine: defaults.GetString("PaymentAttributesBeneficiaryParty", "additional_address_line"), + + Address: make([]string, 0), + + BirthCity: defaults.GetString("PaymentAttributesBeneficiaryParty", "birth_city"), + + BirthCountry: defaults.GetString("PaymentAttributesBeneficiaryParty", "birth_country"), + + BirthDate: defaults.GetStrfmtDatePtr("PaymentAttributesBeneficiaryParty", "birth_date"), + + BirthProvince: defaults.GetString("PaymentAttributesBeneficiaryParty", "birth_province"), + + BuildingNumber: defaults.GetString("PaymentAttributesBeneficiaryParty", "building_number"), + + City: defaults.GetString("PaymentAttributesBeneficiaryParty", "city"), + + Country: defaults.GetString("PaymentAttributesBeneficiaryParty", "country"), + + Name: defaults.GetString("PaymentAttributesBeneficiaryParty", "name"), + + OrganisationIdentification: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification"), + + OrganisationIdentificationCode: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification_code"), + + OrganisationIdentificationIssuer: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification_issuer"), + + OrganisationIdentificationScheme: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification_scheme"), + + PostCode: defaults.GetString("PaymentAttributesBeneficiaryParty", "post_code"), + + PrivateIdentification: PrivateIdentificationWithDefaults(defaults), + + Province: defaults.GetString("PaymentAttributesBeneficiaryParty", "province"), + + StreetName: defaults.GetString("PaymentAttributesBeneficiaryParty", "street_name"), + + TelephoneNumber: defaults.GetString("PaymentAttributesBeneficiaryParty", "telephone_number"), + } +} + +func (m *PaymentAttributesBeneficiaryParty) WithAccountName(accountName string) *PaymentAttributesBeneficiaryParty { + + m.AccountName = accountName + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithAccountNumber(accountNumber string) *PaymentAttributesBeneficiaryParty { + + m.AccountNumber = accountNumber + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithAccountNumberCode(accountNumberCode AccountNumberCode) *PaymentAttributesBeneficiaryParty { + + m.AccountNumberCode = accountNumberCode + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithAccountType(accountType int64) *PaymentAttributesBeneficiaryParty { + + m.AccountType = accountType + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithAccountWith(accountWith BeneficiaryDebtorAccountHoldingEntity) *PaymentAttributesBeneficiaryParty { + + m.AccountWith = &accountWith + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithoutAccountWith() *PaymentAttributesBeneficiaryParty { + m.AccountWith = nil + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithAdditionalAddressLine(additionalAddressLine string) *PaymentAttributesBeneficiaryParty { + + m.AdditionalAddressLine = additionalAddressLine + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithAddress(address []string) *PaymentAttributesBeneficiaryParty { + + m.Address = address + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithBirthCity(birthCity string) *PaymentAttributesBeneficiaryParty { + + m.BirthCity = birthCity + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithBirthCountry(birthCountry string) *PaymentAttributesBeneficiaryParty { + + m.BirthCountry = birthCountry + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithBirthDate(birthDate strfmt.Date) *PaymentAttributesBeneficiaryParty { + + m.BirthDate = &birthDate + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithoutBirthDate() *PaymentAttributesBeneficiaryParty { + m.BirthDate = nil + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithBirthProvince(birthProvince string) *PaymentAttributesBeneficiaryParty { + + m.BirthProvince = birthProvince + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithBuildingNumber(buildingNumber string) *PaymentAttributesBeneficiaryParty { + + m.BuildingNumber = buildingNumber + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithCity(city string) *PaymentAttributesBeneficiaryParty { + + m.City = city + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithCountry(country string) *PaymentAttributesBeneficiaryParty { + + m.Country = country + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithName(name string) *PaymentAttributesBeneficiaryParty { + + m.Name = name + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentification(organisationIdentification string) *PaymentAttributesBeneficiaryParty { + + m.OrganisationIdentification = organisationIdentification + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentificationCode(organisationIdentificationCode string) *PaymentAttributesBeneficiaryParty { + + m.OrganisationIdentificationCode = organisationIdentificationCode + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentificationIssuer(organisationIdentificationIssuer string) *PaymentAttributesBeneficiaryParty { + + m.OrganisationIdentificationIssuer = organisationIdentificationIssuer + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithOrganisationIdentificationScheme(organisationIdentificationScheme string) *PaymentAttributesBeneficiaryParty { + + m.OrganisationIdentificationScheme = organisationIdentificationScheme + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithPostCode(postCode string) *PaymentAttributesBeneficiaryParty { + + m.PostCode = postCode + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithPrivateIdentification(privateIdentification PrivateIdentification) *PaymentAttributesBeneficiaryParty { + + m.PrivateIdentification = &privateIdentification + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithoutPrivateIdentification() *PaymentAttributesBeneficiaryParty { + m.PrivateIdentification = nil + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithProvince(province string) *PaymentAttributesBeneficiaryParty { + + m.Province = province + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithStreetName(streetName string) *PaymentAttributesBeneficiaryParty { + + m.StreetName = streetName + + return m +} + +func (m *PaymentAttributesBeneficiaryParty) WithTelephoneNumber(telephoneNumber string) *PaymentAttributesBeneficiaryParty { + + m.TelephoneNumber = telephoneNumber + + return m +} + +// Validate validates this payment attributes beneficiary party +func (m *PaymentAttributesBeneficiaryParty) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccountNumberCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAccountWith(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBirthDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrivateIdentification(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentAttributesBeneficiaryParty) validateAccountNumberCode(formats strfmt.Registry) error { + + if swag.IsZero(m.AccountNumberCode) { // not required + return nil + } + + if err := m.AccountNumberCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_party" + "." + "account_number_code") + } + return err + } + + return nil +} + +func (m *PaymentAttributesBeneficiaryParty) validateAccountWith(formats strfmt.Registry) error { + + if swag.IsZero(m.AccountWith) { // not required + return nil + } + + if m.AccountWith != nil { + if err := m.AccountWith.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_party" + "." + "account_with") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributesBeneficiaryParty) validateBirthDate(formats strfmt.Registry) error { + + if swag.IsZero(m.BirthDate) { // not required + return nil + } + + if err := validate.FormatOf("beneficiary_party"+"."+"birth_date", "body", "date", m.BirthDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentAttributesBeneficiaryParty) validatePrivateIdentification(formats strfmt.Registry) error { + + if swag.IsZero(m.PrivateIdentification) { // not required + return nil + } + + if m.PrivateIdentification != nil { + if err := m.PrivateIdentification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_party" + "." + "private_identification") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAttributesBeneficiaryParty) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAttributesBeneficiaryParty) UnmarshalBinary(b []byte) error { + var res PaymentAttributesBeneficiaryParty + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAttributesBeneficiaryParty) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentAttributesDebtorParty payment attributes debtor party +// swagger:model PaymentAttributesDebtorParty +type PaymentAttributesDebtorParty struct { + + // Name of debtor as given with account + AccountName string `json:"account_name,omitempty"` + + // Debtor account number. Allows upper case and numeric characters. + AccountNumber string `json:"account_number,omitempty"` + + // account number code + AccountNumberCode AccountNumberCode `json:"account_number_code,omitempty"` + + // account with + AccountWith *BeneficiaryDebtorAccountHoldingEntity `json:"account_with,omitempty"` + + // Additional address line of the Debtor address + AdditionalAddressLine string `json:"additional_address_line,omitempty"` + + // Debtor address + Address []string `json:"address,omitempty"` + + // Debtor birth city + BirthCity string `json:"birth_city,omitempty"` + + // Debtor birth country. ISO 3166 format country code + BirthCountry string `json:"birth_country,omitempty"` + + // Debtor birth date. Formatted according to ISO 8601 format: YYYY-MM-DD + // Format: date + BirthDate *strfmt.Date `json:"birth_date,omitempty"` + + // Debtor birth province + BirthProvince string `json:"birth_province,omitempty"` + + // Building number of the Debtor address + BuildingNumber string `json:"building_number,omitempty"` + + // City/Town of the Debtor address + City string `json:"city,omitempty"` + + // Country of debtor address. ISO 3166 format country code" + Country string `json:"country,omitempty"` + + // SWIFT BIC for ordering customer, either BIC8 or BIC11 + CustomerID string `json:"customer_id,omitempty"` + + // Code for `customer_id` + CustomerIDCode string `json:"customer_id_code,omitempty"` + + // Debtor name + Name string `json:"name,omitempty"` + + // Organisation identification of a debtor, in the case that the debtor is an organisation and not a private person + OrganisationIdentification string `json:"organisation_identification,omitempty"` + + // The code that specifies the type of `organisation_identification` + OrganisationIdentificationCode string `json:"organisation_identification_code,omitempty"` + + // Issuer of the `organisation_identification` + OrganisationIdentificationIssuer string `json:"organisation_identification_issuer,omitempty"` + + // The code that specifies the scheme of `organisation_identification` + OrganisationIdentificationScheme string `json:"organisation_identification_scheme,omitempty"` + + // Post code of the Debtor address + PostCode string `json:"post_code,omitempty"` + + // private identification + PrivateIdentification *PrivateIdentification `json:"private_identification,omitempty"` + + // Province of the Debtor address + Province string `json:"province,omitempty"` + + // Street name of the Debtor address + StreetName string `json:"street_name,omitempty"` +} + +func PaymentAttributesDebtorPartyWithDefaults(defaults client.Defaults) *PaymentAttributesDebtorParty { + return &PaymentAttributesDebtorParty{ + + AccountName: defaults.GetString("PaymentAttributesDebtorParty", "account_name"), + + AccountNumber: defaults.GetString("PaymentAttributesDebtorParty", "account_number"), + + // TODO AccountNumberCode: AccountNumberCode, + + AccountWith: BeneficiaryDebtorAccountHoldingEntityWithDefaults(defaults), + + AdditionalAddressLine: defaults.GetString("PaymentAttributesDebtorParty", "additional_address_line"), + + Address: make([]string, 0), + + BirthCity: defaults.GetString("PaymentAttributesDebtorParty", "birth_city"), + + BirthCountry: defaults.GetString("PaymentAttributesDebtorParty", "birth_country"), + + BirthDate: defaults.GetStrfmtDatePtr("PaymentAttributesDebtorParty", "birth_date"), + + BirthProvince: defaults.GetString("PaymentAttributesDebtorParty", "birth_province"), + + BuildingNumber: defaults.GetString("PaymentAttributesDebtorParty", "building_number"), + + City: defaults.GetString("PaymentAttributesDebtorParty", "city"), + + Country: defaults.GetString("PaymentAttributesDebtorParty", "country"), + + CustomerID: defaults.GetString("PaymentAttributesDebtorParty", "customer_id"), + + CustomerIDCode: defaults.GetString("PaymentAttributesDebtorParty", "customer_id_code"), + + Name: defaults.GetString("PaymentAttributesDebtorParty", "name"), + + OrganisationIdentification: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification"), + + OrganisationIdentificationCode: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification_code"), + + OrganisationIdentificationIssuer: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification_issuer"), + + OrganisationIdentificationScheme: defaults.GetString("PaymentAttributesDebtorParty", "organisation_identification_scheme"), + + PostCode: defaults.GetString("PaymentAttributesDebtorParty", "post_code"), + + PrivateIdentification: PrivateIdentificationWithDefaults(defaults), + + Province: defaults.GetString("PaymentAttributesDebtorParty", "province"), + + StreetName: defaults.GetString("PaymentAttributesDebtorParty", "street_name"), + } +} + +func (m *PaymentAttributesDebtorParty) WithAccountName(accountName string) *PaymentAttributesDebtorParty { + + m.AccountName = accountName + + return m +} + +func (m *PaymentAttributesDebtorParty) WithAccountNumber(accountNumber string) *PaymentAttributesDebtorParty { + + m.AccountNumber = accountNumber + + return m +} + +func (m *PaymentAttributesDebtorParty) WithAccountNumberCode(accountNumberCode AccountNumberCode) *PaymentAttributesDebtorParty { + + m.AccountNumberCode = accountNumberCode + + return m +} + +func (m *PaymentAttributesDebtorParty) WithAccountWith(accountWith BeneficiaryDebtorAccountHoldingEntity) *PaymentAttributesDebtorParty { + + m.AccountWith = &accountWith + + return m +} + +func (m *PaymentAttributesDebtorParty) WithoutAccountWith() *PaymentAttributesDebtorParty { + m.AccountWith = nil + return m +} + +func (m *PaymentAttributesDebtorParty) WithAdditionalAddressLine(additionalAddressLine string) *PaymentAttributesDebtorParty { + + m.AdditionalAddressLine = additionalAddressLine + + return m +} + +func (m *PaymentAttributesDebtorParty) WithAddress(address []string) *PaymentAttributesDebtorParty { + + m.Address = address + + return m +} + +func (m *PaymentAttributesDebtorParty) WithBirthCity(birthCity string) *PaymentAttributesDebtorParty { + + m.BirthCity = birthCity + + return m +} + +func (m *PaymentAttributesDebtorParty) WithBirthCountry(birthCountry string) *PaymentAttributesDebtorParty { + + m.BirthCountry = birthCountry + + return m +} + +func (m *PaymentAttributesDebtorParty) WithBirthDate(birthDate strfmt.Date) *PaymentAttributesDebtorParty { + + m.BirthDate = &birthDate + + return m +} + +func (m *PaymentAttributesDebtorParty) WithoutBirthDate() *PaymentAttributesDebtorParty { + m.BirthDate = nil + return m +} + +func (m *PaymentAttributesDebtorParty) WithBirthProvince(birthProvince string) *PaymentAttributesDebtorParty { + + m.BirthProvince = birthProvince + + return m +} + +func (m *PaymentAttributesDebtorParty) WithBuildingNumber(buildingNumber string) *PaymentAttributesDebtorParty { + + m.BuildingNumber = buildingNumber + + return m +} + +func (m *PaymentAttributesDebtorParty) WithCity(city string) *PaymentAttributesDebtorParty { + + m.City = city + + return m +} + +func (m *PaymentAttributesDebtorParty) WithCountry(country string) *PaymentAttributesDebtorParty { + + m.Country = country + + return m +} + +func (m *PaymentAttributesDebtorParty) WithCustomerID(customerID string) *PaymentAttributesDebtorParty { + + m.CustomerID = customerID + + return m +} + +func (m *PaymentAttributesDebtorParty) WithCustomerIDCode(customerIDCode string) *PaymentAttributesDebtorParty { + + m.CustomerIDCode = customerIDCode + + return m +} + +func (m *PaymentAttributesDebtorParty) WithName(name string) *PaymentAttributesDebtorParty { + + m.Name = name + + return m +} + +func (m *PaymentAttributesDebtorParty) WithOrganisationIdentification(organisationIdentification string) *PaymentAttributesDebtorParty { + + m.OrganisationIdentification = organisationIdentification + + return m +} + +func (m *PaymentAttributesDebtorParty) WithOrganisationIdentificationCode(organisationIdentificationCode string) *PaymentAttributesDebtorParty { + + m.OrganisationIdentificationCode = organisationIdentificationCode + + return m +} + +func (m *PaymentAttributesDebtorParty) WithOrganisationIdentificationIssuer(organisationIdentificationIssuer string) *PaymentAttributesDebtorParty { + + m.OrganisationIdentificationIssuer = organisationIdentificationIssuer + + return m +} + +func (m *PaymentAttributesDebtorParty) WithOrganisationIdentificationScheme(organisationIdentificationScheme string) *PaymentAttributesDebtorParty { + + m.OrganisationIdentificationScheme = organisationIdentificationScheme + + return m +} + +func (m *PaymentAttributesDebtorParty) WithPostCode(postCode string) *PaymentAttributesDebtorParty { + + m.PostCode = postCode + + return m +} + +func (m *PaymentAttributesDebtorParty) WithPrivateIdentification(privateIdentification PrivateIdentification) *PaymentAttributesDebtorParty { + + m.PrivateIdentification = &privateIdentification + + return m +} + +func (m *PaymentAttributesDebtorParty) WithoutPrivateIdentification() *PaymentAttributesDebtorParty { + m.PrivateIdentification = nil + return m +} + +func (m *PaymentAttributesDebtorParty) WithProvince(province string) *PaymentAttributesDebtorParty { + + m.Province = province + + return m +} + +func (m *PaymentAttributesDebtorParty) WithStreetName(streetName string) *PaymentAttributesDebtorParty { + + m.StreetName = streetName + + return m +} + +// Validate validates this payment attributes debtor party +func (m *PaymentAttributesDebtorParty) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccountNumberCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAccountWith(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBirthDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrivateIdentification(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentAttributesDebtorParty) validateAccountNumberCode(formats strfmt.Registry) error { + + if swag.IsZero(m.AccountNumberCode) { // not required + return nil + } + + if err := m.AccountNumberCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_party" + "." + "account_number_code") + } + return err + } + + return nil +} + +func (m *PaymentAttributesDebtorParty) validateAccountWith(formats strfmt.Registry) error { + + if swag.IsZero(m.AccountWith) { // not required + return nil + } + + if m.AccountWith != nil { + if err := m.AccountWith.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_party" + "." + "account_with") + } + return err + } + } + + return nil +} + +func (m *PaymentAttributesDebtorParty) validateBirthDate(formats strfmt.Registry) error { + + if swag.IsZero(m.BirthDate) { // not required + return nil + } + + if err := validate.FormatOf("debtor_party"+"."+"birth_date", "body", "date", m.BirthDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentAttributesDebtorParty) validatePrivateIdentification(formats strfmt.Registry) error { + + if swag.IsZero(m.PrivateIdentification) { // not required + return nil + } + + if m.PrivateIdentification != nil { + if err := m.PrivateIdentification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_party" + "." + "private_identification") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAttributesDebtorParty) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAttributesDebtorParty) UnmarshalBinary(b []byte) error { + var res PaymentAttributesDebtorParty + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAttributesDebtorParty) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentAttributesFx payment attributes fx +// swagger:model PaymentAttributesFx +type PaymentAttributesFx struct { + + // Reference to the foreign exchange contract associated with the transaction + ContractReference string `json:"contract_reference,omitempty"` + + // Factor used to convert an amount from the instructed currency into the transaction currency: i.e. to convert the `fx.original_amount`, expressed in the `fx.original_currency`, to `amount` specified in `currency`. Decimal value, represented as a string, maximum length 12. Must be > 0. + ExchangeRate string `json:"exchange_rate,omitempty"` + + // Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as instructed by the initiating party. Decimal value. Must be > 0. + OriginalAmount string `json:"original_amount,omitempty"` + + // Currency of `original_amount`. Currency code as defined in ISO 4217. + OriginalCurrency string `json:"original_currency,omitempty"` +} + +func PaymentAttributesFxWithDefaults(defaults client.Defaults) *PaymentAttributesFx { + return &PaymentAttributesFx{ + + ContractReference: defaults.GetString("PaymentAttributesFx", "contract_reference"), + + ExchangeRate: defaults.GetString("PaymentAttributesFx", "exchange_rate"), + + OriginalAmount: defaults.GetString("PaymentAttributesFx", "original_amount"), + + OriginalCurrency: defaults.GetString("PaymentAttributesFx", "original_currency"), + } +} + +func (m *PaymentAttributesFx) WithContractReference(contractReference string) *PaymentAttributesFx { + + m.ContractReference = contractReference + + return m +} + +func (m *PaymentAttributesFx) WithExchangeRate(exchangeRate string) *PaymentAttributesFx { + + m.ExchangeRate = exchangeRate + + return m +} + +func (m *PaymentAttributesFx) WithOriginalAmount(originalAmount string) *PaymentAttributesFx { + + m.OriginalAmount = originalAmount + + return m +} + +func (m *PaymentAttributesFx) WithOriginalCurrency(originalCurrency string) *PaymentAttributesFx { + + m.OriginalCurrency = originalCurrency + + return m +} + +// Validate validates this payment attributes fx +func (m *PaymentAttributesFx) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAttributesFx) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAttributesFx) UnmarshalBinary(b []byte) error { + var res PaymentAttributesFx + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAttributesFx) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentAttributesStructuredReference payment attributes structured reference +// swagger:model PaymentAttributesStructuredReference +type PaymentAttributesStructuredReference struct { + + // Issuer of remittance reference + Issuer string `json:"issuer,omitempty"` + + // Unique reference to unambiguously refer to the payment originated by the creditor, this reference enables reconciliation by the creditor upon receipt of the amount of money. + Reference string `json:"reference,omitempty"` +} + +func PaymentAttributesStructuredReferenceWithDefaults(defaults client.Defaults) *PaymentAttributesStructuredReference { + return &PaymentAttributesStructuredReference{ + + Issuer: defaults.GetString("PaymentAttributesStructuredReference", "issuer"), + + Reference: defaults.GetString("PaymentAttributesStructuredReference", "reference"), + } +} + +func (m *PaymentAttributesStructuredReference) WithIssuer(issuer string) *PaymentAttributesStructuredReference { + + m.Issuer = issuer + + return m +} + +func (m *PaymentAttributesStructuredReference) WithReference(reference string) *PaymentAttributesStructuredReference { + + m.Reference = reference + + return m +} + +// Validate validates this payment attributes structured reference +func (m *PaymentAttributesStructuredReference) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAttributesStructuredReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAttributesStructuredReference) UnmarshalBinary(b []byte) error { + var res PaymentAttributesStructuredReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAttributesStructuredReference) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentAttributesSwift payment attributes swift +// swagger:model PaymentAttributesSwift +type PaymentAttributesSwift struct { + + // SWIFT service level + BankOperationCode string `json:"bank_operation_code,omitempty"` + + // header + Header *PaymentAttributesSwiftHeader `json:"header,omitempty"` + + // A SWIFT instruction code + InstructionCode string `json:"instruction_code,omitempty"` + + // This field specifies additional information for the Receiver or other party specified. + SenderReceiverInformation string `json:"sender_receiver_information,omitempty"` + + // This repetitive field specifies one or several time indication(s) related to the processing of the payment instruction. + TimeIndication string `json:"time_indication,omitempty"` +} + +func PaymentAttributesSwiftWithDefaults(defaults client.Defaults) *PaymentAttributesSwift { + return &PaymentAttributesSwift{ + + BankOperationCode: defaults.GetString("PaymentAttributesSwift", "bank_operation_code"), + + Header: PaymentAttributesSwiftHeaderWithDefaults(defaults), + + InstructionCode: defaults.GetString("PaymentAttributesSwift", "instruction_code"), + + SenderReceiverInformation: defaults.GetString("PaymentAttributesSwift", "sender_receiver_information"), + + TimeIndication: defaults.GetString("PaymentAttributesSwift", "time_indication"), + } +} + +func (m *PaymentAttributesSwift) WithBankOperationCode(bankOperationCode string) *PaymentAttributesSwift { + + m.BankOperationCode = bankOperationCode + + return m +} + +func (m *PaymentAttributesSwift) WithHeader(header PaymentAttributesSwiftHeader) *PaymentAttributesSwift { + + m.Header = &header + + return m +} + +func (m *PaymentAttributesSwift) WithoutHeader() *PaymentAttributesSwift { + m.Header = nil + return m +} + +func (m *PaymentAttributesSwift) WithInstructionCode(instructionCode string) *PaymentAttributesSwift { + + m.InstructionCode = instructionCode + + return m +} + +func (m *PaymentAttributesSwift) WithSenderReceiverInformation(senderReceiverInformation string) *PaymentAttributesSwift { + + m.SenderReceiverInformation = senderReceiverInformation + + return m +} + +func (m *PaymentAttributesSwift) WithTimeIndication(timeIndication string) *PaymentAttributesSwift { + + m.TimeIndication = timeIndication + + return m +} + +// Validate validates this payment attributes swift +func (m *PaymentAttributesSwift) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeader(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentAttributesSwift) validateHeader(formats strfmt.Registry) error { + + if swag.IsZero(m.Header) { // not required + return nil + } + + if m.Header != nil { + if err := m.Header.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("swift" + "." + "header") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAttributesSwift) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAttributesSwift) UnmarshalBinary(b []byte) error { + var res PaymentAttributesSwift + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAttributesSwift) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentAttributesSwiftHeader payment attributes swift header +// swagger:model PaymentAttributesSwiftHeader +type PaymentAttributesSwiftHeader struct { + + // Destination SWIFT logical terminal address. Complete 12-character SWIFT destination, including BIC (x8), logical terminal code (x1) and branch code (x). + Destination string `json:"destination,omitempty"` + + // The message type of the SWIFT payment, has to match `[A-Z]{2}[0-9]{3}`. Currently `MT103` is the only supported value + MessageType string `json:"message_type,omitempty"` + + // SWIFT priority. Either `Normal` or `Priority`. + Priority string `json:"priority,omitempty"` + + // The destination SWIFT BIC for SWIFT MT messages being sent by Form3 client to SWIFT. Formatted as BIC8 or BIC11. + Recipient string `json:"recipient,omitempty"` + + // The source SWIFT BIC for SWIFT MT messages being received by Form3 client from SWIFT. Formatted as BIC8 or BIC11. + Source string `json:"source,omitempty"` + + // Message User Reference (MUR) value, which can be up to 16 characters, and will be returned in the ACK + UserReference string `json:"user_reference,omitempty"` +} + +func PaymentAttributesSwiftHeaderWithDefaults(defaults client.Defaults) *PaymentAttributesSwiftHeader { + return &PaymentAttributesSwiftHeader{ + + Destination: defaults.GetString("PaymentAttributesSwiftHeader", "destination"), + + MessageType: defaults.GetString("PaymentAttributesSwiftHeader", "message_type"), + + Priority: defaults.GetString("PaymentAttributesSwiftHeader", "priority"), + + Recipient: defaults.GetString("PaymentAttributesSwiftHeader", "recipient"), + + Source: defaults.GetString("PaymentAttributesSwiftHeader", "source"), + + UserReference: defaults.GetString("PaymentAttributesSwiftHeader", "user_reference"), + } +} + +func (m *PaymentAttributesSwiftHeader) WithDestination(destination string) *PaymentAttributesSwiftHeader { + + m.Destination = destination + + return m +} + +func (m *PaymentAttributesSwiftHeader) WithMessageType(messageType string) *PaymentAttributesSwiftHeader { + + m.MessageType = messageType + + return m +} + +func (m *PaymentAttributesSwiftHeader) WithPriority(priority string) *PaymentAttributesSwiftHeader { + + m.Priority = priority + + return m +} + +func (m *PaymentAttributesSwiftHeader) WithRecipient(recipient string) *PaymentAttributesSwiftHeader { + + m.Recipient = recipient + + return m +} + +func (m *PaymentAttributesSwiftHeader) WithSource(source string) *PaymentAttributesSwiftHeader { + + m.Source = source + + return m +} + +func (m *PaymentAttributesSwiftHeader) WithUserReference(userReference string) *PaymentAttributesSwiftHeader { + + m.UserReference = userReference + + return m +} + +// Validate validates this payment attributes swift header +func (m *PaymentAttributesSwiftHeader) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentAttributesSwiftHeader) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentAttributesSwiftHeader) UnmarshalBinary(b []byte) error { + var res PaymentAttributesSwiftHeader + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentAttributesSwiftHeader) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_creation.go b/pkg/generated/models/payment_creation.go index fd644e93..33ecfab3 100644 --- a/pkg/generated/models/payment_creation.go +++ b/pkg/generated/models/payment_creation.go @@ -21,17 +21,17 @@ import ( type PaymentCreation struct { // data - Data *Payment `json:"data,omitempty"` + Data *NewPayment `json:"data,omitempty"` } func PaymentCreationWithDefaults(defaults client.Defaults) *PaymentCreation { return &PaymentCreation{ - Data: PaymentWithDefaults(defaults), + Data: NewPaymentWithDefaults(defaults), } } -func (m *PaymentCreation) WithData(data Payment) *PaymentCreation { +func (m *PaymentCreation) WithData(data NewPayment) *PaymentCreation { m.Data = &data diff --git a/pkg/generated/models/payment_relationships.go b/pkg/generated/models/payment_relationships.go index c5274cc6..06f43809 100644 --- a/pkg/generated/models/payment_relationships.go +++ b/pkg/generated/models/payment_relationships.go @@ -33,6 +33,12 @@ type PaymentRelationships struct { // debtor account DebtorAccount *PaymentRelationshipsDebtorAccount `json:"debtor_account,omitempty"` + // forwarded payment + ForwardedPayment *PaymentRelationshipsForwardedPayment `json:"forwarded_payment,omitempty"` + + // forwarding payment + ForwardingPayment *PaymentRelationshipsForwardingPayment `json:"forwarding_payment,omitempty"` + // fx deal FxDeal *PaymentRelationshipsFxDeal `json:"fx_deal,omitempty"` @@ -66,6 +72,10 @@ func PaymentRelationshipsWithDefaults(defaults client.Defaults) *PaymentRelation DebtorAccount: PaymentRelationshipsDebtorAccountWithDefaults(defaults), + ForwardedPayment: PaymentRelationshipsForwardedPaymentWithDefaults(defaults), + + ForwardingPayment: PaymentRelationshipsForwardingPaymentWithDefaults(defaults), + FxDeal: PaymentRelationshipsFxDealWithDefaults(defaults), PaymentAdmission: PaymentRelationshipsPaymentAdmissionWithDefaults(defaults), @@ -130,6 +140,30 @@ func (m *PaymentRelationships) WithoutDebtorAccount() *PaymentRelationships { return m } +func (m *PaymentRelationships) WithForwardedPayment(forwardedPayment PaymentRelationshipsForwardedPayment) *PaymentRelationships { + + m.ForwardedPayment = &forwardedPayment + + return m +} + +func (m *PaymentRelationships) WithoutForwardedPayment() *PaymentRelationships { + m.ForwardedPayment = nil + return m +} + +func (m *PaymentRelationships) WithForwardingPayment(forwardingPayment PaymentRelationshipsForwardingPayment) *PaymentRelationships { + + m.ForwardingPayment = &forwardingPayment + + return m +} + +func (m *PaymentRelationships) WithoutForwardingPayment() *PaymentRelationships { + m.ForwardingPayment = nil + return m +} + func (m *PaymentRelationships) WithFxDeal(fxDeal PaymentRelationshipsFxDeal) *PaymentRelationships { m.FxDeal = &fxDeal @@ -234,6 +268,14 @@ func (m *PaymentRelationships) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateForwardedPayment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateForwardingPayment(formats); err != nil { + res = append(res, err) + } + if err := m.validateFxDeal(formats); err != nil { res = append(res, err) } @@ -340,6 +382,42 @@ func (m *PaymentRelationships) validateDebtorAccount(formats strfmt.Registry) er return nil } +func (m *PaymentRelationships) validateForwardedPayment(formats strfmt.Registry) error { + + if swag.IsZero(m.ForwardedPayment) { // not required + return nil + } + + if m.ForwardedPayment != nil { + if err := m.ForwardedPayment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarded_payment") + } + return err + } + } + + return nil +} + +func (m *PaymentRelationships) validateForwardingPayment(formats strfmt.Registry) error { + + if swag.IsZero(m.ForwardingPayment) { // not required + return nil + } + + if m.ForwardingPayment != nil { + if err := m.ForwardingPayment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarding_payment") + } + return err + } + } + + return nil +} + func (m *PaymentRelationships) validateFxDeal(formats strfmt.Registry) error { if swag.IsZero(m.FxDeal) { // not required @@ -835,6 +913,178 @@ func (m *PaymentRelationshipsDebtorAccount) Json() string { return string(json) } +// PaymentRelationshipsForwardedPayment payment relationships forwarded payment +// swagger:model PaymentRelationshipsForwardedPayment +type PaymentRelationshipsForwardedPayment struct { + + // Array of Inbound Payments that triggered the creation of this Forwarding Payment. + Data []*RelationshipData `json:"data"` +} + +func PaymentRelationshipsForwardedPaymentWithDefaults(defaults client.Defaults) *PaymentRelationshipsForwardedPayment { + return &PaymentRelationshipsForwardedPayment{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentRelationshipsForwardedPayment) WithData(data []*RelationshipData) *PaymentRelationshipsForwardedPayment { + + m.Data = data + + return m +} + +// Validate validates this payment relationships forwarded payment +func (m *PaymentRelationshipsForwardedPayment) 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 *PaymentRelationshipsForwardedPayment) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarded_payment" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRelationshipsForwardedPayment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRelationshipsForwardedPayment) UnmarshalBinary(b []byte) error { + var res PaymentRelationshipsForwardedPayment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentRelationshipsForwardedPayment) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentRelationshipsForwardingPayment payment relationships forwarding payment +// swagger:model PaymentRelationshipsForwardingPayment +type PaymentRelationshipsForwardingPayment struct { + + // Array of Outbound Payments created to forward the payment. + Data []*RelationshipData `json:"data"` +} + +func PaymentRelationshipsForwardingPaymentWithDefaults(defaults client.Defaults) *PaymentRelationshipsForwardingPayment { + return &PaymentRelationshipsForwardingPayment{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentRelationshipsForwardingPayment) WithData(data []*RelationshipData) *PaymentRelationshipsForwardingPayment { + + m.Data = data + + return m +} + +// Validate validates this payment relationships forwarding payment +func (m *PaymentRelationshipsForwardingPayment) 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 *PaymentRelationshipsForwardingPayment) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarding_payment" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRelationshipsForwardingPayment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRelationshipsForwardingPayment) UnmarshalBinary(b []byte) error { + var res PaymentRelationshipsForwardingPayment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentRelationshipsForwardingPayment) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + // PaymentRelationshipsFxDeal payment relationships fx deal // swagger:model PaymentRelationshipsFxDeal type PaymentRelationshipsFxDeal struct { diff --git a/pkg/generated/models/payment_submission_relationships.go b/pkg/generated/models/payment_submission_relationships.go index 22e43b20..fb04c018 100644 --- a/pkg/generated/models/payment_submission_relationships.go +++ b/pkg/generated/models/payment_submission_relationships.go @@ -23,6 +23,9 @@ type PaymentSubmissionRelationships struct { // payment Payment *RelationshipPayments `json:"payment,omitempty"` + // payment submission task + PaymentSubmissionTask *RelationshipLinks `json:"payment_submission_task,omitempty"` + // validations Validations *RelationshipLinks `json:"validations,omitempty"` } @@ -32,6 +35,8 @@ func PaymentSubmissionRelationshipsWithDefaults(defaults client.Defaults) *Payme Payment: RelationshipPaymentsWithDefaults(defaults), + PaymentSubmissionTask: RelationshipLinksWithDefaults(defaults), + Validations: RelationshipLinksWithDefaults(defaults), } } @@ -48,6 +53,18 @@ func (m *PaymentSubmissionRelationships) WithoutPayment() *PaymentSubmissionRela return m } +func (m *PaymentSubmissionRelationships) WithPaymentSubmissionTask(paymentSubmissionTask RelationshipLinks) *PaymentSubmissionRelationships { + + m.PaymentSubmissionTask = &paymentSubmissionTask + + return m +} + +func (m *PaymentSubmissionRelationships) WithoutPaymentSubmissionTask() *PaymentSubmissionRelationships { + m.PaymentSubmissionTask = nil + return m +} + func (m *PaymentSubmissionRelationships) WithValidations(validations RelationshipLinks) *PaymentSubmissionRelationships { m.Validations = &validations @@ -68,6 +85,10 @@ func (m *PaymentSubmissionRelationships) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validatePaymentSubmissionTask(formats); err != nil { + res = append(res, err) + } + if err := m.validateValidations(formats); err != nil { res = append(res, err) } @@ -96,6 +117,24 @@ func (m *PaymentSubmissionRelationships) validatePayment(formats strfmt.Registry return nil } +func (m *PaymentSubmissionRelationships) validatePaymentSubmissionTask(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentSubmissionTask) { // not required + return nil + } + + if m.PaymentSubmissionTask != nil { + if err := m.PaymentSubmissionTask.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_submission_task") + } + return err + } + } + + return nil +} + func (m *PaymentSubmissionRelationships) validateValidations(formats strfmt.Registry) error { if swag.IsZero(m.Validations) { // not required diff --git a/pkg/generated/models/payment_update.go b/pkg/generated/models/payment_update.go new file mode 100644 index 00000000..51f4e0f5 --- /dev/null +++ b/pkg/generated/models/payment_update.go @@ -0,0 +1,349 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentUpdate payment update +// swagger:model PaymentUpdate +type PaymentUpdate struct { + + // attributes + // Required: true + Attributes *PaymentAttributes `json:"attributes"` + + // created on + // Format: date-time + CreatedOn *strfmt.DateTime `json:"created_on,omitempty"` + + // Unique resource ID + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // modified on + // Format: date-time + ModifiedOn *strfmt.DateTime `json:"modified_on,omitempty"` + + // Unique ID of the organisation this resource is created by + // Required: true + // Format: uuid + OrganisationID *strfmt.UUID `json:"organisation_id"` + + // relationships + Relationships *PaymentUpdateRelationships `json:"relationships,omitempty"` + + // Name of the resource type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // Version number + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func PaymentUpdateWithDefaults(defaults client.Defaults) *PaymentUpdate { + return &PaymentUpdate{ + + Attributes: PaymentAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTimePtr("PaymentUpdate", "created_on"), + + ID: defaults.GetStrfmtUUIDPtr("PaymentUpdate", "id"), + + ModifiedOn: defaults.GetStrfmtDateTimePtr("PaymentUpdate", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUIDPtr("PaymentUpdate", "organisation_id"), + + Relationships: PaymentUpdateRelationshipsWithDefaults(defaults), + + Type: defaults.GetString("PaymentUpdate", "type"), + + Version: defaults.GetInt64Ptr("PaymentUpdate", "version"), + } +} + +func (m *PaymentUpdate) WithAttributes(attributes PaymentAttributes) *PaymentUpdate { + + m.Attributes = &attributes + + return m +} + +func (m *PaymentUpdate) WithoutAttributes() *PaymentUpdate { + m.Attributes = nil + return m +} + +func (m *PaymentUpdate) WithCreatedOn(createdOn strfmt.DateTime) *PaymentUpdate { + + m.CreatedOn = &createdOn + + return m +} + +func (m *PaymentUpdate) WithoutCreatedOn() *PaymentUpdate { + m.CreatedOn = nil + return m +} + +func (m *PaymentUpdate) WithID(id strfmt.UUID) *PaymentUpdate { + + m.ID = &id + + return m +} + +func (m *PaymentUpdate) WithoutID() *PaymentUpdate { + m.ID = nil + return m +} + +func (m *PaymentUpdate) WithModifiedOn(modifiedOn strfmt.DateTime) *PaymentUpdate { + + m.ModifiedOn = &modifiedOn + + return m +} + +func (m *PaymentUpdate) WithoutModifiedOn() *PaymentUpdate { + m.ModifiedOn = nil + return m +} + +func (m *PaymentUpdate) WithOrganisationID(organisationID strfmt.UUID) *PaymentUpdate { + + m.OrganisationID = &organisationID + + return m +} + +func (m *PaymentUpdate) WithoutOrganisationID() *PaymentUpdate { + m.OrganisationID = nil + return m +} + +func (m *PaymentUpdate) WithRelationships(relationships PaymentUpdateRelationships) *PaymentUpdate { + + m.Relationships = &relationships + + return m +} + +func (m *PaymentUpdate) WithoutRelationships() *PaymentUpdate { + m.Relationships = nil + return m +} + +func (m *PaymentUpdate) WithType(typeVar string) *PaymentUpdate { + + m.Type = typeVar + + return m +} + +func (m *PaymentUpdate) WithVersion(version int64) *PaymentUpdate { + + m.Version = &version + + return m +} + +func (m *PaymentUpdate) WithoutVersion() *PaymentUpdate { + m.Version = nil + return m +} + +// Validate validates this payment update +func (m *PaymentUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModifiedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRelationships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentUpdate) validateAttributes(formats strfmt.Registry) error { + + if err := validate.Required("attributes", "body", m.Attributes); err != nil { + return err + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdate) validateCreatedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedOn) { // not required + return nil + } + + if err := validate.FormatOf("created_on", "body", "date-time", m.CreatedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentUpdate) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentUpdate) validateModifiedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.ModifiedOn) { // not required + return nil + } + + if err := validate.FormatOf("modified_on", "body", "date-time", m.ModifiedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentUpdate) validateOrganisationID(formats strfmt.Registry) error { + + if err := validate.Required("organisation_id", "body", m.OrganisationID); err != nil { + return err + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentUpdate) validateRelationships(formats strfmt.Registry) error { + + if swag.IsZero(m.Relationships) { // not required + return nil + } + + if m.Relationships != nil { + if err := m.Relationships.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdate) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *PaymentUpdate) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdate) UnmarshalBinary(b []byte) error { + var res PaymentUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdate) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_update_relationships.go b/pkg/generated/models/payment_update_relationships.go new file mode 100644 index 00000000..85ce05e9 --- /dev/null +++ b/pkg/generated/models/payment_update_relationships.go @@ -0,0 +1,1563 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// PaymentUpdateRelationships payment update relationships +// swagger:model PaymentUpdateRelationships +type PaymentUpdateRelationships struct { + + // beneficiary + Beneficiary *PaymentUpdateRelationshipsBeneficiary `json:"beneficiary,omitempty"` + + // beneficiary account + BeneficiaryAccount *PaymentUpdateRelationshipsBeneficiaryAccount `json:"beneficiary_account,omitempty"` + + // debtor + Debtor *PaymentUpdateRelationshipsDebtor `json:"debtor,omitempty"` + + // debtor account + DebtorAccount *PaymentUpdateRelationshipsDebtorAccount `json:"debtor_account,omitempty"` + + // forwarding payment + ForwardingPayment *PaymentUpdateRelationshipsForwardingPayment `json:"forwarding_payment,omitempty"` + + // fx deal + FxDeal *PaymentUpdateRelationshipsFxDeal `json:"fx_deal,omitempty"` + + // payment admission + PaymentAdmission *PaymentUpdateRelationshipsPaymentAdmission `json:"payment_admission,omitempty"` + + // payment advice + PaymentAdvice *PaymentUpdateRelationshipsPaymentAdvice `json:"payment_advice,omitempty"` + + // payment recall + PaymentRecall *PaymentUpdateRelationshipsPaymentRecall `json:"payment_recall,omitempty"` + + // payment return + PaymentReturn *PaymentUpdateRelationshipsPaymentReturn `json:"payment_return,omitempty"` + + // payment reversal + PaymentReversal *PaymentUpdateRelationshipsPaymentReversal `json:"payment_reversal,omitempty"` + + // payment submission + PaymentSubmission *PaymentUpdateRelationshipsPaymentSubmission `json:"payment_submission,omitempty"` +} + +func PaymentUpdateRelationshipsWithDefaults(defaults client.Defaults) *PaymentUpdateRelationships { + return &PaymentUpdateRelationships{ + + Beneficiary: PaymentUpdateRelationshipsBeneficiaryWithDefaults(defaults), + + BeneficiaryAccount: PaymentUpdateRelationshipsBeneficiaryAccountWithDefaults(defaults), + + Debtor: PaymentUpdateRelationshipsDebtorWithDefaults(defaults), + + DebtorAccount: PaymentUpdateRelationshipsDebtorAccountWithDefaults(defaults), + + ForwardingPayment: PaymentUpdateRelationshipsForwardingPaymentWithDefaults(defaults), + + FxDeal: PaymentUpdateRelationshipsFxDealWithDefaults(defaults), + + PaymentAdmission: PaymentUpdateRelationshipsPaymentAdmissionWithDefaults(defaults), + + PaymentAdvice: PaymentUpdateRelationshipsPaymentAdviceWithDefaults(defaults), + + PaymentRecall: PaymentUpdateRelationshipsPaymentRecallWithDefaults(defaults), + + PaymentReturn: PaymentUpdateRelationshipsPaymentReturnWithDefaults(defaults), + + PaymentReversal: PaymentUpdateRelationshipsPaymentReversalWithDefaults(defaults), + + PaymentSubmission: PaymentUpdateRelationshipsPaymentSubmissionWithDefaults(defaults), + } +} + +func (m *PaymentUpdateRelationships) WithBeneficiary(beneficiary PaymentUpdateRelationshipsBeneficiary) *PaymentUpdateRelationships { + + m.Beneficiary = &beneficiary + + return m +} + +func (m *PaymentUpdateRelationships) WithoutBeneficiary() *PaymentUpdateRelationships { + m.Beneficiary = nil + return m +} + +func (m *PaymentUpdateRelationships) WithBeneficiaryAccount(beneficiaryAccount PaymentUpdateRelationshipsBeneficiaryAccount) *PaymentUpdateRelationships { + + m.BeneficiaryAccount = &beneficiaryAccount + + return m +} + +func (m *PaymentUpdateRelationships) WithoutBeneficiaryAccount() *PaymentUpdateRelationships { + m.BeneficiaryAccount = nil + return m +} + +func (m *PaymentUpdateRelationships) WithDebtor(debtor PaymentUpdateRelationshipsDebtor) *PaymentUpdateRelationships { + + m.Debtor = &debtor + + return m +} + +func (m *PaymentUpdateRelationships) WithoutDebtor() *PaymentUpdateRelationships { + m.Debtor = nil + return m +} + +func (m *PaymentUpdateRelationships) WithDebtorAccount(debtorAccount PaymentUpdateRelationshipsDebtorAccount) *PaymentUpdateRelationships { + + m.DebtorAccount = &debtorAccount + + return m +} + +func (m *PaymentUpdateRelationships) WithoutDebtorAccount() *PaymentUpdateRelationships { + m.DebtorAccount = nil + return m +} + +func (m *PaymentUpdateRelationships) WithForwardingPayment(forwardingPayment PaymentUpdateRelationshipsForwardingPayment) *PaymentUpdateRelationships { + + m.ForwardingPayment = &forwardingPayment + + return m +} + +func (m *PaymentUpdateRelationships) WithoutForwardingPayment() *PaymentUpdateRelationships { + m.ForwardingPayment = nil + return m +} + +func (m *PaymentUpdateRelationships) WithFxDeal(fxDeal PaymentUpdateRelationshipsFxDeal) *PaymentUpdateRelationships { + + m.FxDeal = &fxDeal + + return m +} + +func (m *PaymentUpdateRelationships) WithoutFxDeal() *PaymentUpdateRelationships { + m.FxDeal = nil + return m +} + +func (m *PaymentUpdateRelationships) WithPaymentAdmission(paymentAdmission PaymentUpdateRelationshipsPaymentAdmission) *PaymentUpdateRelationships { + + m.PaymentAdmission = &paymentAdmission + + return m +} + +func (m *PaymentUpdateRelationships) WithoutPaymentAdmission() *PaymentUpdateRelationships { + m.PaymentAdmission = nil + return m +} + +func (m *PaymentUpdateRelationships) WithPaymentAdvice(paymentAdvice PaymentUpdateRelationshipsPaymentAdvice) *PaymentUpdateRelationships { + + m.PaymentAdvice = &paymentAdvice + + return m +} + +func (m *PaymentUpdateRelationships) WithoutPaymentAdvice() *PaymentUpdateRelationships { + m.PaymentAdvice = nil + return m +} + +func (m *PaymentUpdateRelationships) WithPaymentRecall(paymentRecall PaymentUpdateRelationshipsPaymentRecall) *PaymentUpdateRelationships { + + m.PaymentRecall = &paymentRecall + + return m +} + +func (m *PaymentUpdateRelationships) WithoutPaymentRecall() *PaymentUpdateRelationships { + m.PaymentRecall = nil + return m +} + +func (m *PaymentUpdateRelationships) WithPaymentReturn(paymentReturn PaymentUpdateRelationshipsPaymentReturn) *PaymentUpdateRelationships { + + m.PaymentReturn = &paymentReturn + + return m +} + +func (m *PaymentUpdateRelationships) WithoutPaymentReturn() *PaymentUpdateRelationships { + m.PaymentReturn = nil + return m +} + +func (m *PaymentUpdateRelationships) WithPaymentReversal(paymentReversal PaymentUpdateRelationshipsPaymentReversal) *PaymentUpdateRelationships { + + m.PaymentReversal = &paymentReversal + + return m +} + +func (m *PaymentUpdateRelationships) WithoutPaymentReversal() *PaymentUpdateRelationships { + m.PaymentReversal = nil + return m +} + +func (m *PaymentUpdateRelationships) WithPaymentSubmission(paymentSubmission PaymentUpdateRelationshipsPaymentSubmission) *PaymentUpdateRelationships { + + m.PaymentSubmission = &paymentSubmission + + return m +} + +func (m *PaymentUpdateRelationships) WithoutPaymentSubmission() *PaymentUpdateRelationships { + m.PaymentSubmission = nil + return m +} + +// Validate validates this payment update relationships +func (m *PaymentUpdateRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBeneficiary(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBeneficiaryAccount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDebtor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDebtorAccount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateForwardingPayment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFxDeal(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentAdmission(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentAdvice(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRecall(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentReturn(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentReversal(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentSubmission(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentUpdateRelationships) validateBeneficiary(formats strfmt.Registry) error { + + if swag.IsZero(m.Beneficiary) { // not required + return nil + } + + if m.Beneficiary != nil { + if err := m.Beneficiary.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validateBeneficiaryAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.BeneficiaryAccount) { // not required + return nil + } + + if m.BeneficiaryAccount != nil { + if err := m.BeneficiaryAccount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_account") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validateDebtor(formats strfmt.Registry) error { + + if swag.IsZero(m.Debtor) { // not required + return nil + } + + if m.Debtor != nil { + if err := m.Debtor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validateDebtorAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.DebtorAccount) { // not required + return nil + } + + if m.DebtorAccount != nil { + if err := m.DebtorAccount.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_account") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validateForwardingPayment(formats strfmt.Registry) error { + + if swag.IsZero(m.ForwardingPayment) { // not required + return nil + } + + if m.ForwardingPayment != nil { + if err := m.ForwardingPayment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarding_payment") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validateFxDeal(formats strfmt.Registry) error { + + if swag.IsZero(m.FxDeal) { // not required + return nil + } + + if m.FxDeal != nil { + if err := m.FxDeal.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fx_deal") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validatePaymentAdmission(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentAdmission) { // not required + return nil + } + + if m.PaymentAdmission != nil { + if err := m.PaymentAdmission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_admission") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validatePaymentAdvice(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentAdvice) { // not required + return nil + } + + if m.PaymentAdvice != nil { + if err := m.PaymentAdvice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_advice") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validatePaymentRecall(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentRecall) { // not required + return nil + } + + if m.PaymentRecall != nil { + if err := m.PaymentRecall.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_recall") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validatePaymentReturn(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentReturn) { // not required + return nil + } + + if m.PaymentReturn != nil { + if err := m.PaymentReturn.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_return") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validatePaymentReversal(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentReversal) { // not required + return nil + } + + if m.PaymentReversal != nil { + if err := m.PaymentReversal.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_reversal") + } + return err + } + } + + return nil +} + +func (m *PaymentUpdateRelationships) validatePaymentSubmission(formats strfmt.Registry) error { + + if swag.IsZero(m.PaymentSubmission) { // not required + return nil + } + + if m.PaymentSubmission != nil { + if err := m.PaymentSubmission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_submission") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationships) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsBeneficiary payment update relationships beneficiary +// swagger:model PaymentUpdateRelationshipsBeneficiary +type PaymentUpdateRelationshipsBeneficiary struct { + + // Array of beneficiary resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func PaymentUpdateRelationshipsBeneficiaryWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsBeneficiary { + return &PaymentUpdateRelationshipsBeneficiary{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentUpdateRelationshipsBeneficiary) WithData(data []*RelationshipData) *PaymentUpdateRelationshipsBeneficiary { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships beneficiary +func (m *PaymentUpdateRelationshipsBeneficiary) 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 *PaymentUpdateRelationshipsBeneficiary) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsBeneficiary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsBeneficiary) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsBeneficiary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsBeneficiary) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsBeneficiaryAccount payment update relationships beneficiary account +// swagger:model PaymentUpdateRelationshipsBeneficiaryAccount +type PaymentUpdateRelationshipsBeneficiaryAccount struct { + + // Array of beneficiary account resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func PaymentUpdateRelationshipsBeneficiaryAccountWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsBeneficiaryAccount { + return &PaymentUpdateRelationshipsBeneficiaryAccount{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentUpdateRelationshipsBeneficiaryAccount) WithData(data []*RelationshipData) *PaymentUpdateRelationshipsBeneficiaryAccount { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships beneficiary account +func (m *PaymentUpdateRelationshipsBeneficiaryAccount) 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 *PaymentUpdateRelationshipsBeneficiaryAccount) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("beneficiary_account" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsBeneficiaryAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsBeneficiaryAccount) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsBeneficiaryAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsBeneficiaryAccount) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsDebtor payment update relationships debtor +// swagger:model PaymentUpdateRelationshipsDebtor +type PaymentUpdateRelationshipsDebtor struct { + + // Array of debtor resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func PaymentUpdateRelationshipsDebtorWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsDebtor { + return &PaymentUpdateRelationshipsDebtor{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentUpdateRelationshipsDebtor) WithData(data []*RelationshipData) *PaymentUpdateRelationshipsDebtor { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships debtor +func (m *PaymentUpdateRelationshipsDebtor) 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 *PaymentUpdateRelationshipsDebtor) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsDebtor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsDebtor) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsDebtor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsDebtor) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsDebtorAccount payment update relationships debtor account +// swagger:model PaymentUpdateRelationshipsDebtorAccount +type PaymentUpdateRelationshipsDebtorAccount struct { + + // Array of debtor account resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func PaymentUpdateRelationshipsDebtorAccountWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsDebtorAccount { + return &PaymentUpdateRelationshipsDebtorAccount{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentUpdateRelationshipsDebtorAccount) WithData(data []*RelationshipData) *PaymentUpdateRelationshipsDebtorAccount { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships debtor account +func (m *PaymentUpdateRelationshipsDebtorAccount) 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 *PaymentUpdateRelationshipsDebtorAccount) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("debtor_account" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsDebtorAccount) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsDebtorAccount) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsDebtorAccount + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsDebtorAccount) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsForwardingPayment payment update relationships forwarding payment +// swagger:model PaymentUpdateRelationshipsForwardingPayment +type PaymentUpdateRelationshipsForwardingPayment struct { + + // ID of the Outbound Payment created to forward the payment. + Data []*RelationshipData `json:"data"` +} + +func PaymentUpdateRelationshipsForwardingPaymentWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsForwardingPayment { + return &PaymentUpdateRelationshipsForwardingPayment{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentUpdateRelationshipsForwardingPayment) WithData(data []*RelationshipData) *PaymentUpdateRelationshipsForwardingPayment { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships forwarding payment +func (m *PaymentUpdateRelationshipsForwardingPayment) 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 *PaymentUpdateRelationshipsForwardingPayment) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("forwarding_payment" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsForwardingPayment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsForwardingPayment) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsForwardingPayment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsForwardingPayment) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsFxDeal payment update relationships fx deal +// swagger:model PaymentUpdateRelationshipsFxDeal +type PaymentUpdateRelationshipsFxDeal struct { + + // Array of FXDeal resources related to the payment + Data []*RelationshipData `json:"data"` +} + +func PaymentUpdateRelationshipsFxDealWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsFxDeal { + return &PaymentUpdateRelationshipsFxDeal{ + + Data: make([]*RelationshipData, 0), + } +} + +func (m *PaymentUpdateRelationshipsFxDeal) WithData(data []*RelationshipData) *PaymentUpdateRelationshipsFxDeal { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships fx deal +func (m *PaymentUpdateRelationshipsFxDeal) 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 *PaymentUpdateRelationshipsFxDeal) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fx_deal" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsFxDeal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsFxDeal) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsFxDeal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsFxDeal) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsPaymentAdmission payment update relationships payment admission +// swagger:model PaymentUpdateRelationshipsPaymentAdmission +type PaymentUpdateRelationshipsPaymentAdmission struct { + + // Array of Payment Admission resources related to the payment + Data []*PaymentAdmission `json:"data"` +} + +func PaymentUpdateRelationshipsPaymentAdmissionWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsPaymentAdmission { + return &PaymentUpdateRelationshipsPaymentAdmission{ + + Data: make([]*PaymentAdmission, 0), + } +} + +func (m *PaymentUpdateRelationshipsPaymentAdmission) WithData(data []*PaymentAdmission) *PaymentUpdateRelationshipsPaymentAdmission { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships payment admission +func (m *PaymentUpdateRelationshipsPaymentAdmission) 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 *PaymentUpdateRelationshipsPaymentAdmission) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_admission" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentAdmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentAdmission) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsPaymentAdmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsPaymentAdmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsPaymentAdvice payment update relationships payment advice +// swagger:model PaymentUpdateRelationshipsPaymentAdvice +type PaymentUpdateRelationshipsPaymentAdvice struct { + + // Array of Payment Advice resources related to the payment + Data []*PaymentAdvice `json:"data"` +} + +func PaymentUpdateRelationshipsPaymentAdviceWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsPaymentAdvice { + return &PaymentUpdateRelationshipsPaymentAdvice{ + + Data: make([]*PaymentAdvice, 0), + } +} + +func (m *PaymentUpdateRelationshipsPaymentAdvice) WithData(data []*PaymentAdvice) *PaymentUpdateRelationshipsPaymentAdvice { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships payment advice +func (m *PaymentUpdateRelationshipsPaymentAdvice) 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 *PaymentUpdateRelationshipsPaymentAdvice) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_advice" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentAdvice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentAdvice) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsPaymentAdvice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsPaymentAdvice) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsPaymentRecall payment update relationships payment recall +// swagger:model PaymentUpdateRelationshipsPaymentRecall +type PaymentUpdateRelationshipsPaymentRecall struct { + + // Array of Payment Recall resources related to the payment + Data []*Recall `json:"data"` +} + +func PaymentUpdateRelationshipsPaymentRecallWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsPaymentRecall { + return &PaymentUpdateRelationshipsPaymentRecall{ + + Data: make([]*Recall, 0), + } +} + +func (m *PaymentUpdateRelationshipsPaymentRecall) WithData(data []*Recall) *PaymentUpdateRelationshipsPaymentRecall { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships payment recall +func (m *PaymentUpdateRelationshipsPaymentRecall) 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 *PaymentUpdateRelationshipsPaymentRecall) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_recall" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentRecall) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentRecall) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsPaymentRecall + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsPaymentRecall) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsPaymentReturn payment update relationships payment return +// swagger:model PaymentUpdateRelationshipsPaymentReturn +type PaymentUpdateRelationshipsPaymentReturn struct { + + // Array of Payment Return resources related to the payment + Data []*ReturnPayment `json:"data"` +} + +func PaymentUpdateRelationshipsPaymentReturnWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsPaymentReturn { + return &PaymentUpdateRelationshipsPaymentReturn{ + + Data: make([]*ReturnPayment, 0), + } +} + +func (m *PaymentUpdateRelationshipsPaymentReturn) WithData(data []*ReturnPayment) *PaymentUpdateRelationshipsPaymentReturn { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships payment return +func (m *PaymentUpdateRelationshipsPaymentReturn) 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 *PaymentUpdateRelationshipsPaymentReturn) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_return" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentReturn) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentReturn) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsPaymentReturn + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsPaymentReturn) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsPaymentReversal payment update relationships payment reversal +// swagger:model PaymentUpdateRelationshipsPaymentReversal +type PaymentUpdateRelationshipsPaymentReversal struct { + + // Array of Payment Reversal resources related to the payment + Data []*ReversalPayment `json:"data"` +} + +func PaymentUpdateRelationshipsPaymentReversalWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsPaymentReversal { + return &PaymentUpdateRelationshipsPaymentReversal{ + + Data: make([]*ReversalPayment, 0), + } +} + +func (m *PaymentUpdateRelationshipsPaymentReversal) WithData(data []*ReversalPayment) *PaymentUpdateRelationshipsPaymentReversal { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships payment reversal +func (m *PaymentUpdateRelationshipsPaymentReversal) 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 *PaymentUpdateRelationshipsPaymentReversal) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_reversal" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentReversal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentReversal) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsPaymentReversal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsPaymentReversal) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentUpdateRelationshipsPaymentSubmission payment update relationships payment submission +// swagger:model PaymentUpdateRelationshipsPaymentSubmission +type PaymentUpdateRelationshipsPaymentSubmission struct { + + // Array of Payment Submission resources related to the payment + Data []*PaymentSubmission `json:"data"` +} + +func PaymentUpdateRelationshipsPaymentSubmissionWithDefaults(defaults client.Defaults) *PaymentUpdateRelationshipsPaymentSubmission { + return &PaymentUpdateRelationshipsPaymentSubmission{ + + Data: make([]*PaymentSubmission, 0), + } +} + +func (m *PaymentUpdateRelationshipsPaymentSubmission) WithData(data []*PaymentSubmission) *PaymentUpdateRelationshipsPaymentSubmission { + + m.Data = data + + return m +} + +// Validate validates this payment update relationships payment submission +func (m *PaymentUpdateRelationshipsPaymentSubmission) 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 *PaymentUpdateRelationshipsPaymentSubmission) validateData(formats strfmt.Registry) error { + + if swag.IsZero(m.Data) { // not required + return nil + } + + for i := 0; i < len(m.Data); i++ { + if swag.IsZero(m.Data[i]) { // not required + continue + } + + if m.Data[i] != nil { + if err := m.Data[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment_submission" + "." + "data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentSubmission) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentUpdateRelationshipsPaymentSubmission) UnmarshalBinary(b []byte) error { + var res PaymentUpdateRelationshipsPaymentSubmission + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentUpdateRelationshipsPaymentSubmission) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/resource_type.go b/pkg/generated/models/resource_type.go index 7aba0f3a..aacd14ef 100644 --- a/pkg/generated/models/resource_type.go +++ b/pkg/generated/models/resource_type.go @@ -21,164 +21,161 @@ type ResourceType string const ( - // ResourceTypeReversalAdmissions captures enum value "reversal_admissions" - ResourceTypeReversalAdmissions ResourceType = "reversal_admissions" - - // ResourceTypePaymentSubmissionValidations captures enum value "payment_submission_validations" - ResourceTypePaymentSubmissionValidations ResourceType = "payment_submission_validations" - - // ResourceTypePaymentAdviceSubmissions captures enum value "payment_advice_submissions" - ResourceTypePaymentAdviceSubmissions ResourceType = "payment_advice_submissions" + // ResourceTypeRecallDecisions captures enum value "recall_decisions" + ResourceTypeRecallDecisions ResourceType = "recall_decisions" - // ResourceTypeParties captures enum value "parties" - ResourceTypeParties ResourceType = "parties" + // ResourceTypeRecallSubmissionValidations captures enum value "recall_submission_validations" + ResourceTypeRecallSubmissionValidations ResourceType = "recall_submission_validations" - // ResourceTypeAccountAmendmentSubmissionValidations captures enum value "account_amendment_submission_validations" - ResourceTypeAccountAmendmentSubmissionValidations ResourceType = "account_amendment_submission_validations" + // ResourceTypeAccountRoutings captures enum value "account_routings" + ResourceTypeAccountRoutings ResourceType = "account_routings" // ResourceTypeContacts captures enum value "contacts" ResourceTypeContacts ResourceType = "contacts" - // ResourceTypeLimits captures enum value "limits" - ResourceTypeLimits ResourceType = "limits" + // ResourceTypeReturnSubmissionTasks captures enum value "return_submission_tasks" + ResourceTypeReturnSubmissionTasks ResourceType = "return_submission_tasks" - // ResourceTypeRecallReversalAdmissions captures enum value "recall_reversal_admissions" - ResourceTypeRecallReversalAdmissions ResourceType = "recall_reversal_admissions" + // ResourceTypePartyAccounts captures enum value "party_accounts" + ResourceTypePartyAccounts ResourceType = "party_accounts" - // ResourceTypeReversals captures enum value "reversals" - ResourceTypeReversals ResourceType = "reversals" + // ResourceTypeBics captures enum value "bics" + ResourceTypeBics ResourceType = "bics" - // ResourceTypeAccountRequests captures enum value "account_requests" - ResourceTypeAccountRequests ResourceType = "account_requests" + // ResourceTypeAccounts captures enum value "accounts" + ResourceTypeAccounts ResourceType = "accounts" - // ResourceTypeRecallSubmissionValidations captures enum value "recall_submission_validations" - ResourceTypeRecallSubmissionValidations ResourceType = "recall_submission_validations" + // ResourceTypeReturnSubmissionValidations captures enum value "return_submission_validations" + ResourceTypeReturnSubmissionValidations ResourceType = "return_submission_validations" - // ResourceTypeRecallSubmissions captures enum value "recall_submissions" - ResourceTypeRecallSubmissions ResourceType = "recall_submissions" + // ResourceTypeAccountEvents captures enum value "account_events" + ResourceTypeAccountEvents ResourceType = "account_events" - // ResourceTypeAccountRequestSubmissionValidations captures enum value "account_request_submission_validations" - ResourceTypeAccountRequestSubmissionValidations ResourceType = "account_request_submission_validations" + // ResourceTypePaymentAdviceSubmissionValidations captures enum value "payment_advice_submission_validations" + ResourceTypePaymentAdviceSubmissionValidations ResourceType = "payment_advice_submission_validations" - // ResourceTypePayments captures enum value "payments" - ResourceTypePayments ResourceType = "payments" + // ResourceTypeBranchIdentifications captures enum value "branch_identifications" + ResourceTypeBranchIdentifications ResourceType = "branch_identifications" + + // ResourceTypeAccountAmendmentSubmissions captures enum value "account_amendment_submissions" + ResourceTypeAccountAmendmentSubmissions ResourceType = "account_amendment_submissions" + + // ResourceTypeReversalSubmissionValidations captures enum value "reversal_submission_validations" + ResourceTypeReversalSubmissionValidations ResourceType = "reversal_submission_validations" // ResourceTypeReturnSubmissions captures enum value "return_submissions" ResourceTypeReturnSubmissions ResourceType = "return_submissions" - // ResourceTypeSchemeMessageAdmissions captures enum value "scheme_message_admissions" - ResourceTypeSchemeMessageAdmissions ResourceType = "scheme_message_admissions" + // ResourceTypeReversalAdmissionTasks captures enum value "reversal_admission_tasks" + ResourceTypeReversalAdmissionTasks ResourceType = "reversal_admission_tasks" + + // ResourceTypeRecallDecisionSubmissionValidations captures enum value "recall_decision_submission_validations" + ResourceTypeRecallDecisionSubmissionValidations ResourceType = "recall_decision_submission_validations" // ResourceTypePaymentBatches captures enum value "payment_batches" ResourceTypePaymentBatches ResourceType = "payment_batches" - // ResourceTypeReversalSubmissionValidations captures enum value "reversal_submission_validations" - ResourceTypeReversalSubmissionValidations ResourceType = "reversal_submission_validations" + // ResourceTypeBranches captures enum value "branches" + ResourceTypeBranches ResourceType = "branches" - // ResourceTypeAccountIndirects captures enum value "account_indirects" - ResourceTypeAccountIndirects ResourceType = "account_indirects" + // ResourceTypeRecallAdmissions captures enum value "recall_admissions" + ResourceTypeRecallAdmissions ResourceType = "recall_admissions" - // ResourceTypeBankIds captures enum value "bank_ids" - ResourceTypeBankIds ResourceType = "bank_ids" + // ResourceTypeRecallReversals captures enum value "recall_reversals" + ResourceTypeRecallReversals ResourceType = "recall_reversals" - // ResourceTypeAccounts captures enum value "accounts" - ResourceTypeAccounts ResourceType = "accounts" + // ResourceTypePaymentSubmissions captures enum value "payment_submissions" + ResourceTypePaymentSubmissions ResourceType = "payment_submissions" - // ResourceTypePaymentAdmissions captures enum value "payment_admissions" - ResourceTypePaymentAdmissions ResourceType = "payment_admissions" + // ResourceTypeNameVerifications captures enum value "name_verifications" + ResourceTypeNameVerifications ResourceType = "name_verifications" - // ResourceTypePaymentDefaults captures enum value "payment_defaults" - ResourceTypePaymentDefaults ResourceType = "payment_defaults" + // ResourceTypePaymentAdvices captures enum value "payment_advices" + ResourceTypePaymentAdvices ResourceType = "payment_advices" - // ResourceTypeAccountRequestSubmissions captures enum value "account_request_submissions" - ResourceTypeAccountRequestSubmissions ResourceType = "account_request_submissions" + // ResourceTypeRecallDecisionSubmissions captures enum value "recall_decision_submissions" + ResourceTypeRecallDecisionSubmissions ResourceType = "recall_decision_submissions" - // ResourceTypeRecalls captures enum value "recalls" - ResourceTypeRecalls ResourceType = "recalls" + // ResourceTypeReversals captures enum value "reversals" + ResourceTypeReversals ResourceType = "reversals" - // ResourceTypeAccountAmendments captures enum value "account_amendments" - ResourceTypeAccountAmendments ResourceType = "account_amendments" + // ResourceTypePaymentAdviceSubmissions captures enum value "payment_advice_submissions" + ResourceTypePaymentAdviceSubmissions ResourceType = "payment_advice_submissions" - // ResourceTypeReturnReversals captures enum value "return_reversals" - ResourceTypeReturnReversals ResourceType = "return_reversals" + // ResourceTypeLimits captures enum value "limits" + ResourceTypeLimits ResourceType = "limits" - // ResourceTypeBics captures enum value "bics" - ResourceTypeBics ResourceType = "bics" + // ResourceTypeNameVerificationSubmissions captures enum value "name_verification_submissions" + ResourceTypeNameVerificationSubmissions ResourceType = "name_verification_submissions" - // ResourceTypeAccountAmendmentSubmissions captures enum value "account_amendment_submissions" - ResourceTypeAccountAmendmentSubmissions ResourceType = "account_amendment_submissions" + // ResourceTypeAccountIdentifications captures enum value "account_identifications" + ResourceTypeAccountIdentifications ResourceType = "account_identifications" - // ResourceTypeRecallDecisions captures enum value "recall_decisions" - ResourceTypeRecallDecisions ResourceType = "recall_decisions" + // ResourceTypePaymentSubmissionValidations captures enum value "payment_submission_validations" + ResourceTypePaymentSubmissionValidations ResourceType = "payment_submission_validations" - // ResourceTypeSchemeMessages captures enum value "scheme_messages" - ResourceTypeSchemeMessages ResourceType = "scheme_messages" + // ResourceTypeReversalAdmissions captures enum value "reversal_admissions" + ResourceTypeReversalAdmissions ResourceType = "reversal_admissions" - // ResourceTypeReturnReversalAdmissions captures enum value "return_reversal_admissions" - ResourceTypeReturnReversalAdmissions ResourceType = "return_reversal_admissions" + // ResourceTypeReturnAdmissions captures enum value "return_admissions" + ResourceTypeReturnAdmissions ResourceType = "return_admissions" - // ResourceTypeReversalSubmissions captures enum value "reversal_submissions" - ResourceTypeReversalSubmissions ResourceType = "reversal_submissions" + // ResourceTypeNameVerificationAdmissions captures enum value "name_verification_admissions" + ResourceTypeNameVerificationAdmissions ResourceType = "name_verification_admissions" + + // ResourceTypeRecallDecisionAdmissions captures enum value "recall_decision_admissions" + ResourceTypeRecallDecisionAdmissions ResourceType = "recall_decision_admissions" // ResourceTypePaymentSubmissionTasks captures enum value "payment_submission_tasks" ResourceTypePaymentSubmissionTasks ResourceType = "payment_submission_tasks" - // ResourceTypeRecallReversals captures enum value "recall_reversals" - ResourceTypeRecallReversals ResourceType = "recall_reversals" - - // ResourceTypePositions captures enum value "positions" - ResourceTypePositions ResourceType = "positions" - - // ResourceTypeAccountRoutings captures enum value "account_routings" - ResourceTypeAccountRoutings ResourceType = "account_routings" + // ResourceTypeAccountAmendments captures enum value "account_amendments" + ResourceTypeAccountAmendments ResourceType = "account_amendments" - // ResourceTypeAccountIdentifications captures enum value "account_identifications" - ResourceTypeAccountIdentifications ResourceType = "account_identifications" + // ResourceTypeAccountAmendmentSubmissionValidations captures enum value "account_amendment_submission_validations" + ResourceTypeAccountAmendmentSubmissionValidations ResourceType = "account_amendment_submission_validations" - // ResourceTypeBranchIdentifications captures enum value "branch_identifications" - ResourceTypeBranchIdentifications ResourceType = "branch_identifications" + // ResourceTypeReturnReversalAdmissions captures enum value "return_reversal_admissions" + ResourceTypeReturnReversalAdmissions ResourceType = "return_reversal_admissions" - // ResourceTypeRecallDecisionSubmissionValidations captures enum value "recall_decision_submission_validations" - ResourceTypeRecallDecisionSubmissionValidations ResourceType = "recall_decision_submission_validations" + // ResourceTypeAccountRequests captures enum value "account_requests" + ResourceTypeAccountRequests ResourceType = "account_requests" - // ResourceTypeRecallDecisionAdmissions captures enum value "recall_decision_admissions" - ResourceTypeRecallDecisionAdmissions ResourceType = "recall_decision_admissions" + // ResourceTypeAccountIndirects captures enum value "account_indirects" + ResourceTypeAccountIndirects ResourceType = "account_indirects" - // ResourceTypeFxDeals captures enum value "fx_deals" - ResourceTypeFxDeals ResourceType = "fx_deals" + // ResourceTypePaymentDefaults captures enum value "payment_defaults" + ResourceTypePaymentDefaults ResourceType = "payment_defaults" - // ResourceTypeContactAccounts captures enum value "contact_accounts" - ResourceTypeContactAccounts ResourceType = "contact_accounts" + // ResourceTypeSchemeMessageAdmissions captures enum value "scheme_message_admissions" + ResourceTypeSchemeMessageAdmissions ResourceType = "scheme_message_admissions" - // ResourceTypePartyAccounts captures enum value "party_accounts" - ResourceTypePartyAccounts ResourceType = "party_accounts" + // ResourceTypeParties captures enum value "parties" + ResourceTypeParties ResourceType = "parties" - // ResourceTypeRecallAdmissions captures enum value "recall_admissions" - ResourceTypeRecallAdmissions ResourceType = "recall_admissions" + // ResourceTypePaymentAdmissions captures enum value "payment_admissions" + ResourceTypePaymentAdmissions ResourceType = "payment_admissions" - // ResourceTypePaymentAdviceSubmissionValidations captures enum value "payment_advice_submission_validations" - ResourceTypePaymentAdviceSubmissionValidations ResourceType = "payment_advice_submission_validations" + // ResourceTypeAccountRequestSubmissions captures enum value "account_request_submissions" + ResourceTypeAccountRequestSubmissions ResourceType = "account_request_submissions" - // ResourceTypeReturnAdmissions captures enum value "return_admissions" - ResourceTypeReturnAdmissions ResourceType = "return_admissions" + // ResourceTypeAccountRequestSubmissionValidations captures enum value "account_request_submission_validations" + ResourceTypeAccountRequestSubmissionValidations ResourceType = "account_request_submission_validations" - // ResourceTypePaymentAdvices captures enum value "payment_advices" - ResourceTypePaymentAdvices ResourceType = "payment_advices" + // ResourceTypeBankIds captures enum value "bank_ids" + ResourceTypeBankIds ResourceType = "bank_ids" - // ResourceTypeReturnSubmissionValidations captures enum value "return_submission_validations" - ResourceTypeReturnSubmissionValidations ResourceType = "return_submission_validations" + // ResourceTypeReturnReversals captures enum value "return_reversals" + ResourceTypeReturnReversals ResourceType = "return_reversals" - // ResourceTypeAccountEvents captures enum value "account_events" - ResourceTypeAccountEvents ResourceType = "account_events" + // ResourceTypeRecallSubmissions captures enum value "recall_submissions" + ResourceTypeRecallSubmissions ResourceType = "recall_submissions" // ResourceTypePaymentAutomaticReturns captures enum value "payment_automatic_returns" ResourceTypePaymentAutomaticReturns ResourceType = "payment_automatic_returns" - // ResourceTypeRecallDecisionSubmissions captures enum value "recall_decision_submissions" - ResourceTypeRecallDecisionSubmissions ResourceType = "recall_decision_submissions" - - // ResourceTypeAccountConfigurations captures enum value "account_configurations" - ResourceTypeAccountConfigurations ResourceType = "account_configurations" + // ResourceTypeContactAccounts captures enum value "contact_accounts" + ResourceTypeContactAccounts ResourceType = "contact_accounts" // ResourceTypeDirectAccount captures enum value "direct_account" ResourceTypeDirectAccount ResourceType = "direct_account" @@ -186,14 +183,32 @@ const ( // ResourceTypePaymentAdmissionTasks captures enum value "payment_admission_tasks" ResourceTypePaymentAdmissionTasks ResourceType = "payment_admission_tasks" + // ResourceTypePayments captures enum value "payments" + ResourceTypePayments ResourceType = "payments" + + // ResourceTypeAccountConfigurations captures enum value "account_configurations" + ResourceTypeAccountConfigurations ResourceType = "account_configurations" + // ResourceTypeReturns captures enum value "returns" ResourceTypeReturns ResourceType = "returns" - // ResourceTypeBranches captures enum value "branches" - ResourceTypeBranches ResourceType = "branches" + // ResourceTypePositions captures enum value "positions" + ResourceTypePositions ResourceType = "positions" - // ResourceTypePaymentSubmissions captures enum value "payment_submissions" - ResourceTypePaymentSubmissions ResourceType = "payment_submissions" + // ResourceTypeSchemeMessages captures enum value "scheme_messages" + ResourceTypeSchemeMessages ResourceType = "scheme_messages" + + // ResourceTypeFxDeals captures enum value "fx_deals" + ResourceTypeFxDeals ResourceType = "fx_deals" + + // ResourceTypeRecalls captures enum value "recalls" + ResourceTypeRecalls ResourceType = "recalls" + + // ResourceTypeRecallReversalAdmissions captures enum value "recall_reversal_admissions" + ResourceTypeRecallReversalAdmissions ResourceType = "recall_reversal_admissions" + + // ResourceTypeReversalSubmissions captures enum value "reversal_submissions" + ResourceTypeReversalSubmissions ResourceType = "reversal_submissions" ) // for schema @@ -201,7 +216,7 @@ var resourceTypeEnum []interface{} func init() { var res []ResourceType - if err := json.Unmarshal([]byte(`["reversal_admissions","payment_submission_validations","payment_advice_submissions","parties","account_amendment_submission_validations","contacts","limits","recall_reversal_admissions","reversals","account_requests","recall_submission_validations","recall_submissions","account_request_submission_validations","payments","return_submissions","scheme_message_admissions","payment_batches","reversal_submission_validations","account_indirects","bank_ids","accounts","payment_admissions","payment_defaults","account_request_submissions","recalls","account_amendments","return_reversals","bics","account_amendment_submissions","recall_decisions","scheme_messages","return_reversal_admissions","reversal_submissions","payment_submission_tasks","recall_reversals","positions","account_routings","account_identifications","branch_identifications","recall_decision_submission_validations","recall_decision_admissions","fx_deals","contact_accounts","party_accounts","recall_admissions","payment_advice_submission_validations","return_admissions","payment_advices","return_submission_validations","account_events","payment_automatic_returns","recall_decision_submissions","account_configurations","direct_account","payment_admission_tasks","returns","branches","payment_submissions"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["recall_decisions","recall_submission_validations","account_routings","contacts","return_submission_tasks","party_accounts","bics","accounts","return_submission_validations","account_events","payment_advice_submission_validations","branch_identifications","account_amendment_submissions","reversal_submission_validations","return_submissions","reversal_admission_tasks","recall_decision_submission_validations","payment_batches","branches","recall_admissions","recall_reversals","payment_submissions","name_verifications","payment_advices","recall_decision_submissions","reversals","payment_advice_submissions","limits","name_verification_submissions","account_identifications","payment_submission_validations","reversal_admissions","return_admissions","name_verification_admissions","recall_decision_admissions","payment_submission_tasks","account_amendments","account_amendment_submission_validations","return_reversal_admissions","account_requests","account_indirects","payment_defaults","scheme_message_admissions","parties","payment_admissions","account_request_submissions","account_request_submission_validations","bank_ids","return_reversals","recall_submissions","payment_automatic_returns","contact_accounts","direct_account","payment_admission_tasks","payments","account_configurations","returns","positions","scheme_messages","fx_deals","recalls","recall_reversal_admissions","reversal_submissions"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/generated/models/return_payment.go b/pkg/generated/models/return_payment.go index 4e7e5a22..1c505b5c 100644 --- a/pkg/generated/models/return_payment.go +++ b/pkg/generated/models/return_payment.go @@ -8,6 +8,7 @@ package models import ( "encoding/json" "log" + "strconv" "github.com/form3tech-oss/go-form3/v6/pkg/client" strfmt "github.com/go-openapi/strfmt" @@ -382,6 +383,10 @@ type ReturnPaymentAttributes struct { // settlement Settlement *Settlement `json:"settlement,omitempty"` + + // All purpose list of key-value pairs specific data stored on the return. + // Max Items: 5 + UserDefinedData []*UserDefinedData `json:"user_defined_data"` } func ReturnPaymentAttributesWithDefaults(defaults client.Defaults) *ReturnPaymentAttributes { @@ -404,6 +409,8 @@ func ReturnPaymentAttributesWithDefaults(defaults client.Defaults) *ReturnPaymen SchemeTransactionID: defaults.GetString("ReturnPaymentAttributes", "scheme_transaction_id"), Settlement: SettlementWithDefaults(defaults), + + UserDefinedData: make([]*UserDefinedData, 0), } } @@ -490,6 +497,13 @@ func (m *ReturnPaymentAttributes) WithoutSettlement() *ReturnPaymentAttributes { return m } +func (m *ReturnPaymentAttributes) WithUserDefinedData(userDefinedData []*UserDefinedData) *ReturnPaymentAttributes { + + m.UserDefinedData = userDefinedData + + return m +} + // Validate validates this return payment attributes func (m *ReturnPaymentAttributes) Validate(formats strfmt.Registry) error { var res []error @@ -510,6 +524,10 @@ func (m *ReturnPaymentAttributes) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserDefinedData(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -573,6 +591,37 @@ func (m *ReturnPaymentAttributes) validateSettlement(formats strfmt.Registry) er return nil } +func (m *ReturnPaymentAttributes) validateUserDefinedData(formats strfmt.Registry) error { + + if swag.IsZero(m.UserDefinedData) { // not required + return nil + } + + iUserDefinedDataSize := int64(len(m.UserDefinedData)) + + if err := validate.MaxItems("attributes"+"."+"user_defined_data", "body", iUserDefinedDataSize, 5); err != nil { + return err + } + + for i := 0; i < len(m.UserDefinedData); i++ { + if swag.IsZero(m.UserDefinedData[i]) { // not required + continue + } + + if m.UserDefinedData[i] != nil { + if err := m.UserDefinedData[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "user_defined_data" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ReturnPaymentAttributes) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/generated/models/return_submission_relationships.go b/pkg/generated/models/return_submission_relationships.go index 470d09a0..4f3f86a0 100644 --- a/pkg/generated/models/return_submission_relationships.go +++ b/pkg/generated/models/return_submission_relationships.go @@ -26,6 +26,9 @@ type ReturnSubmissionRelationships struct { // payment return PaymentReturn *RelationshipReturns `json:"payment_return,omitempty"` + // return submission task + ReturnSubmissionTask *RelationshipLinks `json:"return_submission_task,omitempty"` + // validations Validations *RelationshipLinks `json:"validations,omitempty"` } @@ -37,6 +40,8 @@ func ReturnSubmissionRelationshipsWithDefaults(defaults client.Defaults) *Return PaymentReturn: RelationshipReturnsWithDefaults(defaults), + ReturnSubmissionTask: RelationshipLinksWithDefaults(defaults), + Validations: RelationshipLinksWithDefaults(defaults), } } @@ -65,6 +70,18 @@ func (m *ReturnSubmissionRelationships) WithoutPaymentReturn() *ReturnSubmission return m } +func (m *ReturnSubmissionRelationships) WithReturnSubmissionTask(returnSubmissionTask RelationshipLinks) *ReturnSubmissionRelationships { + + m.ReturnSubmissionTask = &returnSubmissionTask + + return m +} + +func (m *ReturnSubmissionRelationships) WithoutReturnSubmissionTask() *ReturnSubmissionRelationships { + m.ReturnSubmissionTask = nil + return m +} + func (m *ReturnSubmissionRelationships) WithValidations(validations RelationshipLinks) *ReturnSubmissionRelationships { m.Validations = &validations @@ -89,6 +106,10 @@ func (m *ReturnSubmissionRelationships) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateReturnSubmissionTask(formats); err != nil { + res = append(res, err) + } + if err := m.validateValidations(formats); err != nil { res = append(res, err) } @@ -135,6 +156,24 @@ func (m *ReturnSubmissionRelationships) validatePaymentReturn(formats strfmt.Reg return nil } +func (m *ReturnSubmissionRelationships) validateReturnSubmissionTask(formats strfmt.Registry) error { + + if swag.IsZero(m.ReturnSubmissionTask) { // not required + return nil + } + + if m.ReturnSubmissionTask != nil { + if err := m.ReturnSubmissionTask.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("return_submission_task") + } + return err + } + } + + return nil +} + func (m *ReturnSubmissionRelationships) validateValidations(formats strfmt.Registry) error { if swag.IsZero(m.Validations) { // not required diff --git a/pkg/generated/models/return_submission_task.go b/pkg/generated/models/return_submission_task.go new file mode 100644 index 00000000..dfd7fb6b --- /dev/null +++ b/pkg/generated/models/return_submission_task.go @@ -0,0 +1,453 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReturnSubmissionTask return submission task +// swagger:model ReturnSubmissionTask +type ReturnSubmissionTask struct { + + // attributes + Attributes *ReturnSubmissionTaskAttributes `json:"attributes,omitempty"` + + // created on + // Format: date-time + CreatedOn strfmt.DateTime `json:"created_on,omitempty"` + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // modified on + // Format: date-time + ModifiedOn strfmt.DateTime `json:"modified_on,omitempty"` + + // Unique ID of the organisation this resource is created by + // Format: uuid + OrganisationID strfmt.UUID `json:"organisation_id,omitempty"` + + // Name of the resource type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // Version number + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func ReturnSubmissionTaskWithDefaults(defaults client.Defaults) *ReturnSubmissionTask { + return &ReturnSubmissionTask{ + + Attributes: ReturnSubmissionTaskAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTime("ReturnSubmissionTask", "created_on"), + + ID: defaults.GetStrfmtUUID("ReturnSubmissionTask", "id"), + + ModifiedOn: defaults.GetStrfmtDateTime("ReturnSubmissionTask", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUID("ReturnSubmissionTask", "organisation_id"), + + Type: defaults.GetString("ReturnSubmissionTask", "type"), + + Version: defaults.GetInt64Ptr("ReturnSubmissionTask", "version"), + } +} + +func (m *ReturnSubmissionTask) WithAttributes(attributes ReturnSubmissionTaskAttributes) *ReturnSubmissionTask { + + m.Attributes = &attributes + + return m +} + +func (m *ReturnSubmissionTask) WithoutAttributes() *ReturnSubmissionTask { + m.Attributes = nil + return m +} + +func (m *ReturnSubmissionTask) WithCreatedOn(createdOn strfmt.DateTime) *ReturnSubmissionTask { + + m.CreatedOn = createdOn + + return m +} + +func (m *ReturnSubmissionTask) WithID(id strfmt.UUID) *ReturnSubmissionTask { + + m.ID = id + + return m +} + +func (m *ReturnSubmissionTask) WithModifiedOn(modifiedOn strfmt.DateTime) *ReturnSubmissionTask { + + m.ModifiedOn = modifiedOn + + return m +} + +func (m *ReturnSubmissionTask) WithOrganisationID(organisationID strfmt.UUID) *ReturnSubmissionTask { + + m.OrganisationID = organisationID + + return m +} + +func (m *ReturnSubmissionTask) WithType(typeVar string) *ReturnSubmissionTask { + + m.Type = typeVar + + return m +} + +func (m *ReturnSubmissionTask) WithVersion(version int64) *ReturnSubmissionTask { + + m.Version = &version + + return m +} + +func (m *ReturnSubmissionTask) WithoutVersion() *ReturnSubmissionTask { + m.Version = nil + return m +} + +// Validate validates this return submission task +func (m *ReturnSubmissionTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModifiedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReturnSubmissionTask) validateAttributes(formats strfmt.Registry) error { + + if swag.IsZero(m.Attributes) { // not required + return nil + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *ReturnSubmissionTask) validateCreatedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedOn) { // not required + return nil + } + + if err := validate.FormatOf("created_on", "body", "date-time", m.CreatedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReturnSubmissionTask) validateID(formats strfmt.Registry) error { + + if swag.IsZero(m.ID) { // not required + return nil + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReturnSubmissionTask) validateModifiedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.ModifiedOn) { // not required + return nil + } + + if err := validate.FormatOf("modified_on", "body", "date-time", m.ModifiedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReturnSubmissionTask) validateOrganisationID(formats strfmt.Registry) error { + + if swag.IsZero(m.OrganisationID) { // not required + return nil + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReturnSubmissionTask) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *ReturnSubmissionTask) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReturnSubmissionTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionTask) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionTask) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// ReturnSubmissionTaskAttributes return submission task attributes +// swagger:model ReturnSubmissionTaskAttributes +type ReturnSubmissionTaskAttributes struct { + + // assignee + Assignee ReturnSubmissionTaskAssignee `json:"assignee,omitempty"` + + // Key Value map that contains additional data for executing the task. + Input map[string]interface{} `json:"input,omitempty"` + + // name + Name ReturnSubmissionTaskName `json:"name,omitempty"` + + // Key Value map that contains the Task result. + Output map[string]interface{} `json:"output,omitempty"` + + // status + Status ReturnSubmissionTaskStatus `json:"status,omitempty"` +} + +func ReturnSubmissionTaskAttributesWithDefaults(defaults client.Defaults) *ReturnSubmissionTaskAttributes { + return &ReturnSubmissionTaskAttributes{ + + // TODO Assignee: ReturnSubmissionTaskAssignee, + + Input: defaults.GetMapStringInterface("ReturnSubmissionTaskAttributes", "input"), + + // TODO Name: ReturnSubmissionTaskName, + + Output: defaults.GetMapStringInterface("ReturnSubmissionTaskAttributes", "output"), + + // TODO Status: ReturnSubmissionTaskStatus, + + } +} + +func (m *ReturnSubmissionTaskAttributes) WithAssignee(assignee ReturnSubmissionTaskAssignee) *ReturnSubmissionTaskAttributes { + + m.Assignee = assignee + + return m +} + +func (m *ReturnSubmissionTaskAttributes) WithInput(input map[string]interface{}) *ReturnSubmissionTaskAttributes { + + m.Input = input + + return m +} + +func (m *ReturnSubmissionTaskAttributes) WithName(name ReturnSubmissionTaskName) *ReturnSubmissionTaskAttributes { + + m.Name = name + + return m +} + +func (m *ReturnSubmissionTaskAttributes) WithOutput(output map[string]interface{}) *ReturnSubmissionTaskAttributes { + + m.Output = output + + return m +} + +func (m *ReturnSubmissionTaskAttributes) WithStatus(status ReturnSubmissionTaskStatus) *ReturnSubmissionTaskAttributes { + + m.Status = status + + return m +} + +// Validate validates this return submission task attributes +func (m *ReturnSubmissionTaskAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssignee(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReturnSubmissionTaskAttributes) validateAssignee(formats strfmt.Registry) error { + + if swag.IsZero(m.Assignee) { // not required + return nil + } + + if err := m.Assignee.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "assignee") + } + return err + } + + return nil +} + +func (m *ReturnSubmissionTaskAttributes) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := m.Name.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "name") + } + return err + } + + return nil +} + +func (m *ReturnSubmissionTaskAttributes) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReturnSubmissionTaskAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionTaskAttributes) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionTaskAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionTaskAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/return_submission_task_assignee.go b/pkg/generated/models/return_submission_task_assignee.go new file mode 100644 index 00000000..bea02eb9 --- /dev/null +++ b/pkg/generated/models/return_submission_task_assignee.go @@ -0,0 +1,69 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// ReturnSubmissionTaskAssignee Helps to identify the owner of the task +// swagger:model ReturnSubmissionTaskAssignee +type ReturnSubmissionTaskAssignee string + +const ( + + // ReturnSubmissionTaskAssigneeForm3 captures enum value "form3" + ReturnSubmissionTaskAssigneeForm3 ReturnSubmissionTaskAssignee = "form3" +) + +// for schema +var returnSubmissionTaskAssigneeEnum []interface{} + +func init() { + var res []ReturnSubmissionTaskAssignee + if err := json.Unmarshal([]byte(`["form3"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + returnSubmissionTaskAssigneeEnum = append(returnSubmissionTaskAssigneeEnum, v) + } +} + +func (m ReturnSubmissionTaskAssignee) validateReturnSubmissionTaskAssigneeEnum(path, location string, value ReturnSubmissionTaskAssignee) error { + if err := validate.Enum(path, location, value, returnSubmissionTaskAssigneeEnum); err != nil { + return err + } + return nil +} + +// Validate validates this return submission task assignee +func (m ReturnSubmissionTaskAssignee) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReturnSubmissionTaskAssigneeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReturnSubmissionTaskAssignee) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/return_submission_task_name.go b/pkg/generated/models/return_submission_task_name.go new file mode 100644 index 00000000..e84b2b8f --- /dev/null +++ b/pkg/generated/models/return_submission_task_name.go @@ -0,0 +1,29 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" +) + +// ReturnSubmissionTaskName Identifies the return submission task to be executed +// swagger:model ReturnSubmissionTaskName +type ReturnSubmissionTaskName string + +// Validate validates this return submission task name +func (m ReturnSubmissionTaskName) Validate(formats strfmt.Registry) error { + return nil +} +func (m *ReturnSubmissionTaskName) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/return_submission_task_status.go b/pkg/generated/models/return_submission_task_status.go new file mode 100644 index 00000000..f9ebabce --- /dev/null +++ b/pkg/generated/models/return_submission_task_status.go @@ -0,0 +1,78 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// ReturnSubmissionTaskStatus status of the return submission task +// swagger:model ReturnSubmissionTaskStatus +type ReturnSubmissionTaskStatus string + +const ( + + // ReturnSubmissionTaskStatusCompleted captures enum value "completed" + ReturnSubmissionTaskStatusCompleted ReturnSubmissionTaskStatus = "completed" + + // ReturnSubmissionTaskStatusFailed captures enum value "failed" + ReturnSubmissionTaskStatusFailed ReturnSubmissionTaskStatus = "failed" + + // ReturnSubmissionTaskStatusPending captures enum value "pending" + ReturnSubmissionTaskStatusPending ReturnSubmissionTaskStatus = "pending" + + // ReturnSubmissionTaskStatusOnHold captures enum value "on_hold" + ReturnSubmissionTaskStatusOnHold ReturnSubmissionTaskStatus = "on_hold" +) + +// for schema +var returnSubmissionTaskStatusEnum []interface{} + +func init() { + var res []ReturnSubmissionTaskStatus + if err := json.Unmarshal([]byte(`["completed","failed","pending","on_hold"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + returnSubmissionTaskStatusEnum = append(returnSubmissionTaskStatusEnum, v) + } +} + +func (m ReturnSubmissionTaskStatus) validateReturnSubmissionTaskStatusEnum(path, location string, value ReturnSubmissionTaskStatus) error { + if err := validate.Enum(path, location, value, returnSubmissionTaskStatusEnum); err != nil { + return err + } + return nil +} + +// Validate validates this return submission task status +func (m ReturnSubmissionTaskStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReturnSubmissionTaskStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReturnSubmissionTaskStatus) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/return_submission_update.go b/pkg/generated/models/return_submission_update.go index c6c88422..9068c6ef 100644 --- a/pkg/generated/models/return_submission_update.go +++ b/pkg/generated/models/return_submission_update.go @@ -34,6 +34,9 @@ type ReturnSubmissionUpdate struct { // Format: uuid OrganisationID *strfmt.UUID `json:"organisation_id"` + // relationships + Relationships *ReturnSubmissionUpdateRelationships `json:"relationships,omitempty"` + // Name of the resource type // Pattern: ^[A-Za-z_]*$ Type string `json:"type,omitempty"` @@ -52,6 +55,8 @@ func ReturnSubmissionUpdateWithDefaults(defaults client.Defaults) *ReturnSubmiss OrganisationID: defaults.GetStrfmtUUIDPtr("ReturnSubmissionUpdate", "organisation_id"), + Relationships: ReturnSubmissionUpdateRelationshipsWithDefaults(defaults), + Type: defaults.GetString("ReturnSubmissionUpdate", "type"), Version: defaults.GetInt64Ptr("ReturnSubmissionUpdate", "version"), @@ -94,6 +99,18 @@ func (m *ReturnSubmissionUpdate) WithoutOrganisationID() *ReturnSubmissionUpdate return m } +func (m *ReturnSubmissionUpdate) WithRelationships(relationships ReturnSubmissionUpdateRelationships) *ReturnSubmissionUpdate { + + m.Relationships = &relationships + + return m +} + +func (m *ReturnSubmissionUpdate) WithoutRelationships() *ReturnSubmissionUpdate { + m.Relationships = nil + return m +} + func (m *ReturnSubmissionUpdate) WithType(typeVar string) *ReturnSubmissionUpdate { m.Type = typeVar @@ -129,6 +146,10 @@ func (m *ReturnSubmissionUpdate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateRelationships(formats); err != nil { + res = append(res, err) + } + if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -187,6 +208,24 @@ func (m *ReturnSubmissionUpdate) validateOrganisationID(formats strfmt.Registry) return nil } +func (m *ReturnSubmissionUpdate) validateRelationships(formats strfmt.Registry) error { + + if swag.IsZero(m.Relationships) { // not required + return nil + } + + if m.Relationships != nil { + if err := m.Relationships.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships") + } + return err + } + } + + return nil +} + func (m *ReturnSubmissionUpdate) validateType(formats strfmt.Registry) error { if swag.IsZero(m.Type) { // not required diff --git a/pkg/generated/models/return_submission_update_relationships.go b/pkg/generated/models/return_submission_update_relationships.go new file mode 100644 index 00000000..63759d7a --- /dev/null +++ b/pkg/generated/models/return_submission_update_relationships.go @@ -0,0 +1,104 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ReturnSubmissionUpdateRelationships return submission update relationships +// swagger:model ReturnSubmissionUpdateRelationships +type ReturnSubmissionUpdateRelationships struct { + + // return submission tasks + ReturnSubmissionTasks []*ReturnSubmissionTask `json:"return_submission_tasks"` +} + +func ReturnSubmissionUpdateRelationshipsWithDefaults(defaults client.Defaults) *ReturnSubmissionUpdateRelationships { + return &ReturnSubmissionUpdateRelationships{ + + ReturnSubmissionTasks: make([]*ReturnSubmissionTask, 0), + } +} + +func (m *ReturnSubmissionUpdateRelationships) WithReturnSubmissionTasks(returnSubmissionTasks []*ReturnSubmissionTask) *ReturnSubmissionUpdateRelationships { + + m.ReturnSubmissionTasks = returnSubmissionTasks + + return m +} + +// Validate validates this return submission update relationships +func (m *ReturnSubmissionUpdateRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReturnSubmissionTasks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReturnSubmissionUpdateRelationships) validateReturnSubmissionTasks(formats strfmt.Registry) error { + + if swag.IsZero(m.ReturnSubmissionTasks) { // not required + return nil + } + + for i := 0; i < len(m.ReturnSubmissionTasks); i++ { + if swag.IsZero(m.ReturnSubmissionTasks[i]) { // not required + continue + } + + if m.ReturnSubmissionTasks[i] != nil { + if err := m.ReturnSubmissionTasks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("return_submission_tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReturnSubmissionUpdateRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionUpdateRelationships) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionUpdateRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionUpdateRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/reversal_admission.go b/pkg/generated/models/reversal_admission.go index 7664c8ca..360bce79 100644 --- a/pkg/generated/models/reversal_admission.go +++ b/pkg/generated/models/reversal_admission.go @@ -432,6 +432,9 @@ type ReversalAdmissionRelationships struct { // reversal Reversal *RelationshipReversals `json:"reversal,omitempty"` + + // reversal admission task + ReversalAdmissionTask *RelationshipLinks `json:"reversal_admission_task,omitempty"` } func ReversalAdmissionRelationshipsWithDefaults(defaults client.Defaults) *ReversalAdmissionRelationships { @@ -440,6 +443,8 @@ func ReversalAdmissionRelationshipsWithDefaults(defaults client.Defaults) *Rever Payment: RelationshipPaymentsWithDefaults(defaults), Reversal: RelationshipReversalsWithDefaults(defaults), + + ReversalAdmissionTask: RelationshipLinksWithDefaults(defaults), } } @@ -467,6 +472,18 @@ func (m *ReversalAdmissionRelationships) WithoutReversal() *ReversalAdmissionRel return m } +func (m *ReversalAdmissionRelationships) WithReversalAdmissionTask(reversalAdmissionTask RelationshipLinks) *ReversalAdmissionRelationships { + + m.ReversalAdmissionTask = &reversalAdmissionTask + + return m +} + +func (m *ReversalAdmissionRelationships) WithoutReversalAdmissionTask() *ReversalAdmissionRelationships { + m.ReversalAdmissionTask = nil + return m +} + // Validate validates this reversal admission relationships func (m *ReversalAdmissionRelationships) Validate(formats strfmt.Registry) error { var res []error @@ -479,6 +496,10 @@ func (m *ReversalAdmissionRelationships) Validate(formats strfmt.Registry) error res = append(res, err) } + if err := m.validateReversalAdmissionTask(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -521,6 +542,24 @@ func (m *ReversalAdmissionRelationships) validateReversal(formats strfmt.Registr return nil } +func (m *ReversalAdmissionRelationships) validateReversalAdmissionTask(formats strfmt.Registry) error { + + if swag.IsZero(m.ReversalAdmissionTask) { // not required + return nil + } + + if m.ReversalAdmissionTask != nil { + if err := m.ReversalAdmissionTask.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships" + "." + "reversal_admission_task") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *ReversalAdmissionRelationships) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/pkg/generated/models/reversal_admission_task.go b/pkg/generated/models/reversal_admission_task.go new file mode 100644 index 00000000..fdd26a42 --- /dev/null +++ b/pkg/generated/models/reversal_admission_task.go @@ -0,0 +1,441 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReversalAdmissionTask reversal admission task +// swagger:model ReversalAdmissionTask +type ReversalAdmissionTask struct { + + // attributes + Attributes *ReversalAdmissionTaskAttributes `json:"attributes,omitempty"` + + // created on + // Format: date-time + CreatedOn strfmt.DateTime `json:"created_on,omitempty"` + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // modified on + // Format: date-time + ModifiedOn strfmt.DateTime `json:"modified_on,omitempty"` + + // Unique ID of the organisation this resource is created by + // Format: uuid + OrganisationID strfmt.UUID `json:"organisation_id,omitempty"` + + // Name of the resource type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // Version number + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func ReversalAdmissionTaskWithDefaults(defaults client.Defaults) *ReversalAdmissionTask { + return &ReversalAdmissionTask{ + + Attributes: ReversalAdmissionTaskAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTime("ReversalAdmissionTask", "created_on"), + + ID: defaults.GetStrfmtUUID("ReversalAdmissionTask", "id"), + + ModifiedOn: defaults.GetStrfmtDateTime("ReversalAdmissionTask", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUID("ReversalAdmissionTask", "organisation_id"), + + Type: defaults.GetString("ReversalAdmissionTask", "type"), + + Version: defaults.GetInt64Ptr("ReversalAdmissionTask", "version"), + } +} + +func (m *ReversalAdmissionTask) WithAttributes(attributes ReversalAdmissionTaskAttributes) *ReversalAdmissionTask { + + m.Attributes = &attributes + + return m +} + +func (m *ReversalAdmissionTask) WithoutAttributes() *ReversalAdmissionTask { + m.Attributes = nil + return m +} + +func (m *ReversalAdmissionTask) WithCreatedOn(createdOn strfmt.DateTime) *ReversalAdmissionTask { + + m.CreatedOn = createdOn + + return m +} + +func (m *ReversalAdmissionTask) WithID(id strfmt.UUID) *ReversalAdmissionTask { + + m.ID = id + + return m +} + +func (m *ReversalAdmissionTask) WithModifiedOn(modifiedOn strfmt.DateTime) *ReversalAdmissionTask { + + m.ModifiedOn = modifiedOn + + return m +} + +func (m *ReversalAdmissionTask) WithOrganisationID(organisationID strfmt.UUID) *ReversalAdmissionTask { + + m.OrganisationID = organisationID + + return m +} + +func (m *ReversalAdmissionTask) WithType(typeVar string) *ReversalAdmissionTask { + + m.Type = typeVar + + return m +} + +func (m *ReversalAdmissionTask) WithVersion(version int64) *ReversalAdmissionTask { + + m.Version = &version + + return m +} + +func (m *ReversalAdmissionTask) WithoutVersion() *ReversalAdmissionTask { + m.Version = nil + return m +} + +// Validate validates this reversal admission task +func (m *ReversalAdmissionTask) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModifiedOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionTask) validateAttributes(formats strfmt.Registry) error { + + if swag.IsZero(m.Attributes) { // not required + return nil + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *ReversalAdmissionTask) validateCreatedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedOn) { // not required + return nil + } + + if err := validate.FormatOf("created_on", "body", "date-time", m.CreatedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionTask) validateID(formats strfmt.Registry) error { + + if swag.IsZero(m.ID) { // not required + return nil + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionTask) validateModifiedOn(formats strfmt.Registry) error { + + if swag.IsZero(m.ModifiedOn) { // not required + return nil + } + + if err := validate.FormatOf("modified_on", "body", "date-time", m.ModifiedOn.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionTask) validateOrganisationID(formats strfmt.Registry) error { + + if swag.IsZero(m.OrganisationID) { // not required + return nil + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionTask) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionTask) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReversalAdmissionTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReversalAdmissionTask) UnmarshalBinary(b []byte) error { + var res ReversalAdmissionTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReversalAdmissionTask) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// ReversalAdmissionTaskAttributes reversal admission task attributes +// swagger:model ReversalAdmissionTaskAttributes +type ReversalAdmissionTaskAttributes struct { + + // assignee + Assignee ReversalAdmissionTaskAssignee `json:"assignee,omitempty"` + + // name + Name ReversalAdmissionTaskName `json:"name,omitempty"` + + // Key Value map that contains the Task result. + Output map[string]interface{} `json:"output,omitempty"` + + // status + Status ReversalAdmissionTaskStatus `json:"status,omitempty"` +} + +func ReversalAdmissionTaskAttributesWithDefaults(defaults client.Defaults) *ReversalAdmissionTaskAttributes { + return &ReversalAdmissionTaskAttributes{ + + // TODO Assignee: ReversalAdmissionTaskAssignee, + + // TODO Name: ReversalAdmissionTaskName, + + Output: defaults.GetMapStringInterface("ReversalAdmissionTaskAttributes", "output"), + + // TODO Status: ReversalAdmissionTaskStatus, + + } +} + +func (m *ReversalAdmissionTaskAttributes) WithAssignee(assignee ReversalAdmissionTaskAssignee) *ReversalAdmissionTaskAttributes { + + m.Assignee = assignee + + return m +} + +func (m *ReversalAdmissionTaskAttributes) WithName(name ReversalAdmissionTaskName) *ReversalAdmissionTaskAttributes { + + m.Name = name + + return m +} + +func (m *ReversalAdmissionTaskAttributes) WithOutput(output map[string]interface{}) *ReversalAdmissionTaskAttributes { + + m.Output = output + + return m +} + +func (m *ReversalAdmissionTaskAttributes) WithStatus(status ReversalAdmissionTaskStatus) *ReversalAdmissionTaskAttributes { + + m.Status = status + + return m +} + +// Validate validates this reversal admission task attributes +func (m *ReversalAdmissionTaskAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssignee(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionTaskAttributes) validateAssignee(formats strfmt.Registry) error { + + if swag.IsZero(m.Assignee) { // not required + return nil + } + + if err := m.Assignee.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "assignee") + } + return err + } + + return nil +} + +func (m *ReversalAdmissionTaskAttributes) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := m.Name.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "name") + } + return err + } + + return nil +} + +func (m *ReversalAdmissionTaskAttributes) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReversalAdmissionTaskAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReversalAdmissionTaskAttributes) UnmarshalBinary(b []byte) error { + var res ReversalAdmissionTaskAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReversalAdmissionTaskAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/reversal_admission_task_assignee.go b/pkg/generated/models/reversal_admission_task_assignee.go new file mode 100644 index 00000000..82b9711e --- /dev/null +++ b/pkg/generated/models/reversal_admission_task_assignee.go @@ -0,0 +1,72 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// ReversalAdmissionTaskAssignee Helps to identify the owner of the task +// swagger:model ReversalAdmissionTaskAssignee +type ReversalAdmissionTaskAssignee string + +const ( + + // ReversalAdmissionTaskAssigneeCustomer captures enum value "customer" + ReversalAdmissionTaskAssigneeCustomer ReversalAdmissionTaskAssignee = "customer" + + // ReversalAdmissionTaskAssigneeForm3 captures enum value "form3" + ReversalAdmissionTaskAssigneeForm3 ReversalAdmissionTaskAssignee = "form3" +) + +// for schema +var reversalAdmissionTaskAssigneeEnum []interface{} + +func init() { + var res []ReversalAdmissionTaskAssignee + if err := json.Unmarshal([]byte(`["customer","form3"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reversalAdmissionTaskAssigneeEnum = append(reversalAdmissionTaskAssigneeEnum, v) + } +} + +func (m ReversalAdmissionTaskAssignee) validateReversalAdmissionTaskAssigneeEnum(path, location string, value ReversalAdmissionTaskAssignee) error { + if err := validate.Enum(path, location, value, reversalAdmissionTaskAssigneeEnum); err != nil { + return err + } + return nil +} + +// Validate validates this reversal admission task assignee +func (m ReversalAdmissionTaskAssignee) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReversalAdmissionTaskAssigneeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionTaskAssignee) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/reversal_admission_task_name.go b/pkg/generated/models/reversal_admission_task_name.go new file mode 100644 index 00000000..e039cfee --- /dev/null +++ b/pkg/generated/models/reversal_admission_task_name.go @@ -0,0 +1,29 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" +) + +// ReversalAdmissionTaskName Identifies the reversal admission task to be executed +// swagger:model ReversalAdmissionTaskName +type ReversalAdmissionTaskName string + +// Validate validates this reversal admission task name +func (m ReversalAdmissionTaskName) Validate(formats strfmt.Registry) error { + return nil +} +func (m *ReversalAdmissionTaskName) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/reversal_admission_task_status.go b/pkg/generated/models/reversal_admission_task_status.go new file mode 100644 index 00000000..05c4bcda --- /dev/null +++ b/pkg/generated/models/reversal_admission_task_status.go @@ -0,0 +1,78 @@ +// 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 ( + "encoding/json" + "log" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// ReversalAdmissionTaskStatus status of the task +// swagger:model ReversalAdmissionTaskStatus +type ReversalAdmissionTaskStatus string + +const ( + + // ReversalAdmissionTaskStatusCompleted captures enum value "completed" + ReversalAdmissionTaskStatusCompleted ReversalAdmissionTaskStatus = "completed" + + // ReversalAdmissionTaskStatusFailed captures enum value "failed" + ReversalAdmissionTaskStatusFailed ReversalAdmissionTaskStatus = "failed" + + // ReversalAdmissionTaskStatusPending captures enum value "pending" + ReversalAdmissionTaskStatusPending ReversalAdmissionTaskStatus = "pending" + + // ReversalAdmissionTaskStatusOnHold captures enum value "on_hold" + ReversalAdmissionTaskStatusOnHold ReversalAdmissionTaskStatus = "on_hold" +) + +// for schema +var reversalAdmissionTaskStatusEnum []interface{} + +func init() { + var res []ReversalAdmissionTaskStatus + if err := json.Unmarshal([]byte(`["completed","failed","pending","on_hold"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reversalAdmissionTaskStatusEnum = append(reversalAdmissionTaskStatusEnum, v) + } +} + +func (m ReversalAdmissionTaskStatus) validateReversalAdmissionTaskStatusEnum(path, location string, value ReversalAdmissionTaskStatus) error { + if err := validate.Enum(path, location, value, reversalAdmissionTaskStatusEnum); err != nil { + return err + } + return nil +} + +// Validate validates this reversal admission task status +func (m ReversalAdmissionTaskStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReversalAdmissionTaskStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionTaskStatus) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/reversal_admission_update.go b/pkg/generated/models/reversal_admission_update.go new file mode 100644 index 00000000..47869fb7 --- /dev/null +++ b/pkg/generated/models/reversal_admission_update.go @@ -0,0 +1,354 @@ +// 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 ( + "encoding/json" + "log" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReversalAdmissionUpdate reversal admission update +// swagger:model ReversalAdmissionUpdate +type ReversalAdmissionUpdate struct { + + // attributes + Attributes *ReversalAdmissionUpdateAttributes `json:"attributes,omitempty"` + + // Unique resource ID + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // Unique ID of the organisation this resource is created by + // Required: true + // Format: uuid + OrganisationID *strfmt.UUID `json:"organisation_id"` + + // relationships + Relationships *ReversalAdmissionUpdateRelationships `json:"relationships,omitempty"` + + // Name of the resource type + // Pattern: ^[A-Za-z_]*$ + Type string `json:"type,omitempty"` + + // Version number + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func ReversalAdmissionUpdateWithDefaults(defaults client.Defaults) *ReversalAdmissionUpdate { + return &ReversalAdmissionUpdate{ + + Attributes: ReversalAdmissionUpdateAttributesWithDefaults(defaults), + + ID: defaults.GetStrfmtUUIDPtr("ReversalAdmissionUpdate", "id"), + + OrganisationID: defaults.GetStrfmtUUIDPtr("ReversalAdmissionUpdate", "organisation_id"), + + Relationships: ReversalAdmissionUpdateRelationshipsWithDefaults(defaults), + + Type: defaults.GetString("ReversalAdmissionUpdate", "type"), + + Version: defaults.GetInt64Ptr("ReversalAdmissionUpdate", "version"), + } +} + +func (m *ReversalAdmissionUpdate) WithAttributes(attributes ReversalAdmissionUpdateAttributes) *ReversalAdmissionUpdate { + + m.Attributes = &attributes + + return m +} + +func (m *ReversalAdmissionUpdate) WithoutAttributes() *ReversalAdmissionUpdate { + m.Attributes = nil + return m +} + +func (m *ReversalAdmissionUpdate) WithID(id strfmt.UUID) *ReversalAdmissionUpdate { + + m.ID = &id + + return m +} + +func (m *ReversalAdmissionUpdate) WithoutID() *ReversalAdmissionUpdate { + m.ID = nil + return m +} + +func (m *ReversalAdmissionUpdate) WithOrganisationID(organisationID strfmt.UUID) *ReversalAdmissionUpdate { + + m.OrganisationID = &organisationID + + return m +} + +func (m *ReversalAdmissionUpdate) WithoutOrganisationID() *ReversalAdmissionUpdate { + m.OrganisationID = nil + return m +} + +func (m *ReversalAdmissionUpdate) WithRelationships(relationships ReversalAdmissionUpdateRelationships) *ReversalAdmissionUpdate { + + m.Relationships = &relationships + + return m +} + +func (m *ReversalAdmissionUpdate) WithoutRelationships() *ReversalAdmissionUpdate { + m.Relationships = nil + return m +} + +func (m *ReversalAdmissionUpdate) WithType(typeVar string) *ReversalAdmissionUpdate { + + m.Type = typeVar + + return m +} + +func (m *ReversalAdmissionUpdate) WithVersion(version int64) *ReversalAdmissionUpdate { + + m.Version = &version + + return m +} + +func (m *ReversalAdmissionUpdate) WithoutVersion() *ReversalAdmissionUpdate { + m.Version = nil + return m +} + +// Validate validates this reversal admission update +func (m *ReversalAdmissionUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAttributes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrganisationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRelationships(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionUpdate) validateAttributes(formats strfmt.Registry) error { + + if swag.IsZero(m.Attributes) { // not required + return nil + } + + if m.Attributes != nil { + if err := m.Attributes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes") + } + return err + } + } + + return nil +} + +func (m *ReversalAdmissionUpdate) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionUpdate) validateOrganisationID(formats strfmt.Registry) error { + + if err := validate.Required("organisation_id", "body", m.OrganisationID); err != nil { + return err + } + + if err := validate.FormatOf("organisation_id", "body", "uuid", m.OrganisationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionUpdate) validateRelationships(formats strfmt.Registry) error { + + if swag.IsZero(m.Relationships) { // not required + return nil + } + + if m.Relationships != nil { + if err := m.Relationships.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("relationships") + } + return err + } + } + + return nil +} + +func (m *ReversalAdmissionUpdate) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := validate.Pattern("type", "body", string(m.Type), `^[A-Za-z_]*$`); err != nil { + return err + } + + return nil +} + +func (m *ReversalAdmissionUpdate) validateVersion(formats strfmt.Registry) error { + + if swag.IsZero(m.Version) { // not required + return nil + } + + if err := validate.MinimumInt("version", "body", int64(*m.Version), 0, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReversalAdmissionUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReversalAdmissionUpdate) UnmarshalBinary(b []byte) error { + var res ReversalAdmissionUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReversalAdmissionUpdate) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// ReversalAdmissionUpdateAttributes reversal admission update attributes +// swagger:model ReversalAdmissionUpdateAttributes +type ReversalAdmissionUpdateAttributes struct { + + // Scheme-specific status code. Refer to scheme documentation where available. + SchemeStatusCode string `json:"scheme_status_code,omitempty"` + + // Description of `scheme_status_code` + SchemeStatusCodeDescription string `json:"scheme_status_code_description,omitempty"` + + // source gateway + SourceGateway string `json:"source_gateway,omitempty"` +} + +func ReversalAdmissionUpdateAttributesWithDefaults(defaults client.Defaults) *ReversalAdmissionUpdateAttributes { + return &ReversalAdmissionUpdateAttributes{ + + SchemeStatusCode: defaults.GetString("ReversalAdmissionUpdateAttributes", "scheme_status_code"), + + SchemeStatusCodeDescription: defaults.GetString("ReversalAdmissionUpdateAttributes", "scheme_status_code_description"), + + SourceGateway: defaults.GetString("ReversalAdmissionUpdateAttributes", "source_gateway"), + } +} + +func (m *ReversalAdmissionUpdateAttributes) WithSchemeStatusCode(schemeStatusCode string) *ReversalAdmissionUpdateAttributes { + + m.SchemeStatusCode = schemeStatusCode + + return m +} + +func (m *ReversalAdmissionUpdateAttributes) WithSchemeStatusCodeDescription(schemeStatusCodeDescription string) *ReversalAdmissionUpdateAttributes { + + m.SchemeStatusCodeDescription = schemeStatusCodeDescription + + return m +} + +func (m *ReversalAdmissionUpdateAttributes) WithSourceGateway(sourceGateway string) *ReversalAdmissionUpdateAttributes { + + m.SourceGateway = sourceGateway + + return m +} + +// Validate validates this reversal admission update attributes +func (m *ReversalAdmissionUpdateAttributes) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ReversalAdmissionUpdateAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReversalAdmissionUpdateAttributes) UnmarshalBinary(b []byte) error { + var res ReversalAdmissionUpdateAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReversalAdmissionUpdateAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/reversal_admission_update_relationships.go b/pkg/generated/models/reversal_admission_update_relationships.go new file mode 100644 index 00000000..dcb157fc --- /dev/null +++ b/pkg/generated/models/reversal_admission_update_relationships.go @@ -0,0 +1,104 @@ +// 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 ( + "encoding/json" + "log" + "strconv" + + "github.com/form3tech-oss/go-form3/v6/pkg/client" + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// ReversalAdmissionUpdateRelationships reversal admission update relationships +// swagger:model ReversalAdmissionUpdateRelationships +type ReversalAdmissionUpdateRelationships struct { + + // reversal admission tasks + ReversalAdmissionTasks []*ReversalAdmissionTask `json:"reversal_admission_tasks"` +} + +func ReversalAdmissionUpdateRelationshipsWithDefaults(defaults client.Defaults) *ReversalAdmissionUpdateRelationships { + return &ReversalAdmissionUpdateRelationships{ + + ReversalAdmissionTasks: make([]*ReversalAdmissionTask, 0), + } +} + +func (m *ReversalAdmissionUpdateRelationships) WithReversalAdmissionTasks(reversalAdmissionTasks []*ReversalAdmissionTask) *ReversalAdmissionUpdateRelationships { + + m.ReversalAdmissionTasks = reversalAdmissionTasks + + return m +} + +// Validate validates this reversal admission update relationships +func (m *ReversalAdmissionUpdateRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReversalAdmissionTasks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionUpdateRelationships) validateReversalAdmissionTasks(formats strfmt.Registry) error { + + if swag.IsZero(m.ReversalAdmissionTasks) { // not required + return nil + } + + for i := 0; i < len(m.ReversalAdmissionTasks); i++ { + if swag.IsZero(m.ReversalAdmissionTasks[i]) { // not required + continue + } + + if m.ReversalAdmissionTasks[i] != nil { + if err := m.ReversalAdmissionTasks[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reversal_admission_tasks" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReversalAdmissionUpdateRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReversalAdmissionUpdateRelationships) UnmarshalBinary(b []byte) error { + var res ReversalAdmissionUpdateRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReversalAdmissionUpdateRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/user_defined_data.go b/pkg/generated/models/user_defined_data.go index 370c3428..1c103650 100644 --- a/pkg/generated/models/user_defined_data.go +++ b/pkg/generated/models/user_defined_data.go @@ -23,13 +23,11 @@ type UserDefinedData struct { // Key of the pair // Required: true - // Max Length: 35 // Min Length: 1 Key *string `json:"key"` // Value of the pair // Required: true - // Max Length: 35 // Min Length: 1 Value *string `json:"value"` } @@ -95,10 +93,6 @@ func (m *UserDefinedData) validateKey(formats strfmt.Registry) error { return err } - if err := validate.MaxLength("key", "body", string(*m.Key), 35); err != nil { - return err - } - return nil } @@ -112,10 +106,6 @@ func (m *UserDefinedData) validateValue(formats strfmt.Registry) error { return err } - if err := validate.MaxLength("value", "body", string(*m.Value), 35); err != nil { - return err - } - return nil } diff --git a/pkg/generated/models/user_defined_data_for_payment.go b/pkg/generated/models/user_defined_data_for_payment.go deleted file mode 100644 index 5c7eac1c..00000000 --- a/pkg/generated/models/user_defined_data_for_payment.go +++ /dev/null @@ -1,145 +0,0 @@ -// 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 ( - "encoding/json" - "log" - - "github.com/form3tech-oss/go-form3/v6/pkg/client" - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UserDefinedDataForPayment user defined data for payment -// swagger:model UserDefinedDataForPayment -type UserDefinedDataForPayment struct { - - // Key of the pair - // Required: true - // Max Length: 45 - // Min Length: 1 - Key *string `json:"key"` - - // Value of the pair - // Required: true - // Max Length: 45 - // Min Length: 1 - Value *string `json:"value"` -} - -func UserDefinedDataForPaymentWithDefaults(defaults client.Defaults) *UserDefinedDataForPayment { - return &UserDefinedDataForPayment{ - - Key: defaults.GetStringPtr("UserDefinedDataForPayment", "key"), - - Value: defaults.GetStringPtr("UserDefinedDataForPayment", "value"), - } -} - -func (m *UserDefinedDataForPayment) WithKey(key string) *UserDefinedDataForPayment { - - m.Key = &key - - return m -} - -func (m *UserDefinedDataForPayment) WithoutKey() *UserDefinedDataForPayment { - m.Key = nil - return m -} - -func (m *UserDefinedDataForPayment) WithValue(value string) *UserDefinedDataForPayment { - - m.Value = &value - - return m -} - -func (m *UserDefinedDataForPayment) WithoutValue() *UserDefinedDataForPayment { - m.Value = nil - return m -} - -// Validate validates this user defined data for payment -func (m *UserDefinedDataForPayment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UserDefinedDataForPayment) validateKey(formats strfmt.Registry) error { - - if err := validate.Required("key", "body", m.Key); err != nil { - return err - } - - if err := validate.MinLength("key", "body", string(*m.Key), 1); err != nil { - return err - } - - if err := validate.MaxLength("key", "body", string(*m.Key), 45); err != nil { - return err - } - - return nil -} - -func (m *UserDefinedDataForPayment) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - if err := validate.MinLength("value", "body", string(*m.Value), 1); err != nil { - return err - } - - if err := validate.MaxLength("value", "body", string(*m.Value), 45); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UserDefinedDataForPayment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UserDefinedDataForPayment) UnmarshalBinary(b []byte) error { - var res UserDefinedDataForPayment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} -func (m *UserDefinedDataForPayment) Json() string { - json, err := json.MarshalIndent(m, " ", " ") - if err != nil { - log.Fatal(err) - } - return string(json) -}