From 6f87bdd7904eeea4af035b3c6d4316810152d20b Mon Sep 17 00:00:00 2001 From: Ezequiel Colautti Date: Mon, 13 Feb 2023 12:00:29 -0300 Subject: [PATCH] chore: update client with last API version --- ...nisation_nameverifications_id_responses.go | 41 ++ ...verification_id_admissions_id_responses.go | 41 ++ .../client/payments/list_payments_requests.go | 144 ++++++ .../patch_return_submission_task_requests.go | 180 +++++++ .../patch_return_submission_task_responses.go | 154 ++++++ ...ns_submission_id_tasks_task_id_requests.go | 162 ++++++ ...s_submission_id_tasks_task_id_responses.go | 154 ++++++ .../client/payments/payments_client.go | 66 +++ pkg/generated/models/account_number_code.go | 8 +- pkg/generated/models/ace.go | 18 - pkg/generated/models/clearing_channel.go | 75 +++ pkg/generated/models/payment_attributes.go | 65 +++ pkg/generated/models/payment_scheme.go | 5 +- .../models/payment_submission_task.go | 480 ++++++++++++++++++ .../payment_submission_task_amendment.go | 101 ++++ .../payment_submission_task_assignee.go | 69 +++ ...ayment_submission_task_details_response.go | 140 +++++ .../models/payment_submission_task_name.go | 29 ++ .../payment_submission_task_relationships.go | 140 +++++ .../models/payment_submission_task_status.go | 78 +++ .../models/payment_submission_task_update.go | 344 +++++++++++++ pkg/generated/models/recall_decision.go | 241 +++++++++ .../models/recall_decision_answer.go | 5 +- pkg/generated/models/reference.go | 145 ++++++ .../relationship_payment_submissions.go | 104 ++++ .../models/relationship_return_submissions.go | 104 ++++ .../models/resolution_related_information.go | 179 +++++++ pkg/generated/models/resource_type.go | 236 ++++----- pkg/generated/models/return_payment.go | 30 ++ .../models/return_submission_task.go | 39 ++ .../return_submission_task_amendment.go | 101 ++++ .../models/return_submission_task_assignee.go | 5 +- ...return_submission_task_details_response.go | 140 +++++ .../return_submission_task_relationships.go | 179 +++++++ .../models/return_submission_task_update.go | 344 +++++++++++++ pkg/generated/models/reversal_admission.go | 38 ++ .../models/reversal_admission_status.go | 72 +++ .../models/reversal_admission_update.go | 38 ++ pkg/generated/models/reversal_payment.go | 129 ++++- pkg/generated/models/ultimate_entity.go | 12 + 40 files changed, 4488 insertions(+), 147 deletions(-) create mode 100644 pkg/generated/client/payments/patch_return_submission_task_requests.go create mode 100644 pkg/generated/client/payments/patch_return_submission_task_responses.go create mode 100644 pkg/generated/client/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_requests.go create mode 100644 pkg/generated/client/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_responses.go create mode 100644 pkg/generated/models/clearing_channel.go create mode 100644 pkg/generated/models/payment_submission_task.go create mode 100644 pkg/generated/models/payment_submission_task_amendment.go create mode 100644 pkg/generated/models/payment_submission_task_assignee.go create mode 100644 pkg/generated/models/payment_submission_task_details_response.go create mode 100644 pkg/generated/models/payment_submission_task_name.go create mode 100644 pkg/generated/models/payment_submission_task_relationships.go create mode 100644 pkg/generated/models/payment_submission_task_status.go create mode 100644 pkg/generated/models/payment_submission_task_update.go create mode 100644 pkg/generated/models/reference.go create mode 100644 pkg/generated/models/relationship_payment_submissions.go create mode 100644 pkg/generated/models/relationship_return_submissions.go create mode 100644 pkg/generated/models/resolution_related_information.go create mode 100644 pkg/generated/models/return_submission_task_amendment.go create mode 100644 pkg/generated/models/return_submission_task_details_response.go create mode 100644 pkg/generated/models/return_submission_task_relationships.go create mode 100644 pkg/generated/models/return_submission_task_update.go create mode 100644 pkg/generated/models/reversal_admission_status.go 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 index 9dfc9a66..1b8498e8 100644 --- 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 @@ -32,6 +32,13 @@ func (o *GetOrganisationNameverificationsIDReader) ReadResponse(response runtime } return result, nil + case 400: + result := NewGetOrganisationNameverificationsIDBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: result := NewGetOrganisationNameverificationsIDForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -92,6 +99,40 @@ func (o *GetOrganisationNameverificationsIDOK) readResponse(response runtime.Cli return nil } +// NewGetOrganisationNameverificationsIDBadRequest creates a GetOrganisationNameverificationsIDBadRequest with default headers values +func NewGetOrganisationNameverificationsIDBadRequest() *GetOrganisationNameverificationsIDBadRequest { + return &GetOrganisationNameverificationsIDBadRequest{} +} + +/*GetOrganisationNameverificationsIDBadRequest handles this case with default header values. + +Bad Request +*/ +type GetOrganisationNameverificationsIDBadRequest struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsIDBadRequest) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{id}][%d] getOrganisationNameverificationsIdBadRequest", 400) +} + +func (o *GetOrganisationNameverificationsIDBadRequest) 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 +} + // NewGetOrganisationNameverificationsIDForbidden creates a GetOrganisationNameverificationsIDForbidden with default headers values func NewGetOrganisationNameverificationsIDForbidden() *GetOrganisationNameverificationsIDForbidden { return &GetOrganisationNameverificationsIDForbidden{} 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 index 149bb668..ed789b58 100644 --- 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 @@ -32,6 +32,13 @@ func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDReader) R } return result, nil + case 400: + result := NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: result := NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -92,6 +99,40 @@ func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDOK) readR return nil } +// NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest creates a GetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest with default headers values +func NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest { + return &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest{} +} + +/*GetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest handles this case with default header values. + +Bad Request +*/ +type GetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest) Error() string { + return fmt.Sprintf("[GET /organisation/nameverifications/{name_verification_id}/admissions/{id}][%d] getOrganisationNameverificationsNameVerificationIdAdmissionsIdBadRequest", 400) +} + +func (o *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDBadRequest) 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 +} + // NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden creates a GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden with default headers values func NewGetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden() *GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden { return &GetOrganisationNameverificationsNameVerificationIDAdmissionsIDForbidden{} diff --git a/pkg/generated/client/payments/list_payments_requests.go b/pkg/generated/client/payments/list_payments_requests.go index d8eb2a7d..312e0f71 100644 --- a/pkg/generated/client/payments/list_payments_requests.go +++ b/pkg/generated/client/payments/list_payments_requests.go @@ -31,16 +31,22 @@ func (c *Client) ListPayments() *ListPaymentsRequest { FilterAmount: c.Defaults.GetStringPtr("ListPayments", "filter[amount]"), + FilterBeneficiaryPartyAccountName: c.Defaults.GetStringPtr("ListPayments", "filter[beneficiary_party.account_name]"), + FilterBeneficiaryPartyAccountNumber: c.Defaults.GetStringPtr("ListPayments", "filter[beneficiary_party.account_number]"), FilterBeneficiaryPartyBankID: c.Defaults.GetStringPtr("ListPayments", "filter[beneficiary_party.bank_id]"), FilterCurrency: c.Defaults.GetStringPtr("ListPayments", "filter[currency]"), + FilterDebtorPartyAccountName: c.Defaults.GetStringPtr("ListPayments", "filter[debtor_party.account_name]"), + FilterDebtorPartyAccountNumber: c.Defaults.GetStringPtr("ListPayments", "filter[debtor_party.account_number]"), FilterDebtorPartyBankID: c.Defaults.GetStringPtr("ListPayments", "filter[debtor_party.bank_id]"), + FilterEndToEndReference: c.Defaults.GetStringPtr("ListPayments", "filter[end_to_end_reference]"), + FilterNotRelationships: make([]string, 0), FilterOrganisationID: make([]strfmt.UUID, 0), @@ -57,6 +63,8 @@ func (c *Client) ListPayments() *ListPaymentsRequest { FilterRelationships: make([]string, 0), + FilterReturnUniqueSchemeID: c.Defaults.GetStringPtr("ListPayments", "filter[return.unique_scheme_id]"), + FilterSchemeTransactionID: c.Defaults.GetStringPtr("ListPayments", "filter[scheme_transaction_id]"), FilterSubmissionSchemeStatusCode: c.Defaults.GetStringPtr("ListPayments", "filter[submission.scheme_status_code]"), @@ -102,6 +110,10 @@ type ListPaymentsRequest struct { FilterAmount *string + /*FilterBeneficiaryPartyAccountName*/ + + FilterBeneficiaryPartyAccountName *string + /*FilterBeneficiaryPartyAccountNumber*/ FilterBeneficiaryPartyAccountNumber *string @@ -114,6 +126,10 @@ type ListPaymentsRequest struct { FilterCurrency *string + /*FilterDebtorPartyAccountName*/ + + FilterDebtorPartyAccountName *string + /*FilterDebtorPartyAccountNumber*/ FilterDebtorPartyAccountNumber *string @@ -122,6 +138,10 @@ type ListPaymentsRequest struct { FilterDebtorPartyBankID *string + /*FilterEndToEndReference*/ + + FilterEndToEndReference *string + /*FilterNotRelationships Filter for payments containing none of the requested relationships */ FilterNotRelationships []string @@ -154,6 +174,10 @@ type ListPaymentsRequest struct { FilterRelationships []string + /*FilterReturnUniqueSchemeID*/ + + FilterReturnUniqueSchemeID *string + /*FilterSchemeTransactionID*/ FilterSchemeTransactionID *string @@ -269,6 +293,20 @@ func (o *ListPaymentsRequest) WithoutFilterAmount() *ListPaymentsRequest { return o } +func (o *ListPaymentsRequest) WithFilterBeneficiaryPartyAccountName(filterBeneficiaryPartyAccountName string) *ListPaymentsRequest { + + o.FilterBeneficiaryPartyAccountName = &filterBeneficiaryPartyAccountName + + return o +} + +func (o *ListPaymentsRequest) WithoutFilterBeneficiaryPartyAccountName() *ListPaymentsRequest { + + o.FilterBeneficiaryPartyAccountName = nil + + return o +} + func (o *ListPaymentsRequest) WithFilterBeneficiaryPartyAccountNumber(filterBeneficiaryPartyAccountNumber string) *ListPaymentsRequest { o.FilterBeneficiaryPartyAccountNumber = &filterBeneficiaryPartyAccountNumber @@ -311,6 +349,20 @@ func (o *ListPaymentsRequest) WithoutFilterCurrency() *ListPaymentsRequest { return o } +func (o *ListPaymentsRequest) WithFilterDebtorPartyAccountName(filterDebtorPartyAccountName string) *ListPaymentsRequest { + + o.FilterDebtorPartyAccountName = &filterDebtorPartyAccountName + + return o +} + +func (o *ListPaymentsRequest) WithoutFilterDebtorPartyAccountName() *ListPaymentsRequest { + + o.FilterDebtorPartyAccountName = nil + + return o +} + func (o *ListPaymentsRequest) WithFilterDebtorPartyAccountNumber(filterDebtorPartyAccountNumber string) *ListPaymentsRequest { o.FilterDebtorPartyAccountNumber = &filterDebtorPartyAccountNumber @@ -339,6 +391,20 @@ func (o *ListPaymentsRequest) WithoutFilterDebtorPartyBankID() *ListPaymentsRequ return o } +func (o *ListPaymentsRequest) WithFilterEndToEndReference(filterEndToEndReference string) *ListPaymentsRequest { + + o.FilterEndToEndReference = &filterEndToEndReference + + return o +} + +func (o *ListPaymentsRequest) WithoutFilterEndToEndReference() *ListPaymentsRequest { + + o.FilterEndToEndReference = nil + + return o +} + func (o *ListPaymentsRequest) WithFilterNotRelationships(filterNotRelationships []string) *ListPaymentsRequest { o.FilterNotRelationships = filterNotRelationships @@ -451,6 +517,20 @@ func (o *ListPaymentsRequest) WithoutFilterRelationships() *ListPaymentsRequest return o } +func (o *ListPaymentsRequest) WithFilterReturnUniqueSchemeID(filterReturnUniqueSchemeID string) *ListPaymentsRequest { + + o.FilterReturnUniqueSchemeID = &filterReturnUniqueSchemeID + + return o +} + +func (o *ListPaymentsRequest) WithoutFilterReturnUniqueSchemeID() *ListPaymentsRequest { + + o.FilterReturnUniqueSchemeID = nil + + return o +} + func (o *ListPaymentsRequest) WithFilterSchemeTransactionID(filterSchemeTransactionID string) *ListPaymentsRequest { o.FilterSchemeTransactionID = &filterSchemeTransactionID @@ -664,6 +744,22 @@ func (o *ListPaymentsRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.FilterBeneficiaryPartyAccountName != nil { + + // query param filter[beneficiary_party.account_name] + var qrFilterBeneficiaryPartyAccountName string + if o.FilterBeneficiaryPartyAccountName != nil { + qrFilterBeneficiaryPartyAccountName = *o.FilterBeneficiaryPartyAccountName + } + qFilterBeneficiaryPartyAccountName := qrFilterBeneficiaryPartyAccountName + if qFilterBeneficiaryPartyAccountName != "" { + if err := r.SetQueryParam("filter[beneficiary_party.account_name]", qFilterBeneficiaryPartyAccountName); err != nil { + return err + } + } + + } + if o.FilterBeneficiaryPartyAccountNumber != nil { // query param filter[beneficiary_party.account_number] @@ -712,6 +808,22 @@ func (o *ListPaymentsRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.FilterDebtorPartyAccountName != nil { + + // query param filter[debtor_party.account_name] + var qrFilterDebtorPartyAccountName string + if o.FilterDebtorPartyAccountName != nil { + qrFilterDebtorPartyAccountName = *o.FilterDebtorPartyAccountName + } + qFilterDebtorPartyAccountName := qrFilterDebtorPartyAccountName + if qFilterDebtorPartyAccountName != "" { + if err := r.SetQueryParam("filter[debtor_party.account_name]", qFilterDebtorPartyAccountName); err != nil { + return err + } + } + + } + if o.FilterDebtorPartyAccountNumber != nil { // query param filter[debtor_party.account_number] @@ -744,6 +856,22 @@ func (o *ListPaymentsRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.FilterEndToEndReference != nil { + + // query param filter[end_to_end_reference] + var qrFilterEndToEndReference string + if o.FilterEndToEndReference != nil { + qrFilterEndToEndReference = *o.FilterEndToEndReference + } + qFilterEndToEndReference := qrFilterEndToEndReference + if qFilterEndToEndReference != "" { + if err := r.SetQueryParam("filter[end_to_end_reference]", qFilterEndToEndReference); err != nil { + return err + } + } + + } + valuesFilterNotRelationships := o.FilterNotRelationships joinedFilterNotRelationships := swag.JoinByFormat(valuesFilterNotRelationships, "csv") @@ -851,6 +979,22 @@ func (o *ListPaymentsRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt return err } + if o.FilterReturnUniqueSchemeID != nil { + + // query param filter[return.unique_scheme_id] + var qrFilterReturnUniqueSchemeID string + if o.FilterReturnUniqueSchemeID != nil { + qrFilterReturnUniqueSchemeID = *o.FilterReturnUniqueSchemeID + } + qFilterReturnUniqueSchemeID := qrFilterReturnUniqueSchemeID + if qFilterReturnUniqueSchemeID != "" { + if err := r.SetQueryParam("filter[return.unique_scheme_id]", qFilterReturnUniqueSchemeID); err != nil { + return err + } + } + + } + if o.FilterSchemeTransactionID != nil { // query param filter[scheme_transaction_id] diff --git a/pkg/generated/client/payments/patch_return_submission_task_requests.go b/pkg/generated/client/payments/patch_return_submission_task_requests.go new file mode 100644 index 00000000..1354b03a --- /dev/null +++ b/pkg/generated/client/payments/patch_return_submission_task_requests.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payments + +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.PatchReturnSubmissionTask creates a new PatchReturnSubmissionTaskRequest object +// with the default values initialized. +func (c *Client) PatchReturnSubmissionTask() *PatchReturnSubmissionTaskRequest { + var () + return &PatchReturnSubmissionTaskRequest{ + + ReturnSubmissionTaskAmendment: models.ReturnSubmissionTaskAmendmentWithDefaults(c.Defaults), + + PaymentID: c.Defaults.GetStrfmtUUID("PatchReturnSubmissionTask", "paymentId"), + + ReturnID: c.Defaults.GetStrfmtUUID("PatchReturnSubmissionTask", "returnId"), + + ReturnSubmissionID: c.Defaults.GetStrfmtUUID("PatchReturnSubmissionTask", "returnSubmissionId"), + + TaskID: c.Defaults.GetStrfmtUUID("PatchReturnSubmissionTask", "taskId"), + + timeout: cr.DefaultTimeout, + + transport: c.transport, + formats: c.formats, + } +} + +type PatchReturnSubmissionTaskRequest struct { + + /*ReturnSubmissionTaskPatchRequest*/ + + *models.ReturnSubmissionTaskAmendment + + /*PaymentID Payment ID */ + + PaymentID strfmt.UUID + + /*ReturnID Return ID */ + + ReturnID strfmt.UUID + + /*ReturnSubmissionID Return Submission ID */ + + ReturnSubmissionID strfmt.UUID + + /*TaskID Return Submission Task Id */ + + TaskID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client + + transport runtime.ClientTransport + formats strfmt.Registry +} + +func (o *PatchReturnSubmissionTaskRequest) FromJson(j string) (*PatchReturnSubmissionTaskRequest, error) { + + var m models.ReturnSubmissionTaskAmendment + if err := json.Unmarshal([]byte(j), &m); err != nil { + return nil, fmt.Errorf("could not unmarshal JSON: %w", err) + } + + o.ReturnSubmissionTaskAmendment = &m + + return o, nil +} + +func (o *PatchReturnSubmissionTaskRequest) WithReturnSubmissionTaskPatchRequest(returnSubmissionTaskPatchRequest models.ReturnSubmissionTaskAmendment) *PatchReturnSubmissionTaskRequest { + + o.ReturnSubmissionTaskAmendment = &returnSubmissionTaskPatchRequest + + return o +} + +func (o *PatchReturnSubmissionTaskRequest) WithoutReturnSubmissionTaskPatchRequest() *PatchReturnSubmissionTaskRequest { + + o.ReturnSubmissionTaskAmendment = &models.ReturnSubmissionTaskAmendment{} + + return o +} + +func (o *PatchReturnSubmissionTaskRequest) WithPaymentID(paymentID strfmt.UUID) *PatchReturnSubmissionTaskRequest { + + o.PaymentID = paymentID + + return o +} + +func (o *PatchReturnSubmissionTaskRequest) WithReturnID(returnID strfmt.UUID) *PatchReturnSubmissionTaskRequest { + + o.ReturnID = returnID + + return o +} + +func (o *PatchReturnSubmissionTaskRequest) WithReturnSubmissionID(returnSubmissionID strfmt.UUID) *PatchReturnSubmissionTaskRequest { + + o.ReturnSubmissionID = returnSubmissionID + + return o +} + +func (o *PatchReturnSubmissionTaskRequest) WithTaskID(taskID strfmt.UUID) *PatchReturnSubmissionTaskRequest { + + o.TaskID = taskID + + return o +} + +////////////////// +// WithContext adds the context to the patch return submission task Request +func (o *PatchReturnSubmissionTaskRequest) WithContext(ctx context.Context) *PatchReturnSubmissionTaskRequest { + o.Context = ctx + return o +} + +// WithHTTPClient adds the HTTPClient to the patch return submission task Request +func (o *PatchReturnSubmissionTaskRequest) WithHTTPClient(client *http.Client) *PatchReturnSubmissionTaskRequest { + o.HTTPClient = client + return o +} + +// WriteToRequest writes these Request to a swagger request +func (o *PatchReturnSubmissionTaskRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // ISBODYPARAM + if o.ReturnSubmissionTaskAmendment != nil { + if err := r.SetBodyParam(o.ReturnSubmissionTaskAmendment); err != nil { + return err + } + } + + // path param paymentId + if err := r.SetPathParam("paymentId", o.PaymentID.String()); err != nil { + return err + } + + // path param returnId + if err := r.SetPathParam("returnId", o.ReturnID.String()); err != nil { + return err + } + + // path param returnSubmissionId + if err := r.SetPathParam("returnSubmissionId", o.ReturnSubmissionID.String()); err != nil { + return err + } + + // path param taskId + if err := r.SetPathParam("taskId", o.TaskID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/generated/client/payments/patch_return_submission_task_responses.go b/pkg/generated/client/payments/patch_return_submission_task_responses.go new file mode 100644 index 00000000..3f0b5c0f --- /dev/null +++ b/pkg/generated/client/payments/patch_return_submission_task_responses.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payments + +// 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" +) + +// PatchReturnSubmissionTaskReader is a Reader for the PatchReturnSubmissionTask structure. +type PatchReturnSubmissionTaskReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchReturnSubmissionTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPatchReturnSubmissionTaskOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPatchReturnSubmissionTaskBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPatchReturnSubmissionTaskConflict() + 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()) + } +} + +// NewPatchReturnSubmissionTaskOK creates a PatchReturnSubmissionTaskOK with default headers values +func NewPatchReturnSubmissionTaskOK() *PatchReturnSubmissionTaskOK { + return &PatchReturnSubmissionTaskOK{} +} + +/*PatchReturnSubmissionTaskOK handles this case with default header values. + +Return Submission Task update response +*/ +type PatchReturnSubmissionTaskOK struct { + + //Payload + + // isStream: false + *models.ReturnSubmissionTaskDetailsResponse +} + +func (o *PatchReturnSubmissionTaskOK) Error() string { + return fmt.Sprintf("[PATCH /transaction/payments/{paymentId}/returns/{returnId}/submissions/{returnSubmissionId}/tasks/{taskId}][%d] patchReturnSubmissionTaskOK", 200) +} + +func (o *PatchReturnSubmissionTaskOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.ReturnSubmissionTaskDetailsResponse = new(models.ReturnSubmissionTaskDetailsResponse) + + // response payload + + if err := consumer.Consume(response.Body(), o.ReturnSubmissionTaskDetailsResponse); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchReturnSubmissionTaskBadRequest creates a PatchReturnSubmissionTaskBadRequest with default headers values +func NewPatchReturnSubmissionTaskBadRequest() *PatchReturnSubmissionTaskBadRequest { + return &PatchReturnSubmissionTaskBadRequest{} +} + +/*PatchReturnSubmissionTaskBadRequest handles this case with default header values. + +Error +*/ +type PatchReturnSubmissionTaskBadRequest struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PatchReturnSubmissionTaskBadRequest) Error() string { + return fmt.Sprintf("[PATCH /transaction/payments/{paymentId}/returns/{returnId}/submissions/{returnSubmissionId}/tasks/{taskId}][%d] patchReturnSubmissionTaskBadRequest", 400) +} + +func (o *PatchReturnSubmissionTaskBadRequest) 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 +} + +// NewPatchReturnSubmissionTaskConflict creates a PatchReturnSubmissionTaskConflict with default headers values +func NewPatchReturnSubmissionTaskConflict() *PatchReturnSubmissionTaskConflict { + return &PatchReturnSubmissionTaskConflict{} +} + +/*PatchReturnSubmissionTaskConflict handles this case with default header values. + +Conflict +*/ +type PatchReturnSubmissionTaskConflict struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PatchReturnSubmissionTaskConflict) Error() string { + return fmt.Sprintf("[PATCH /transaction/payments/{paymentId}/returns/{returnId}/submissions/{returnSubmissionId}/tasks/{taskId}][%d] patchReturnSubmissionTaskConflict", 409) +} + +func (o *PatchReturnSubmissionTaskConflict) 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/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_requests.go b/pkg/generated/client/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_requests.go new file mode 100644 index 00000000..a4fa1f96 --- /dev/null +++ b/pkg/generated/client/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_requests.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payments + +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.PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskID creates a new PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest object +// with the default values initialized. +func (c *Client) PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskID() *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + var () + return &PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest{ + + PaymentSubmissionTaskAmendment: models.PaymentSubmissionTaskAmendmentWithDefaults(c.Defaults), + + ID: c.Defaults.GetStrfmtUUID("PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskID", "id"), + + SubmissionID: c.Defaults.GetStrfmtUUID("PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskID", "submissionId"), + + TaskID: c.Defaults.GetStrfmtUUID("PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskID", "taskId"), + + timeout: cr.DefaultTimeout, + + transport: c.transport, + formats: c.formats, + } +} + +type PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest struct { + + /*PaymentSubmissionTaskPatchRequest*/ + + *models.PaymentSubmissionTaskAmendment + + /*ID Payment Id */ + + ID strfmt.UUID + + /*SubmissionID Submission Id */ + + SubmissionID strfmt.UUID + + /*TaskID Payment Submission Task Id */ + + TaskID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client + + transport runtime.ClientTransport + formats strfmt.Registry +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) FromJson(j string) (*PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest, error) { + + var m models.PaymentSubmissionTaskAmendment + if err := json.Unmarshal([]byte(j), &m); err != nil { + return nil, fmt.Errorf("could not unmarshal JSON: %w", err) + } + + o.PaymentSubmissionTaskAmendment = &m + + return o, nil +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WithPaymentSubmissionTaskPatchRequest(paymentSubmissionTaskPatchRequest models.PaymentSubmissionTaskAmendment) *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + + o.PaymentSubmissionTaskAmendment = &paymentSubmissionTaskPatchRequest + + return o +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WithoutPaymentSubmissionTaskPatchRequest() *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + + o.PaymentSubmissionTaskAmendment = &models.PaymentSubmissionTaskAmendment{} + + return o +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WithID(id strfmt.UUID) *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + + o.ID = id + + return o +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WithSubmissionID(submissionID strfmt.UUID) *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + + o.SubmissionID = submissionID + + return o +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WithTaskID(taskID strfmt.UUID) *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + + o.TaskID = taskID + + return o +} + +////////////////// +// WithContext adds the context to the patch transaction payments ID submissions submission ID tasks task ID Request +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WithContext(ctx context.Context) *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + o.Context = ctx + return o +} + +// WithHTTPClient adds the HTTPClient to the patch transaction payments ID submissions submission ID tasks task ID Request +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WithHTTPClient(client *http.Client) *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest { + o.HTTPClient = client + return o +} + +// WriteToRequest writes these Request to a swagger request +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // ISBODYPARAM + if o.PaymentSubmissionTaskAmendment != nil { + if err := r.SetBodyParam(o.PaymentSubmissionTaskAmendment); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", o.ID.String()); err != nil { + return err + } + + // path param submissionId + if err := r.SetPathParam("submissionId", o.SubmissionID.String()); err != nil { + return err + } + + // path param taskId + if err := r.SetPathParam("taskId", o.TaskID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/generated/client/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_responses.go b/pkg/generated/client/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_responses.go new file mode 100644 index 00000000..679944b0 --- /dev/null +++ b/pkg/generated/client/payments/patch_transaction_payments_id_submissions_submission_id_tasks_task_id_responses.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payments + +// 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" +) + +// PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDReader is a Reader for the PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskID structure. +type PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + case 400: + result := NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + + case 409: + result := NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict() + 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()) + } +} + +// NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK creates a PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK with default headers values +func NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK() *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK { + return &PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK{} +} + +/*PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK handles this case with default header values. + +Payment Submission Task update response +*/ +type PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK struct { + + //Payload + + // isStream: false + *models.PaymentSubmissionTaskDetailsResponse +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK) Error() string { + return fmt.Sprintf("[PATCH /transaction/payments/{id}/submissions/{submissionId}/tasks/{taskId}][%d] patchTransactionPaymentsIdSubmissionsSubmissionIdTasksTaskIdOK", 200) +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.PaymentSubmissionTaskDetailsResponse = new(models.PaymentSubmissionTaskDetailsResponse) + + // response payload + + if err := consumer.Consume(response.Body(), o.PaymentSubmissionTaskDetailsResponse); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest creates a PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest with default headers values +func NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest() *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest { + return &PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest{} +} + +/*PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest handles this case with default header values. + +Error +*/ +type PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest) Error() string { + return fmt.Sprintf("[PATCH /transaction/payments/{id}/submissions/{submissionId}/tasks/{taskId}][%d] patchTransactionPaymentsIdSubmissionsSubmissionIdTasksTaskIdBadRequest", 400) +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDBadRequest) 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 +} + +// NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict creates a PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict with default headers values +func NewPatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict() *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict { + return &PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict{} +} + +/*PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict handles this case with default header values. + +Conflict +*/ +type PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict struct { + + //Payload + + // isStream: false + *models.APIError +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict) Error() string { + return fmt.Sprintf("[PATCH /transaction/payments/{id}/submissions/{submissionId}/tasks/{taskId}][%d] patchTransactionPaymentsIdSubmissionsSubmissionIdTasksTaskIdConflict", 409) +} + +func (o *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDConflict) 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/payments/payments_client.go b/pkg/generated/client/payments/payments_client.go index 1b172dee..fbda162a 100644 --- a/pkg/generated/client/payments/payments_client.go +++ b/pkg/generated/client/payments/payments_client.go @@ -1284,6 +1284,39 @@ func (a *ListPaymentsRequest) MustDo() *ListPaymentsOK { return r0 } +/* +patch return submission task API +*/ +func (a *PatchReturnSubmissionTaskRequest) Do() (*PatchReturnSubmissionTaskOK, error) { + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PatchReturnSubmissionTask", + Method: "PATCH", + PathPattern: "/transaction/payments/{paymentId}/returns/{returnId}/submissions/{returnSubmissionId}/tasks/{taskId}", + ProducesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + ConsumesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + Schemes: []string{"https"}, + Params: a, + Reader: &PatchReturnSubmissionTaskReader{formats: a.formats}, + //AuthInfo: authInfo, + Context: a.Context, + Client: a.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PatchReturnSubmissionTaskOK), nil + +} + +func (a *PatchReturnSubmissionTaskRequest) MustDo() *PatchReturnSubmissionTaskOK { + r0, err := a.Do() + if err != nil { + panic(err) + } + return r0 +} + /* patch transaction payments ID admissions admission ID tasks task ID API */ @@ -1317,6 +1350,39 @@ func (a *PatchTransactionPaymentsIDAdmissionsAdmissionIDTasksTaskIDRequest) Must return r0 } +/* +patch transaction payments ID submissions submission ID tasks task ID API +*/ +func (a *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) Do() (*PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK, error) { + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskID", + Method: "PATCH", + PathPattern: "/transaction/payments/{id}/submissions/{submissionId}/tasks/{taskId}", + ProducesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + ConsumesMediaTypes: []string{"application/json", "application/vnd.api+json"}, + Schemes: []string{"https"}, + Params: a, + Reader: &PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDReader{formats: a.formats}, + //AuthInfo: authInfo, + Context: a.Context, + Client: a.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK), nil + +} + +func (a *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDRequest) MustDo() *PatchTransactionPaymentsIDSubmissionsSubmissionIDTasksTaskIDOK { + r0, err := a.Do() + if err != nil { + panic(err) + } + return r0 +} + ///////// // SetTransport changes the transport on the client diff --git a/pkg/generated/models/account_number_code.go b/pkg/generated/models/account_number_code.go index d8aaf4d0..a2c3775d 100644 --- a/pkg/generated/models/account_number_code.go +++ b/pkg/generated/models/account_number_code.go @@ -21,11 +21,11 @@ type AccountNumberCode string const ( - // AccountNumberCodeIBAN captures enum value "IBAN" - AccountNumberCodeIBAN AccountNumberCode = "IBAN" - // AccountNumberCodeBBAN captures enum value "BBAN" AccountNumberCodeBBAN AccountNumberCode = "BBAN" + + // AccountNumberCodeIBAN captures enum value "IBAN" + AccountNumberCodeIBAN AccountNumberCode = "IBAN" ) // for schema @@ -33,7 +33,7 @@ var accountNumberCodeEnum []interface{} func init() { var res []AccountNumberCode - if err := json.Unmarshal([]byte(`["IBAN","BBAN"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["BBAN","IBAN"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/generated/models/ace.go b/pkg/generated/models/ace.go index 5cc30eaa..3d5cc81f 100644 --- a/pkg/generated/models/ace.go +++ b/pkg/generated/models/ace.go @@ -244,7 +244,6 @@ func (m *Ace) Json() string { type AceAttributes struct { // Action that this ACE controls - // Pattern: ^[A-Za-z]*$ Action string `json:"action,omitempty"` // filter @@ -304,10 +303,6 @@ func (m *AceAttributes) WithRoleID(roleID strfmt.UUID) *AceAttributes { func (m *AceAttributes) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateAction(formats); err != nil { - res = append(res, err) - } - if err := m.validateRecordType(formats); err != nil { res = append(res, err) } @@ -322,19 +317,6 @@ func (m *AceAttributes) Validate(formats strfmt.Registry) error { return nil } -func (m *AceAttributes) validateAction(formats strfmt.Registry) error { - - if swag.IsZero(m.Action) { // not required - return nil - } - - if err := validate.Pattern("attributes"+"."+"action", "body", string(m.Action), `^[A-Za-z]*$`); err != nil { - return err - } - - return nil -} - func (m *AceAttributes) validateRecordType(formats strfmt.Registry) error { if swag.IsZero(m.RecordType) { // not required diff --git a/pkg/generated/models/clearing_channel.go b/pkg/generated/models/clearing_channel.go new file mode 100644 index 00000000..66e5f55e --- /dev/null +++ b/pkg/generated/models/clearing_channel.go @@ -0,0 +1,75 @@ +// 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" +) + +// ClearingChannel Answer to the recall request. Can either be `MPNS`, `RTGS` or `RTNS`. +// swagger:model ClearingChannel +type ClearingChannel string + +const ( + + // ClearingChannelMPNS captures enum value "MPNS" + ClearingChannelMPNS ClearingChannel = "MPNS" + + // ClearingChannelRTGS captures enum value "RTGS" + ClearingChannelRTGS ClearingChannel = "RTGS" + + // ClearingChannelRTNS captures enum value "RTNS" + ClearingChannelRTNS ClearingChannel = "RTNS" +) + +// for schema +var clearingChannelEnum []interface{} + +func init() { + var res []ClearingChannel + if err := json.Unmarshal([]byte(`["MPNS","RTGS","RTNS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + clearingChannelEnum = append(clearingChannelEnum, v) + } +} + +func (m ClearingChannel) validateClearingChannelEnum(path, location string, value ClearingChannel) error { + if err := validate.Enum(path, location, value, clearingChannelEnum); err != nil { + return err + } + return nil +} + +// Validate validates this clearing channel +func (m ClearingChannel) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateClearingChannelEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClearingChannel) 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 index 7423222d..665577a6 100644 --- a/pkg/generated/models/payment_attributes.go +++ b/pkg/generated/models/payment_attributes.go @@ -103,6 +103,9 @@ type PaymentAttributes struct { // Payment reference for beneficiary use Reference string `json:"reference,omitempty"` + // Block to represent a list of references + References []*Reference `json:"references,omitempty"` + // Regulatory reporting information RegulatoryReporting string `json:"regulatory_reporting,omitempty"` @@ -206,6 +209,8 @@ func PaymentAttributesWithDefaults(defaults client.Defaults) *PaymentAttributes Reference: defaults.GetString("PaymentAttributes", "reference"), + References: make([]*Reference, 0), + RegulatoryReporting: defaults.GetString("PaymentAttributes", "regulatory_reporting"), Reimbursement: ReimbursementAccountHoldingEntityWithDefaults(defaults), @@ -460,6 +465,13 @@ func (m *PaymentAttributes) WithReference(reference string) *PaymentAttributes { return m } +func (m *PaymentAttributes) WithReferences(references []*Reference) *PaymentAttributes { + + m.References = references + + return m +} + func (m *PaymentAttributes) WithRegulatoryReporting(regulatoryReporting string) *PaymentAttributes { m.RegulatoryReporting = regulatoryReporting @@ -649,6 +661,10 @@ func (m *PaymentAttributes) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateReferences(formats); err != nil { + res = append(res, err) + } + if err := m.validateReimbursement(formats); err != nil { res = append(res, err) } @@ -863,6 +879,31 @@ func (m *PaymentAttributes) validateReceiversCorrespondent(formats strfmt.Regist return nil } +func (m *PaymentAttributes) validateReferences(formats strfmt.Registry) error { + + if swag.IsZero(m.References) { // not required + return nil + } + + for i := 0; i < len(m.References); i++ { + if swag.IsZero(m.References[i]) { // not required + continue + } + + if m.References[i] != nil { + if err := m.References[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *PaymentAttributes) validateReimbursement(formats strfmt.Registry) error { if swag.IsZero(m.Reimbursement) { // not required @@ -1105,6 +1146,9 @@ type PaymentAttributesBeneficiaryParty struct { // Country of the beneficiary address, ISO 3166 format country code Country string `json:"country,omitempty"` + // Country of residence of the beneficiary party, ISO 3166 format country code + CountryOfResidence string `json:"country_of_residence,omitempty"` + // Beneficiary name Name string `json:"name,omitempty"` @@ -1167,6 +1211,8 @@ func PaymentAttributesBeneficiaryPartyWithDefaults(defaults client.Defaults) *Pa Country: defaults.GetString("PaymentAttributesBeneficiaryParty", "country"), + CountryOfResidence: defaults.GetString("PaymentAttributesBeneficiaryParty", "country_of_residence"), + Name: defaults.GetString("PaymentAttributesBeneficiaryParty", "name"), OrganisationIdentification: defaults.GetString("PaymentAttributesBeneficiaryParty", "organisation_identification"), @@ -1297,6 +1343,13 @@ func (m *PaymentAttributesBeneficiaryParty) WithCountry(country string) *Payment return m } +func (m *PaymentAttributesBeneficiaryParty) WithCountryOfResidence(countryOfResidence string) *PaymentAttributesBeneficiaryParty { + + m.CountryOfResidence = countryOfResidence + + return m +} + func (m *PaymentAttributesBeneficiaryParty) WithName(name string) *PaymentAttributesBeneficiaryParty { m.Name = name @@ -1532,6 +1585,9 @@ type PaymentAttributesDebtorParty struct { // Country of debtor address. ISO 3166 format country code" Country string `json:"country,omitempty"` + // Country of residence of the debtor party, ISO 3166 format country code + CountryOfResidence string `json:"country_of_residence,omitempty"` + // SWIFT BIC for ordering customer, either BIC8 or BIC11 CustomerID string `json:"customer_id,omitempty"` @@ -1595,6 +1651,8 @@ func PaymentAttributesDebtorPartyWithDefaults(defaults client.Defaults) *Payment Country: defaults.GetString("PaymentAttributesDebtorParty", "country"), + CountryOfResidence: defaults.GetString("PaymentAttributesDebtorParty", "country_of_residence"), + CustomerID: defaults.GetString("PaymentAttributesDebtorParty", "customer_id"), CustomerIDCode: defaults.GetString("PaymentAttributesDebtorParty", "customer_id_code"), @@ -1720,6 +1778,13 @@ func (m *PaymentAttributesDebtorParty) WithCountry(country string) *PaymentAttri return m } +func (m *PaymentAttributesDebtorParty) WithCountryOfResidence(countryOfResidence string) *PaymentAttributesDebtorParty { + + m.CountryOfResidence = countryOfResidence + + return m +} + func (m *PaymentAttributesDebtorParty) WithCustomerID(customerID string) *PaymentAttributesDebtorParty { m.CustomerID = customerID diff --git a/pkg/generated/models/payment_scheme.go b/pkg/generated/models/payment_scheme.go index ab6eacca..f9ebd7b9 100644 --- a/pkg/generated/models/payment_scheme.go +++ b/pkg/generated/models/payment_scheme.go @@ -29,6 +29,9 @@ const ( // PaymentSchemeTCHRTP captures enum value "TCHRTP" PaymentSchemeTCHRTP PaymentScheme = "TCHRTP" + + // PaymentSchemeFDN captures enum value "FDN" + PaymentSchemeFDN PaymentScheme = "FDN" ) // for schema @@ -36,7 +39,7 @@ var paymentSchemeEnum []interface{} func init() { var res []PaymentScheme - if err := json.Unmarshal([]byte(`["FPS","SEPAINSTANT","TCHRTP"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["FPS","SEPAINSTANT","TCHRTP","FDN"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/generated/models/payment_submission_task.go b/pkg/generated/models/payment_submission_task.go new file mode 100644 index 00000000..ec9d03f9 --- /dev/null +++ b/pkg/generated/models/payment_submission_task.go @@ -0,0 +1,480 @@ +// 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" +) + +// PaymentSubmissionTask payment submission task +// swagger:model PaymentSubmissionTask +type PaymentSubmissionTask struct { + + // attributes + Attributes *PaymentSubmissionTaskAttributes `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"` + + // relationships + Relationships *PaymentSubmissionTaskRelationships `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 PaymentSubmissionTaskWithDefaults(defaults client.Defaults) *PaymentSubmissionTask { + return &PaymentSubmissionTask{ + + Attributes: PaymentSubmissionTaskAttributesWithDefaults(defaults), + + CreatedOn: defaults.GetStrfmtDateTime("PaymentSubmissionTask", "created_on"), + + ID: defaults.GetStrfmtUUID("PaymentSubmissionTask", "id"), + + ModifiedOn: defaults.GetStrfmtDateTime("PaymentSubmissionTask", "modified_on"), + + OrganisationID: defaults.GetStrfmtUUID("PaymentSubmissionTask", "organisation_id"), + + Relationships: PaymentSubmissionTaskRelationshipsWithDefaults(defaults), + + Type: defaults.GetString("PaymentSubmissionTask", "type"), + + Version: defaults.GetInt64Ptr("PaymentSubmissionTask", "version"), + } +} + +func (m *PaymentSubmissionTask) WithAttributes(attributes PaymentSubmissionTaskAttributes) *PaymentSubmissionTask { + + m.Attributes = &attributes + + return m +} + +func (m *PaymentSubmissionTask) WithoutAttributes() *PaymentSubmissionTask { + m.Attributes = nil + return m +} + +func (m *PaymentSubmissionTask) WithCreatedOn(createdOn strfmt.DateTime) *PaymentSubmissionTask { + + m.CreatedOn = createdOn + + return m +} + +func (m *PaymentSubmissionTask) WithID(id strfmt.UUID) *PaymentSubmissionTask { + + m.ID = id + + return m +} + +func (m *PaymentSubmissionTask) WithModifiedOn(modifiedOn strfmt.DateTime) *PaymentSubmissionTask { + + m.ModifiedOn = modifiedOn + + return m +} + +func (m *PaymentSubmissionTask) WithOrganisationID(organisationID strfmt.UUID) *PaymentSubmissionTask { + + m.OrganisationID = organisationID + + return m +} + +func (m *PaymentSubmissionTask) WithRelationships(relationships PaymentSubmissionTaskRelationships) *PaymentSubmissionTask { + + m.Relationships = &relationships + + return m +} + +func (m *PaymentSubmissionTask) WithoutRelationships() *PaymentSubmissionTask { + m.Relationships = nil + return m +} + +func (m *PaymentSubmissionTask) WithType(typeVar string) *PaymentSubmissionTask { + + m.Type = typeVar + + return m +} + +func (m *PaymentSubmissionTask) WithVersion(version int64) *PaymentSubmissionTask { + + m.Version = &version + + return m +} + +func (m *PaymentSubmissionTask) WithoutVersion() *PaymentSubmissionTask { + m.Version = nil + return m +} + +// Validate validates this payment submission task +func (m *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) 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 *PaymentSubmissionTask) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentSubmissionTask) UnmarshalBinary(b []byte) error { + var res PaymentSubmissionTask + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentSubmissionTask) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentSubmissionTaskAttributes payment submission task attributes +// swagger:model PaymentSubmissionTaskAttributes +type PaymentSubmissionTaskAttributes struct { + + // assignee + Assignee PaymentSubmissionTaskAssignee `json:"assignee,omitempty"` + + // name + Name PaymentSubmissionTaskName `json:"name,omitempty"` + + // Key Value map that contains the Task result. + Output map[string]interface{} `json:"output,omitempty"` + + // status + Status PaymentSubmissionTaskStatus `json:"status,omitempty"` +} + +func PaymentSubmissionTaskAttributesWithDefaults(defaults client.Defaults) *PaymentSubmissionTaskAttributes { + return &PaymentSubmissionTaskAttributes{ + + // TODO Assignee: PaymentSubmissionTaskAssignee, + + // TODO Name: PaymentSubmissionTaskName, + + Output: defaults.GetMapStringInterface("PaymentSubmissionTaskAttributes", "output"), + + // TODO Status: PaymentSubmissionTaskStatus, + + } +} + +func (m *PaymentSubmissionTaskAttributes) WithAssignee(assignee PaymentSubmissionTaskAssignee) *PaymentSubmissionTaskAttributes { + + m.Assignee = assignee + + return m +} + +func (m *PaymentSubmissionTaskAttributes) WithName(name PaymentSubmissionTaskName) *PaymentSubmissionTaskAttributes { + + m.Name = name + + return m +} + +func (m *PaymentSubmissionTaskAttributes) WithOutput(output map[string]interface{}) *PaymentSubmissionTaskAttributes { + + m.Output = output + + return m +} + +func (m *PaymentSubmissionTaskAttributes) WithStatus(status PaymentSubmissionTaskStatus) *PaymentSubmissionTaskAttributes { + + m.Status = status + + return m +} + +// Validate validates this payment submission task attributes +func (m *PaymentSubmissionTaskAttributes) 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 *PaymentSubmissionTaskAttributes) 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 *PaymentSubmissionTaskAttributes) 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 *PaymentSubmissionTaskAttributes) 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 *PaymentSubmissionTaskAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentSubmissionTaskAttributes) UnmarshalBinary(b []byte) error { + var res PaymentSubmissionTaskAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentSubmissionTaskAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_submission_task_amendment.go b/pkg/generated/models/payment_submission_task_amendment.go new file mode 100644 index 00000000..8ff6e44b --- /dev/null +++ b/pkg/generated/models/payment_submission_task_amendment.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" +) + +// PaymentSubmissionTaskAmendment payment submission task amendment +// swagger:model PaymentSubmissionTaskAmendment +type PaymentSubmissionTaskAmendment struct { + + // data + Data *PaymentSubmissionTaskUpdate `json:"data,omitempty"` +} + +func PaymentSubmissionTaskAmendmentWithDefaults(defaults client.Defaults) *PaymentSubmissionTaskAmendment { + return &PaymentSubmissionTaskAmendment{ + + Data: PaymentSubmissionTaskUpdateWithDefaults(defaults), + } +} + +func (m *PaymentSubmissionTaskAmendment) WithData(data PaymentSubmissionTaskUpdate) *PaymentSubmissionTaskAmendment { + + m.Data = &data + + return m +} + +func (m *PaymentSubmissionTaskAmendment) WithoutData() *PaymentSubmissionTaskAmendment { + m.Data = nil + return m +} + +// Validate validates this payment submission task amendment +func (m *PaymentSubmissionTaskAmendment) 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 *PaymentSubmissionTaskAmendment) 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 *PaymentSubmissionTaskAmendment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentSubmissionTaskAmendment) UnmarshalBinary(b []byte) error { + var res PaymentSubmissionTaskAmendment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentSubmissionTaskAmendment) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_submission_task_assignee.go b/pkg/generated/models/payment_submission_task_assignee.go new file mode 100644 index 00000000..36396eda --- /dev/null +++ b/pkg/generated/models/payment_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" +) + +// PaymentSubmissionTaskAssignee Helps to identify the owner of the task +// swagger:model PaymentSubmissionTaskAssignee +type PaymentSubmissionTaskAssignee string + +const ( + + // PaymentSubmissionTaskAssigneeForm3 captures enum value "form3" + PaymentSubmissionTaskAssigneeForm3 PaymentSubmissionTaskAssignee = "form3" +) + +// for schema +var paymentSubmissionTaskAssigneeEnum []interface{} + +func init() { + var res []PaymentSubmissionTaskAssignee + if err := json.Unmarshal([]byte(`["form3"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentSubmissionTaskAssigneeEnum = append(paymentSubmissionTaskAssigneeEnum, v) + } +} + +func (m PaymentSubmissionTaskAssignee) validatePaymentSubmissionTaskAssigneeEnum(path, location string, value PaymentSubmissionTaskAssignee) error { + if err := validate.Enum(path, location, value, paymentSubmissionTaskAssigneeEnum); err != nil { + return err + } + return nil +} + +// Validate validates this payment submission task assignee +func (m PaymentSubmissionTaskAssignee) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentSubmissionTaskAssigneeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentSubmissionTaskAssignee) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_submission_task_details_response.go b/pkg/generated/models/payment_submission_task_details_response.go new file mode 100644 index 00000000..156cba7b --- /dev/null +++ b/pkg/generated/models/payment_submission_task_details_response.go @@ -0,0 +1,140 @@ +// 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" +) + +// PaymentSubmissionTaskDetailsResponse payment submission task details response +// swagger:model PaymentSubmissionTaskDetailsResponse +type PaymentSubmissionTaskDetailsResponse struct { + + // data + Data *PaymentSubmissionTask `json:"data,omitempty"` + + // links + Links *Links `json:"links,omitempty"` +} + +func PaymentSubmissionTaskDetailsResponseWithDefaults(defaults client.Defaults) *PaymentSubmissionTaskDetailsResponse { + return &PaymentSubmissionTaskDetailsResponse{ + + Data: PaymentSubmissionTaskWithDefaults(defaults), + + Links: LinksWithDefaults(defaults), + } +} + +func (m *PaymentSubmissionTaskDetailsResponse) WithData(data PaymentSubmissionTask) *PaymentSubmissionTaskDetailsResponse { + + m.Data = &data + + return m +} + +func (m *PaymentSubmissionTaskDetailsResponse) WithoutData() *PaymentSubmissionTaskDetailsResponse { + m.Data = nil + return m +} + +func (m *PaymentSubmissionTaskDetailsResponse) WithLinks(links Links) *PaymentSubmissionTaskDetailsResponse { + + m.Links = &links + + return m +} + +func (m *PaymentSubmissionTaskDetailsResponse) WithoutLinks() *PaymentSubmissionTaskDetailsResponse { + m.Links = nil + return m +} + +// Validate validates this payment submission task details response +func (m *PaymentSubmissionTaskDetailsResponse) 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 *PaymentSubmissionTaskDetailsResponse) 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 +} + +func (m *PaymentSubmissionTaskDetailsResponse) 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 *PaymentSubmissionTaskDetailsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentSubmissionTaskDetailsResponse) UnmarshalBinary(b []byte) error { + var res PaymentSubmissionTaskDetailsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentSubmissionTaskDetailsResponse) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_submission_task_name.go b/pkg/generated/models/payment_submission_task_name.go new file mode 100644 index 00000000..1a5740f0 --- /dev/null +++ b/pkg/generated/models/payment_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" +) + +// PaymentSubmissionTaskName Identifies the payment submission task to be executed +// swagger:model PaymentSubmissionTaskName +type PaymentSubmissionTaskName string + +// Validate validates this payment submission task name +func (m PaymentSubmissionTaskName) Validate(formats strfmt.Registry) error { + return nil +} +func (m *PaymentSubmissionTaskName) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_submission_task_relationships.go b/pkg/generated/models/payment_submission_task_relationships.go new file mode 100644 index 00000000..31c1bead --- /dev/null +++ b/pkg/generated/models/payment_submission_task_relationships.go @@ -0,0 +1,140 @@ +// 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" +) + +// PaymentSubmissionTaskRelationships payment submission task relationships +// swagger:model PaymentSubmissionTaskRelationships +type PaymentSubmissionTaskRelationships struct { + + // payment + Payment *RelationshipPayments `json:"payment,omitempty"` + + // payment submission + PaymentSubmission *RelationshipPaymentSubmissions `json:"payment_submission,omitempty"` +} + +func PaymentSubmissionTaskRelationshipsWithDefaults(defaults client.Defaults) *PaymentSubmissionTaskRelationships { + return &PaymentSubmissionTaskRelationships{ + + Payment: RelationshipPaymentsWithDefaults(defaults), + + PaymentSubmission: RelationshipPaymentSubmissionsWithDefaults(defaults), + } +} + +func (m *PaymentSubmissionTaskRelationships) WithPayment(payment RelationshipPayments) *PaymentSubmissionTaskRelationships { + + m.Payment = &payment + + return m +} + +func (m *PaymentSubmissionTaskRelationships) WithoutPayment() *PaymentSubmissionTaskRelationships { + m.Payment = nil + return m +} + +func (m *PaymentSubmissionTaskRelationships) WithPaymentSubmission(paymentSubmission RelationshipPaymentSubmissions) *PaymentSubmissionTaskRelationships { + + m.PaymentSubmission = &paymentSubmission + + return m +} + +func (m *PaymentSubmissionTaskRelationships) WithoutPaymentSubmission() *PaymentSubmissionTaskRelationships { + m.PaymentSubmission = nil + return m +} + +// Validate validates this payment submission task relationships +func (m *PaymentSubmissionTaskRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePayment(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 *PaymentSubmissionTaskRelationships) validatePayment(formats strfmt.Registry) error { + + if swag.IsZero(m.Payment) { // not required + return nil + } + + if m.Payment != nil { + if err := m.Payment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment") + } + return err + } + } + + return nil +} + +func (m *PaymentSubmissionTaskRelationships) 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 *PaymentSubmissionTaskRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentSubmissionTaskRelationships) UnmarshalBinary(b []byte) error { + var res PaymentSubmissionTaskRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentSubmissionTaskRelationships) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_submission_task_status.go b/pkg/generated/models/payment_submission_task_status.go new file mode 100644 index 00000000..73768f34 --- /dev/null +++ b/pkg/generated/models/payment_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" +) + +// PaymentSubmissionTaskStatus status of the submission task +// swagger:model PaymentSubmissionTaskStatus +type PaymentSubmissionTaskStatus string + +const ( + + // PaymentSubmissionTaskStatusCompleted captures enum value "completed" + PaymentSubmissionTaskStatusCompleted PaymentSubmissionTaskStatus = "completed" + + // PaymentSubmissionTaskStatusFailed captures enum value "failed" + PaymentSubmissionTaskStatusFailed PaymentSubmissionTaskStatus = "failed" + + // PaymentSubmissionTaskStatusPending captures enum value "pending" + PaymentSubmissionTaskStatusPending PaymentSubmissionTaskStatus = "pending" + + // PaymentSubmissionTaskStatusOnHold captures enum value "on_hold" + PaymentSubmissionTaskStatusOnHold PaymentSubmissionTaskStatus = "on_hold" +) + +// for schema +var paymentSubmissionTaskStatusEnum []interface{} + +func init() { + var res []PaymentSubmissionTaskStatus + if err := json.Unmarshal([]byte(`["completed","failed","pending","on_hold"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentSubmissionTaskStatusEnum = append(paymentSubmissionTaskStatusEnum, v) + } +} + +func (m PaymentSubmissionTaskStatus) validatePaymentSubmissionTaskStatusEnum(path, location string, value PaymentSubmissionTaskStatus) error { + if err := validate.Enum(path, location, value, paymentSubmissionTaskStatusEnum); err != nil { + return err + } + return nil +} + +// Validate validates this payment submission task status +func (m PaymentSubmissionTaskStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentSubmissionTaskStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentSubmissionTaskStatus) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/payment_submission_task_update.go b/pkg/generated/models/payment_submission_task_update.go new file mode 100644 index 00000000..98a63f89 --- /dev/null +++ b/pkg/generated/models/payment_submission_task_update.go @@ -0,0 +1,344 @@ +// 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" +) + +// PaymentSubmissionTaskUpdate payment submission task update +// swagger:model PaymentSubmissionTaskUpdate +type PaymentSubmissionTaskUpdate struct { + + // attributes + Attributes *PaymentSubmissionTaskUpdateAttributes `json:"attributes,omitempty"` + + // Unique resource ID + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Unique ID of the organisation this resource is created by + // Format: uuid + OrganisationID strfmt.UUID `json:"organisation_id,omitempty"` + + // type + // Enum: [payment_submission_tasks] + Type string `json:"type,omitempty"` + + // Version number + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func PaymentSubmissionTaskUpdateWithDefaults(defaults client.Defaults) *PaymentSubmissionTaskUpdate { + return &PaymentSubmissionTaskUpdate{ + + Attributes: PaymentSubmissionTaskUpdateAttributesWithDefaults(defaults), + + ID: defaults.GetStrfmtUUID("PaymentSubmissionTaskUpdate", "id"), + + OrganisationID: defaults.GetStrfmtUUID("PaymentSubmissionTaskUpdate", "organisation_id"), + + Type: defaults.GetString("PaymentSubmissionTaskUpdate", "type"), + + Version: defaults.GetInt64Ptr("PaymentSubmissionTaskUpdate", "version"), + } +} + +func (m *PaymentSubmissionTaskUpdate) WithAttributes(attributes PaymentSubmissionTaskUpdateAttributes) *PaymentSubmissionTaskUpdate { + + m.Attributes = &attributes + + return m +} + +func (m *PaymentSubmissionTaskUpdate) WithoutAttributes() *PaymentSubmissionTaskUpdate { + m.Attributes = nil + return m +} + +func (m *PaymentSubmissionTaskUpdate) WithID(id strfmt.UUID) *PaymentSubmissionTaskUpdate { + + m.ID = id + + return m +} + +func (m *PaymentSubmissionTaskUpdate) WithOrganisationID(organisationID strfmt.UUID) *PaymentSubmissionTaskUpdate { + + m.OrganisationID = organisationID + + return m +} + +func (m *PaymentSubmissionTaskUpdate) WithType(typeVar string) *PaymentSubmissionTaskUpdate { + + m.Type = typeVar + + return m +} + +func (m *PaymentSubmissionTaskUpdate) WithVersion(version int64) *PaymentSubmissionTaskUpdate { + + m.Version = &version + + return m +} + +func (m *PaymentSubmissionTaskUpdate) WithoutVersion() *PaymentSubmissionTaskUpdate { + m.Version = nil + return m +} + +// Validate validates this payment submission task update +func (m *PaymentSubmissionTaskUpdate) 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.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 *PaymentSubmissionTaskUpdate) 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 *PaymentSubmissionTaskUpdate) 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 *PaymentSubmissionTaskUpdate) 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 +} + +var paymentSubmissionTaskUpdateTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["payment_submission_tasks"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentSubmissionTaskUpdateTypeTypePropEnum = append(paymentSubmissionTaskUpdateTypeTypePropEnum, v) + } +} + +const ( + + // PaymentSubmissionTaskUpdateTypePaymentSubmissionTasks captures enum value "payment_submission_tasks" + PaymentSubmissionTaskUpdateTypePaymentSubmissionTasks string = "payment_submission_tasks" +) + +// prop value enum +func (m *PaymentSubmissionTaskUpdate) validateTypeEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, paymentSubmissionTaskUpdateTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *PaymentSubmissionTaskUpdate) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *PaymentSubmissionTaskUpdate) 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 *PaymentSubmissionTaskUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentSubmissionTaskUpdate) UnmarshalBinary(b []byte) error { + var res PaymentSubmissionTaskUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentSubmissionTaskUpdate) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// PaymentSubmissionTaskUpdateAttributes payment submission task update attributes +// swagger:model PaymentSubmissionTaskUpdateAttributes +type PaymentSubmissionTaskUpdateAttributes struct { + + // Key Value map that contains the Task result. + Output map[string]interface{} `json:"output,omitempty"` + + // status + Status PaymentSubmissionTaskStatus `json:"status,omitempty"` +} + +func PaymentSubmissionTaskUpdateAttributesWithDefaults(defaults client.Defaults) *PaymentSubmissionTaskUpdateAttributes { + return &PaymentSubmissionTaskUpdateAttributes{ + + Output: defaults.GetMapStringInterface("PaymentSubmissionTaskUpdateAttributes", "output"), + + // TODO Status: PaymentSubmissionTaskStatus, + + } +} + +func (m *PaymentSubmissionTaskUpdateAttributes) WithOutput(output map[string]interface{}) *PaymentSubmissionTaskUpdateAttributes { + + m.Output = output + + return m +} + +func (m *PaymentSubmissionTaskUpdateAttributes) WithStatus(status PaymentSubmissionTaskStatus) *PaymentSubmissionTaskUpdateAttributes { + + m.Status = status + + return m +} + +// Validate validates this payment submission task update attributes +func (m *PaymentSubmissionTaskUpdateAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentSubmissionTaskUpdateAttributes) 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 *PaymentSubmissionTaskUpdateAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentSubmissionTaskUpdateAttributes) UnmarshalBinary(b []byte) error { + var res PaymentSubmissionTaskUpdateAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *PaymentSubmissionTaskUpdateAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/recall_decision.go b/pkg/generated/models/recall_decision.go index 9171ea37..487c104f 100644 --- a/pkg/generated/models/recall_decision.go +++ b/pkg/generated/models/recall_decision.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" @@ -351,6 +352,9 @@ func (m *RecallDecision) Json() string { // swagger:model RecallDecisionAttributes type RecallDecisionAttributes struct { + // agents + Agents []*RecallDecisionAttributesAgentsItems0 `json:"agents,omitempty"` + // answer Answer RecallDecisionAnswer `json:"answer,omitempty"` @@ -365,11 +369,16 @@ type RecallDecisionAttributes struct { // recall amount RecallAmount *CurrencyAndAmount `json:"recall_amount,omitempty"` + + // resolution related information + ResolutionRelatedInformation *ResolutionRelatedInformation `json:"resolution_related_information,omitempty"` } func RecallDecisionAttributesWithDefaults(defaults client.Defaults) *RecallDecisionAttributes { return &RecallDecisionAttributes{ + Agents: make([]*RecallDecisionAttributesAgentsItems0, 0), + // TODO Answer: RecallDecisionAnswer, ChargesAmount: CurrencyAndAmountWithDefaults(defaults), @@ -379,9 +388,18 @@ func RecallDecisionAttributesWithDefaults(defaults client.Defaults) *RecallDecis ReasonCode: defaults.GetString("RecallDecisionAttributes", "reason_code"), RecallAmount: CurrencyAndAmountWithDefaults(defaults), + + ResolutionRelatedInformation: ResolutionRelatedInformationWithDefaults(defaults), } } +func (m *RecallDecisionAttributes) WithAgents(agents []*RecallDecisionAttributesAgentsItems0) *RecallDecisionAttributes { + + m.Agents = agents + + return m +} + func (m *RecallDecisionAttributes) WithAnswer(answer RecallDecisionAnswer) *RecallDecisionAttributes { m.Answer = answer @@ -427,10 +445,26 @@ func (m *RecallDecisionAttributes) WithoutRecallAmount() *RecallDecisionAttribut return m } +func (m *RecallDecisionAttributes) WithResolutionRelatedInformation(resolutionRelatedInformation ResolutionRelatedInformation) *RecallDecisionAttributes { + + m.ResolutionRelatedInformation = &resolutionRelatedInformation + + return m +} + +func (m *RecallDecisionAttributes) WithoutResolutionRelatedInformation() *RecallDecisionAttributes { + m.ResolutionRelatedInformation = nil + return m +} + // Validate validates this recall decision attributes func (m *RecallDecisionAttributes) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + if err := m.validateAnswer(formats); err != nil { res = append(res, err) } @@ -443,12 +477,41 @@ func (m *RecallDecisionAttributes) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateResolutionRelatedInformation(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +func (m *RecallDecisionAttributes) 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 *RecallDecisionAttributes) validateAnswer(formats strfmt.Registry) error { if swag.IsZero(m.Answer) { // not required @@ -501,6 +564,24 @@ func (m *RecallDecisionAttributes) validateRecallAmount(formats strfmt.Registry) return nil } +func (m *RecallDecisionAttributes) validateResolutionRelatedInformation(formats strfmt.Registry) error { + + if swag.IsZero(m.ResolutionRelatedInformation) { // not required + return nil + } + + if m.ResolutionRelatedInformation != nil { + if err := m.ResolutionRelatedInformation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attributes" + "." + "resolution_related_information") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *RecallDecisionAttributes) MarshalBinary() ([]byte, error) { if m == nil { @@ -526,6 +607,166 @@ func (m *RecallDecisionAttributes) Json() string { return string(json) } +// RecallDecisionAttributesAgentsItems0 recall decision attributes agents items0 +// swagger:model RecallDecisionAttributesAgentsItems0 +type RecallDecisionAttributesAgentsItems0 struct { + + // identification + Identification *RecallDecisionAttributesAgentsItems0Identification `json:"identification,omitempty"` + + // role + Role string `json:"role,omitempty"` +} + +func RecallDecisionAttributesAgentsItems0WithDefaults(defaults client.Defaults) *RecallDecisionAttributesAgentsItems0 { + return &RecallDecisionAttributesAgentsItems0{ + + Identification: RecallDecisionAttributesAgentsItems0IdentificationWithDefaults(defaults), + + Role: defaults.GetString("RecallDecisionAttributesAgentsItems0", "role"), + } +} + +func (m *RecallDecisionAttributesAgentsItems0) WithIdentification(identification RecallDecisionAttributesAgentsItems0Identification) *RecallDecisionAttributesAgentsItems0 { + + m.Identification = &identification + + return m +} + +func (m *RecallDecisionAttributesAgentsItems0) WithoutIdentification() *RecallDecisionAttributesAgentsItems0 { + m.Identification = nil + return m +} + +func (m *RecallDecisionAttributesAgentsItems0) WithRole(role string) *RecallDecisionAttributesAgentsItems0 { + + m.Role = role + + return m +} + +// Validate validates this recall decision attributes agents items0 +func (m *RecallDecisionAttributesAgentsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIdentification(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RecallDecisionAttributesAgentsItems0) validateIdentification(formats strfmt.Registry) error { + + if swag.IsZero(m.Identification) { // not required + return nil + } + + if m.Identification != nil { + if err := m.Identification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("identification") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RecallDecisionAttributesAgentsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RecallDecisionAttributesAgentsItems0) UnmarshalBinary(b []byte) error { + var res RecallDecisionAttributesAgentsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *RecallDecisionAttributesAgentsItems0) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// RecallDecisionAttributesAgentsItems0Identification recall decision attributes agents items0 identification +// swagger:model RecallDecisionAttributesAgentsItems0Identification +type RecallDecisionAttributesAgentsItems0Identification struct { + + // Identification code of the financial institution. + BankID string `json:"bank_id,omitempty"` + + // Type of identification provided in bank_id field. Required when bank_id is provided, not used otherwise. + BankIDCode string `json:"bank_id_code,omitempty"` +} + +func RecallDecisionAttributesAgentsItems0IdentificationWithDefaults(defaults client.Defaults) *RecallDecisionAttributesAgentsItems0Identification { + return &RecallDecisionAttributesAgentsItems0Identification{ + + BankID: defaults.GetString("RecallDecisionAttributesAgentsItems0Identification", "bank_id"), + + BankIDCode: defaults.GetString("RecallDecisionAttributesAgentsItems0Identification", "bank_id_code"), + } +} + +func (m *RecallDecisionAttributesAgentsItems0Identification) WithBankID(bankID string) *RecallDecisionAttributesAgentsItems0Identification { + + m.BankID = bankID + + return m +} + +func (m *RecallDecisionAttributesAgentsItems0Identification) WithBankIDCode(bankIDCode string) *RecallDecisionAttributesAgentsItems0Identification { + + m.BankIDCode = bankIDCode + + return m +} + +// Validate validates this recall decision attributes agents items0 identification +func (m *RecallDecisionAttributesAgentsItems0Identification) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RecallDecisionAttributesAgentsItems0Identification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RecallDecisionAttributesAgentsItems0Identification) UnmarshalBinary(b []byte) error { + var res RecallDecisionAttributesAgentsItems0Identification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *RecallDecisionAttributesAgentsItems0Identification) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + // RecallDecisionRelationships recall decision relationships // swagger:model RecallDecisionRelationships type RecallDecisionRelationships struct { diff --git a/pkg/generated/models/recall_decision_answer.go b/pkg/generated/models/recall_decision_answer.go index d685d149..97b54463 100644 --- a/pkg/generated/models/recall_decision_answer.go +++ b/pkg/generated/models/recall_decision_answer.go @@ -26,6 +26,9 @@ const ( // RecallDecisionAnswerRejected captures enum value "rejected" RecallDecisionAnswerRejected RecallDecisionAnswer = "rejected" + + // RecallDecisionAnswerPending captures enum value "pending" + RecallDecisionAnswerPending RecallDecisionAnswer = "pending" ) // for schema @@ -33,7 +36,7 @@ var recallDecisionAnswerEnum []interface{} func init() { var res []RecallDecisionAnswer - if err := json.Unmarshal([]byte(`["accepted","rejected"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["accepted","rejected","pending"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/generated/models/reference.go b/pkg/generated/models/reference.go new file mode 100644 index 00000000..d279fdc8 --- /dev/null +++ b/pkg/generated/models/reference.go @@ -0,0 +1,145 @@ +// 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" +) + +// Reference reference +// swagger:model Reference +type Reference struct { + + // Name of the reference type + // Required: true + // Max Length: 45 + // Min Length: 1 + Type *string `json:"type"` + + // Value of the provided reference type + // Required: true + // Max Length: 45 + // Min Length: 1 + Value *string `json:"value"` +} + +func ReferenceWithDefaults(defaults client.Defaults) *Reference { + return &Reference{ + + Type: defaults.GetStringPtr("Reference", "type"), + + Value: defaults.GetStringPtr("Reference", "value"), + } +} + +func (m *Reference) WithType(typeVar string) *Reference { + + m.Type = &typeVar + + return m +} + +func (m *Reference) WithoutType() *Reference { + m.Type = nil + return m +} + +func (m *Reference) WithValue(value string) *Reference { + + m.Value = &value + + return m +} + +func (m *Reference) WithoutValue() *Reference { + m.Value = nil + return m +} + +// Validate validates this reference +func (m *Reference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(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 *Reference) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if err := validate.MinLength("type", "body", string(*m.Type), 1); err != nil { + return err + } + + if err := validate.MaxLength("type", "body", string(*m.Type), 45); err != nil { + return err + } + + return nil +} + +func (m *Reference) 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 *Reference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Reference) UnmarshalBinary(b []byte) error { + var res Reference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *Reference) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/relationship_payment_submissions.go b/pkg/generated/models/relationship_payment_submissions.go new file mode 100644 index 00000000..d75e5b2d --- /dev/null +++ b/pkg/generated/models/relationship_payment_submissions.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" +) + +// RelationshipPaymentSubmissions relationship payment submissions +// swagger:model RelationshipPaymentSubmissions +type RelationshipPaymentSubmissions struct { + + // data + Data []*PaymentSubmission `json:"data"` +} + +func RelationshipPaymentSubmissionsWithDefaults(defaults client.Defaults) *RelationshipPaymentSubmissions { + return &RelationshipPaymentSubmissions{ + + Data: make([]*PaymentSubmission, 0), + } +} + +func (m *RelationshipPaymentSubmissions) WithData(data []*PaymentSubmission) *RelationshipPaymentSubmissions { + + m.Data = data + + return m +} + +// Validate validates this relationship payment submissions +func (m *RelationshipPaymentSubmissions) 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 *RelationshipPaymentSubmissions) 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 +} + +// MarshalBinary interface implementation +func (m *RelationshipPaymentSubmissions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RelationshipPaymentSubmissions) UnmarshalBinary(b []byte) error { + var res RelationshipPaymentSubmissions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *RelationshipPaymentSubmissions) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/relationship_return_submissions.go b/pkg/generated/models/relationship_return_submissions.go new file mode 100644 index 00000000..cbfa3fbb --- /dev/null +++ b/pkg/generated/models/relationship_return_submissions.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" +) + +// RelationshipReturnSubmissions relationship return submissions +// swagger:model RelationshipReturnSubmissions +type RelationshipReturnSubmissions struct { + + // data + Data []*ReturnSubmission `json:"data"` +} + +func RelationshipReturnSubmissionsWithDefaults(defaults client.Defaults) *RelationshipReturnSubmissions { + return &RelationshipReturnSubmissions{ + + Data: make([]*ReturnSubmission, 0), + } +} + +func (m *RelationshipReturnSubmissions) WithData(data []*ReturnSubmission) *RelationshipReturnSubmissions { + + m.Data = data + + return m +} + +// Validate validates this relationship return submissions +func (m *RelationshipReturnSubmissions) 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 *RelationshipReturnSubmissions) 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 +} + +// MarshalBinary interface implementation +func (m *RelationshipReturnSubmissions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RelationshipReturnSubmissions) UnmarshalBinary(b []byte) error { + var res RelationshipReturnSubmissions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *RelationshipReturnSubmissions) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} diff --git a/pkg/generated/models/resolution_related_information.go b/pkg/generated/models/resolution_related_information.go new file mode 100644 index 00000000..02f9d250 --- /dev/null +++ b/pkg/generated/models/resolution_related_information.go @@ -0,0 +1,179 @@ +// 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" +) + +// ResolutionRelatedInformation resolution related information +// swagger:model ResolutionRelatedInformation +type ResolutionRelatedInformation struct { + + // clearing channel + ClearingChannel ClearingChannel `json:"clearing_channel,omitempty"` + + // Block to represent a list of references + // Max Items: 5 + References []*Reference `json:"references,omitempty"` + + // Date that the payment will be settled + // Format: date + SettlementDate *strfmt.Date `json:"settlement_date,omitempty"` +} + +func ResolutionRelatedInformationWithDefaults(defaults client.Defaults) *ResolutionRelatedInformation { + return &ResolutionRelatedInformation{ + + // TODO ClearingChannel: ClearingChannel, + + References: make([]*Reference, 0), + + SettlementDate: defaults.GetStrfmtDatePtr("ResolutionRelatedInformation", "settlement_date"), + } +} + +func (m *ResolutionRelatedInformation) WithClearingChannel(clearingChannel ClearingChannel) *ResolutionRelatedInformation { + + m.ClearingChannel = clearingChannel + + return m +} + +func (m *ResolutionRelatedInformation) WithReferences(references []*Reference) *ResolutionRelatedInformation { + + m.References = references + + return m +} + +func (m *ResolutionRelatedInformation) WithSettlementDate(settlementDate strfmt.Date) *ResolutionRelatedInformation { + + m.SettlementDate = &settlementDate + + return m +} + +func (m *ResolutionRelatedInformation) WithoutSettlementDate() *ResolutionRelatedInformation { + m.SettlementDate = nil + return m +} + +// Validate validates this resolution related information +func (m *ResolutionRelatedInformation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateClearingChannel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReferences(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSettlementDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ResolutionRelatedInformation) validateClearingChannel(formats strfmt.Registry) error { + + if swag.IsZero(m.ClearingChannel) { // not required + return nil + } + + if err := m.ClearingChannel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("clearing_channel") + } + return err + } + + return nil +} + +func (m *ResolutionRelatedInformation) validateReferences(formats strfmt.Registry) error { + + if swag.IsZero(m.References) { // not required + return nil + } + + iReferencesSize := int64(len(m.References)) + + if err := validate.MaxItems("references", "body", iReferencesSize, 5); err != nil { + return err + } + + for i := 0; i < len(m.References); i++ { + if swag.IsZero(m.References[i]) { // not required + continue + } + + if m.References[i] != nil { + if err := m.References[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("references" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ResolutionRelatedInformation) validateSettlementDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SettlementDate) { // not required + return nil + } + + if err := validate.FormatOf("settlement_date", "body", "date", m.SettlementDate.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ResolutionRelatedInformation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResolutionRelatedInformation) UnmarshalBinary(b []byte) error { + var res ResolutionRelatedInformation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ResolutionRelatedInformation) 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 aacd14ef..93367c10 100644 --- a/pkg/generated/models/resource_type.go +++ b/pkg/generated/models/resource_type.go @@ -21,194 +21,194 @@ type ResourceType string const ( - // ResourceTypeRecallDecisions captures enum value "recall_decisions" - ResourceTypeRecallDecisions ResourceType = "recall_decisions" + // ResourceTypeReturnSubmissions captures enum value "return_submissions" + ResourceTypeReturnSubmissions ResourceType = "return_submissions" - // ResourceTypeRecallSubmissionValidations captures enum value "recall_submission_validations" - ResourceTypeRecallSubmissionValidations ResourceType = "recall_submission_validations" + // ResourceTypeAccountEvents captures enum value "account_events" + ResourceTypeAccountEvents ResourceType = "account_events" - // ResourceTypeAccountRoutings captures enum value "account_routings" - ResourceTypeAccountRoutings ResourceType = "account_routings" + // ResourceTypeRecallDecisionSubmissionValidations captures enum value "recall_decision_submission_validations" + ResourceTypeRecallDecisionSubmissionValidations ResourceType = "recall_decision_submission_validations" - // ResourceTypeContacts captures enum value "contacts" - ResourceTypeContacts ResourceType = "contacts" + // ResourceTypeContactAccounts captures enum value "contact_accounts" + ResourceTypeContactAccounts ResourceType = "contact_accounts" - // ResourceTypeReturnSubmissionTasks captures enum value "return_submission_tasks" - ResourceTypeReturnSubmissionTasks ResourceType = "return_submission_tasks" + // ResourceTypeParties captures enum value "parties" + ResourceTypeParties ResourceType = "parties" - // ResourceTypePartyAccounts captures enum value "party_accounts" - ResourceTypePartyAccounts ResourceType = "party_accounts" + // ResourceTypeRecallReversalAdmissions captures enum value "recall_reversal_admissions" + ResourceTypeRecallReversalAdmissions ResourceType = "recall_reversal_admissions" - // ResourceTypeBics captures enum value "bics" - ResourceTypeBics ResourceType = "bics" + // ResourceTypeRecalls captures enum value "recalls" + ResourceTypeRecalls ResourceType = "recalls" - // ResourceTypeAccounts captures enum value "accounts" - ResourceTypeAccounts ResourceType = "accounts" + // ResourceTypeLimits captures enum value "limits" + ResourceTypeLimits ResourceType = "limits" - // ResourceTypeReturnSubmissionValidations captures enum value "return_submission_validations" - ResourceTypeReturnSubmissionValidations ResourceType = "return_submission_validations" + // ResourceTypeRecallReversals captures enum value "recall_reversals" + ResourceTypeRecallReversals ResourceType = "recall_reversals" - // ResourceTypeAccountEvents captures enum value "account_events" - ResourceTypeAccountEvents ResourceType = "account_events" + // ResourceTypeNameVerifications captures enum value "name_verifications" + ResourceTypeNameVerifications ResourceType = "name_verifications" - // ResourceTypePaymentAdviceSubmissionValidations captures enum value "payment_advice_submission_validations" - ResourceTypePaymentAdviceSubmissionValidations ResourceType = "payment_advice_submission_validations" + // ResourceTypePaymentAdmissions captures enum value "payment_admissions" + ResourceTypePaymentAdmissions ResourceType = "payment_admissions" + + // ResourceTypeSchemeMessages captures enum value "scheme_messages" + ResourceTypeSchemeMessages ResourceType = "scheme_messages" // ResourceTypeBranchIdentifications captures enum value "branch_identifications" ResourceTypeBranchIdentifications ResourceType = "branch_identifications" + // ResourceTypeReturns captures enum value "returns" + ResourceTypeReturns ResourceType = "returns" + + // ResourceTypePaymentSubmissionValidations captures enum value "payment_submission_validations" + ResourceTypePaymentSubmissionValidations ResourceType = "payment_submission_validations" + // ResourceTypeAccountAmendmentSubmissions captures enum value "account_amendment_submissions" ResourceTypeAccountAmendmentSubmissions ResourceType = "account_amendment_submissions" - // ResourceTypeReversalSubmissionValidations captures enum value "reversal_submission_validations" - ResourceTypeReversalSubmissionValidations ResourceType = "reversal_submission_validations" + // ResourceTypeRecallSubmissions captures enum value "recall_submissions" + ResourceTypeRecallSubmissions ResourceType = "recall_submissions" - // ResourceTypeReturnSubmissions captures enum value "return_submissions" - ResourceTypeReturnSubmissions ResourceType = "return_submissions" + // ResourceTypeReversalAdmissions captures enum value "reversal_admissions" + ResourceTypeReversalAdmissions ResourceType = "reversal_admissions" + + // ResourceTypeAccountRoutings captures enum value "account_routings" + ResourceTypeAccountRoutings ResourceType = "account_routings" + + // ResourceTypePaymentAdviceSubmissions captures enum value "payment_advice_submissions" + ResourceTypePaymentAdviceSubmissions ResourceType = "payment_advice_submissions" + + // ResourceTypeRecallDecisionSubmissions captures enum value "recall_decision_submissions" + ResourceTypeRecallDecisionSubmissions ResourceType = "recall_decision_submissions" // 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" + // ResourceTypeSchemeMessageAdmissions captures enum value "scheme_message_admissions" + ResourceTypeSchemeMessageAdmissions ResourceType = "scheme_message_admissions" // ResourceTypeBranches captures enum value "branches" ResourceTypeBranches ResourceType = "branches" - // ResourceTypeRecallAdmissions captures enum value "recall_admissions" - ResourceTypeRecallAdmissions ResourceType = "recall_admissions" - - // ResourceTypeRecallReversals captures enum value "recall_reversals" - ResourceTypeRecallReversals ResourceType = "recall_reversals" - - // ResourceTypePaymentSubmissions captures enum value "payment_submissions" - ResourceTypePaymentSubmissions ResourceType = "payment_submissions" - - // ResourceTypeNameVerifications captures enum value "name_verifications" - ResourceTypeNameVerifications ResourceType = "name_verifications" + // ResourceTypePaymentAdmissionTasks captures enum value "payment_admission_tasks" + ResourceTypePaymentAdmissionTasks ResourceType = "payment_admission_tasks" - // ResourceTypePaymentAdvices captures enum value "payment_advices" - ResourceTypePaymentAdvices ResourceType = "payment_advices" + // ResourceTypePaymentSubmissionTasks captures enum value "payment_submission_tasks" + ResourceTypePaymentSubmissionTasks ResourceType = "payment_submission_tasks" - // ResourceTypeRecallDecisionSubmissions captures enum value "recall_decision_submissions" - ResourceTypeRecallDecisionSubmissions ResourceType = "recall_decision_submissions" + // ResourceTypeAccountIndirects captures enum value "account_indirects" + ResourceTypeAccountIndirects ResourceType = "account_indirects" // ResourceTypeReversals captures enum value "reversals" ResourceTypeReversals ResourceType = "reversals" - // ResourceTypePaymentAdviceSubmissions captures enum value "payment_advice_submissions" - ResourceTypePaymentAdviceSubmissions ResourceType = "payment_advice_submissions" + // ResourceTypeRecallSubmissionValidations captures enum value "recall_submission_validations" + ResourceTypeRecallSubmissionValidations ResourceType = "recall_submission_validations" - // ResourceTypeLimits captures enum value "limits" - ResourceTypeLimits ResourceType = "limits" + // ResourceTypePayments captures enum value "payments" + ResourceTypePayments ResourceType = "payments" - // ResourceTypeNameVerificationSubmissions captures enum value "name_verification_submissions" - ResourceTypeNameVerificationSubmissions ResourceType = "name_verification_submissions" + // ResourceTypePartyAccounts captures enum value "party_accounts" + ResourceTypePartyAccounts ResourceType = "party_accounts" - // ResourceTypeAccountIdentifications captures enum value "account_identifications" - ResourceTypeAccountIdentifications ResourceType = "account_identifications" + // ResourceTypeAccountRequestSubmissions captures enum value "account_request_submissions" + ResourceTypeAccountRequestSubmissions ResourceType = "account_request_submissions" - // ResourceTypePaymentSubmissionValidations captures enum value "payment_submission_validations" - ResourceTypePaymentSubmissionValidations ResourceType = "payment_submission_validations" + // ResourceTypeAccountAmendments captures enum value "account_amendments" + ResourceTypeAccountAmendments ResourceType = "account_amendments" - // ResourceTypeReversalAdmissions captures enum value "reversal_admissions" - ResourceTypeReversalAdmissions ResourceType = "reversal_admissions" + // ResourceTypeReturnReversals captures enum value "return_reversals" + ResourceTypeReturnReversals ResourceType = "return_reversals" - // ResourceTypeReturnAdmissions captures enum value "return_admissions" - ResourceTypeReturnAdmissions ResourceType = "return_admissions" + // ResourceTypeAccounts captures enum value "accounts" + ResourceTypeAccounts ResourceType = "accounts" // 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" + // ResourceTypeContacts captures enum value "contacts" + ResourceTypeContacts ResourceType = "contacts" - // ResourceTypeAccountAmendments captures enum value "account_amendments" - ResourceTypeAccountAmendments ResourceType = "account_amendments" + // ResourceTypeReturnSubmissionTasks captures enum value "return_submission_tasks" + ResourceTypeReturnSubmissionTasks ResourceType = "return_submission_tasks" - // ResourceTypeAccountAmendmentSubmissionValidations captures enum value "account_amendment_submission_validations" - ResourceTypeAccountAmendmentSubmissionValidations ResourceType = "account_amendment_submission_validations" + // ResourceTypeBics captures enum value "bics" + ResourceTypeBics ResourceType = "bics" - // ResourceTypeReturnReversalAdmissions captures enum value "return_reversal_admissions" - ResourceTypeReturnReversalAdmissions ResourceType = "return_reversal_admissions" + // ResourceTypePaymentBatches captures enum value "payment_batches" + ResourceTypePaymentBatches ResourceType = "payment_batches" - // ResourceTypeAccountRequests captures enum value "account_requests" - ResourceTypeAccountRequests ResourceType = "account_requests" + // ResourceTypeBankIds captures enum value "bank_ids" + ResourceTypeBankIds ResourceType = "bank_ids" - // ResourceTypeAccountIndirects captures enum value "account_indirects" - ResourceTypeAccountIndirects ResourceType = "account_indirects" + // ResourceTypeDirectAccount captures enum value "direct_account" + ResourceTypeDirectAccount ResourceType = "direct_account" - // ResourceTypePaymentDefaults captures enum value "payment_defaults" - ResourceTypePaymentDefaults ResourceType = "payment_defaults" + // ResourceTypePaymentAdviceSubmissionValidations captures enum value "payment_advice_submission_validations" + ResourceTypePaymentAdviceSubmissionValidations ResourceType = "payment_advice_submission_validations" - // ResourceTypeSchemeMessageAdmissions captures enum value "scheme_message_admissions" - ResourceTypeSchemeMessageAdmissions ResourceType = "scheme_message_admissions" + // ResourceTypeAccountIdentifications captures enum value "account_identifications" + ResourceTypeAccountIdentifications ResourceType = "account_identifications" - // ResourceTypeParties captures enum value "parties" - ResourceTypeParties ResourceType = "parties" + // ResourceTypePaymentAutomaticReturns captures enum value "payment_automatic_returns" + ResourceTypePaymentAutomaticReturns ResourceType = "payment_automatic_returns" - // ResourceTypePaymentAdmissions captures enum value "payment_admissions" - ResourceTypePaymentAdmissions ResourceType = "payment_admissions" + // ResourceTypeNameVerificationSubmissions captures enum value "name_verification_submissions" + ResourceTypeNameVerificationSubmissions ResourceType = "name_verification_submissions" - // ResourceTypeAccountRequestSubmissions captures enum value "account_request_submissions" - ResourceTypeAccountRequestSubmissions ResourceType = "account_request_submissions" + // ResourceTypeReturnReversalAdmissions captures enum value "return_reversal_admissions" + ResourceTypeReturnReversalAdmissions ResourceType = "return_reversal_admissions" - // ResourceTypeAccountRequestSubmissionValidations captures enum value "account_request_submission_validations" - ResourceTypeAccountRequestSubmissionValidations ResourceType = "account_request_submission_validations" + // ResourceTypeReturnAdmissions captures enum value "return_admissions" + ResourceTypeReturnAdmissions ResourceType = "return_admissions" - // ResourceTypeBankIds captures enum value "bank_ids" - ResourceTypeBankIds ResourceType = "bank_ids" + // ResourceTypePositions captures enum value "positions" + ResourceTypePositions ResourceType = "positions" - // ResourceTypeReturnReversals captures enum value "return_reversals" - ResourceTypeReturnReversals ResourceType = "return_reversals" + // ResourceTypeFxDeals captures enum value "fx_deals" + ResourceTypeFxDeals ResourceType = "fx_deals" - // ResourceTypeRecallSubmissions captures enum value "recall_submissions" - ResourceTypeRecallSubmissions ResourceType = "recall_submissions" + // ResourceTypeReturnSubmissionValidations captures enum value "return_submission_validations" + ResourceTypeReturnSubmissionValidations ResourceType = "return_submission_validations" - // ResourceTypePaymentAutomaticReturns captures enum value "payment_automatic_returns" - ResourceTypePaymentAutomaticReturns ResourceType = "payment_automatic_returns" + // ResourceTypePaymentAdvices captures enum value "payment_advices" + ResourceTypePaymentAdvices ResourceType = "payment_advices" - // ResourceTypeContactAccounts captures enum value "contact_accounts" - ResourceTypeContactAccounts ResourceType = "contact_accounts" + // ResourceTypeRecallDecisionAdmissions captures enum value "recall_decision_admissions" + ResourceTypeRecallDecisionAdmissions ResourceType = "recall_decision_admissions" - // ResourceTypeDirectAccount captures enum value "direct_account" - ResourceTypeDirectAccount ResourceType = "direct_account" + // ResourceTypePaymentDefaults captures enum value "payment_defaults" + ResourceTypePaymentDefaults ResourceType = "payment_defaults" - // ResourceTypePaymentAdmissionTasks captures enum value "payment_admission_tasks" - ResourceTypePaymentAdmissionTasks ResourceType = "payment_admission_tasks" + // ResourceTypeAccountRequests captures enum value "account_requests" + ResourceTypeAccountRequests ResourceType = "account_requests" - // ResourceTypePayments captures enum value "payments" - ResourceTypePayments ResourceType = "payments" + // ResourceTypeRecallDecisions captures enum value "recall_decisions" + ResourceTypeRecallDecisions ResourceType = "recall_decisions" // ResourceTypeAccountConfigurations captures enum value "account_configurations" ResourceTypeAccountConfigurations ResourceType = "account_configurations" - // ResourceTypeReturns captures enum value "returns" - ResourceTypeReturns ResourceType = "returns" - - // ResourceTypePositions captures enum value "positions" - ResourceTypePositions ResourceType = "positions" - - // ResourceTypeSchemeMessages captures enum value "scheme_messages" - ResourceTypeSchemeMessages ResourceType = "scheme_messages" + // ResourceTypeAccountAmendmentSubmissionValidations captures enum value "account_amendment_submission_validations" + ResourceTypeAccountAmendmentSubmissionValidations ResourceType = "account_amendment_submission_validations" - // ResourceTypeFxDeals captures enum value "fx_deals" - ResourceTypeFxDeals ResourceType = "fx_deals" + // ResourceTypeReversalSubmissionValidations captures enum value "reversal_submission_validations" + ResourceTypeReversalSubmissionValidations ResourceType = "reversal_submission_validations" - // ResourceTypeRecalls captures enum value "recalls" - ResourceTypeRecalls ResourceType = "recalls" + // ResourceTypePaymentSubmissions captures enum value "payment_submissions" + ResourceTypePaymentSubmissions ResourceType = "payment_submissions" - // ResourceTypeRecallReversalAdmissions captures enum value "recall_reversal_admissions" - ResourceTypeRecallReversalAdmissions ResourceType = "recall_reversal_admissions" + // ResourceTypeAccountRequestSubmissionValidations captures enum value "account_request_submission_validations" + ResourceTypeAccountRequestSubmissionValidations ResourceType = "account_request_submission_validations" // ResourceTypeReversalSubmissions captures enum value "reversal_submissions" ResourceTypeReversalSubmissions ResourceType = "reversal_submissions" + + // ResourceTypeRecallAdmissions captures enum value "recall_admissions" + ResourceTypeRecallAdmissions ResourceType = "recall_admissions" ) // for schema @@ -216,7 +216,7 @@ var resourceTypeEnum []interface{} func init() { var res []ResourceType - 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 { + if err := json.Unmarshal([]byte(`["return_submissions","account_events","recall_decision_submission_validations","contact_accounts","parties","recall_reversal_admissions","recalls","limits","recall_reversals","name_verifications","payment_admissions","scheme_messages","branch_identifications","returns","payment_submission_validations","account_amendment_submissions","recall_submissions","reversal_admissions","account_routings","payment_advice_submissions","recall_decision_submissions","reversal_admission_tasks","scheme_message_admissions","branches","payment_admission_tasks","payment_submission_tasks","account_indirects","reversals","recall_submission_validations","payments","party_accounts","account_request_submissions","account_amendments","return_reversals","accounts","name_verification_admissions","contacts","return_submission_tasks","bics","payment_batches","bank_ids","direct_account","payment_advice_submission_validations","account_identifications","payment_automatic_returns","name_verification_submissions","return_reversal_admissions","return_admissions","positions","fx_deals","return_submission_validations","payment_advices","recall_decision_admissions","payment_defaults","account_requests","recall_decisions","account_configurations","account_amendment_submission_validations","reversal_submission_validations","payment_submissions","account_request_submission_validations","reversal_submissions","recall_admissions"]`), &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 1c505b5c..957ccd51 100644 --- a/pkg/generated/models/return_payment.go +++ b/pkg/generated/models/return_payment.go @@ -384,6 +384,10 @@ type ReturnPaymentAttributes struct { // settlement Settlement *Settlement `json:"settlement,omitempty"` + // The scheme-specific unique transaction ID. Populated by the scheme. + // Max Length: 42 + UniqueSchemeID string `json:"unique_scheme_id,omitempty"` + // All purpose list of key-value pairs specific data stored on the return. // Max Items: 5 UserDefinedData []*UserDefinedData `json:"user_defined_data"` @@ -410,6 +414,8 @@ func ReturnPaymentAttributesWithDefaults(defaults client.Defaults) *ReturnPaymen Settlement: SettlementWithDefaults(defaults), + UniqueSchemeID: defaults.GetString("ReturnPaymentAttributes", "unique_scheme_id"), + UserDefinedData: make([]*UserDefinedData, 0), } } @@ -497,6 +503,13 @@ func (m *ReturnPaymentAttributes) WithoutSettlement() *ReturnPaymentAttributes { return m } +func (m *ReturnPaymentAttributes) WithUniqueSchemeID(uniqueSchemeID string) *ReturnPaymentAttributes { + + m.UniqueSchemeID = uniqueSchemeID + + return m +} + func (m *ReturnPaymentAttributes) WithUserDefinedData(userDefinedData []*UserDefinedData) *ReturnPaymentAttributes { m.UserDefinedData = userDefinedData @@ -524,6 +537,10 @@ func (m *ReturnPaymentAttributes) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUniqueSchemeID(formats); err != nil { + res = append(res, err) + } + if err := m.validateUserDefinedData(formats); err != nil { res = append(res, err) } @@ -591,6 +608,19 @@ func (m *ReturnPaymentAttributes) validateSettlement(formats strfmt.Registry) er return nil } +func (m *ReturnPaymentAttributes) validateUniqueSchemeID(formats strfmt.Registry) error { + + if swag.IsZero(m.UniqueSchemeID) { // not required + return nil + } + + if err := validate.MaxLength("attributes"+"."+"unique_scheme_id", "body", string(m.UniqueSchemeID), 42); err != nil { + return err + } + + return nil +} + func (m *ReturnPaymentAttributes) validateUserDefinedData(formats strfmt.Registry) error { if swag.IsZero(m.UserDefinedData) { // not required diff --git a/pkg/generated/models/return_submission_task.go b/pkg/generated/models/return_submission_task.go index dfd7fb6b..e20d4977 100644 --- a/pkg/generated/models/return_submission_task.go +++ b/pkg/generated/models/return_submission_task.go @@ -40,6 +40,9 @@ type ReturnSubmissionTask struct { // Format: uuid OrganisationID strfmt.UUID `json:"organisation_id,omitempty"` + // relationships + Relationships *ReturnSubmissionTaskRelationships `json:"relationships,omitempty"` + // Name of the resource type // Pattern: ^[A-Za-z_]*$ Type string `json:"type,omitempty"` @@ -62,6 +65,8 @@ func ReturnSubmissionTaskWithDefaults(defaults client.Defaults) *ReturnSubmissio OrganisationID: defaults.GetStrfmtUUID("ReturnSubmissionTask", "organisation_id"), + Relationships: ReturnSubmissionTaskRelationshipsWithDefaults(defaults), + Type: defaults.GetString("ReturnSubmissionTask", "type"), Version: defaults.GetInt64Ptr("ReturnSubmissionTask", "version"), @@ -108,6 +113,18 @@ func (m *ReturnSubmissionTask) WithOrganisationID(organisationID strfmt.UUID) *R return m } +func (m *ReturnSubmissionTask) WithRelationships(relationships ReturnSubmissionTaskRelationships) *ReturnSubmissionTask { + + m.Relationships = &relationships + + return m +} + +func (m *ReturnSubmissionTask) WithoutRelationships() *ReturnSubmissionTask { + m.Relationships = nil + return m +} + func (m *ReturnSubmissionTask) WithType(typeVar string) *ReturnSubmissionTask { m.Type = typeVar @@ -151,6 +168,10 @@ func (m *ReturnSubmissionTask) 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) } @@ -235,6 +256,24 @@ func (m *ReturnSubmissionTask) validateOrganisationID(formats strfmt.Registry) e return nil } +func (m *ReturnSubmissionTask) 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 *ReturnSubmissionTask) validateType(formats strfmt.Registry) error { if swag.IsZero(m.Type) { // not required diff --git a/pkg/generated/models/return_submission_task_amendment.go b/pkg/generated/models/return_submission_task_amendment.go new file mode 100644 index 00000000..7706ba19 --- /dev/null +++ b/pkg/generated/models/return_submission_task_amendment.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" +) + +// ReturnSubmissionTaskAmendment return submission task amendment +// swagger:model ReturnSubmissionTaskAmendment +type ReturnSubmissionTaskAmendment struct { + + // data + Data *ReturnSubmissionTaskUpdate `json:"data,omitempty"` +} + +func ReturnSubmissionTaskAmendmentWithDefaults(defaults client.Defaults) *ReturnSubmissionTaskAmendment { + return &ReturnSubmissionTaskAmendment{ + + Data: ReturnSubmissionTaskUpdateWithDefaults(defaults), + } +} + +func (m *ReturnSubmissionTaskAmendment) WithData(data ReturnSubmissionTaskUpdate) *ReturnSubmissionTaskAmendment { + + m.Data = &data + + return m +} + +func (m *ReturnSubmissionTaskAmendment) WithoutData() *ReturnSubmissionTaskAmendment { + m.Data = nil + return m +} + +// Validate validates this return submission task amendment +func (m *ReturnSubmissionTaskAmendment) 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 *ReturnSubmissionTaskAmendment) 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 *ReturnSubmissionTaskAmendment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionTaskAmendment) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionTaskAmendment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionTaskAmendment) 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 index bea02eb9..bf7fb6c3 100644 --- a/pkg/generated/models/return_submission_task_assignee.go +++ b/pkg/generated/models/return_submission_task_assignee.go @@ -21,6 +21,9 @@ type ReturnSubmissionTaskAssignee string const ( + // ReturnSubmissionTaskAssigneeCustomer captures enum value "customer" + ReturnSubmissionTaskAssigneeCustomer ReturnSubmissionTaskAssignee = "customer" + // ReturnSubmissionTaskAssigneeForm3 captures enum value "form3" ReturnSubmissionTaskAssigneeForm3 ReturnSubmissionTaskAssignee = "form3" ) @@ -30,7 +33,7 @@ var returnSubmissionTaskAssigneeEnum []interface{} func init() { var res []ReturnSubmissionTaskAssignee - if err := json.Unmarshal([]byte(`["form3"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["customer","form3"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/generated/models/return_submission_task_details_response.go b/pkg/generated/models/return_submission_task_details_response.go new file mode 100644 index 00000000..331f32dd --- /dev/null +++ b/pkg/generated/models/return_submission_task_details_response.go @@ -0,0 +1,140 @@ +// 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" +) + +// ReturnSubmissionTaskDetailsResponse return submission task details response +// swagger:model ReturnSubmissionTaskDetailsResponse +type ReturnSubmissionTaskDetailsResponse struct { + + // data + Data *ReturnSubmissionTask `json:"data,omitempty"` + + // links + Links *Links `json:"links,omitempty"` +} + +func ReturnSubmissionTaskDetailsResponseWithDefaults(defaults client.Defaults) *ReturnSubmissionTaskDetailsResponse { + return &ReturnSubmissionTaskDetailsResponse{ + + Data: ReturnSubmissionTaskWithDefaults(defaults), + + Links: LinksWithDefaults(defaults), + } +} + +func (m *ReturnSubmissionTaskDetailsResponse) WithData(data ReturnSubmissionTask) *ReturnSubmissionTaskDetailsResponse { + + m.Data = &data + + return m +} + +func (m *ReturnSubmissionTaskDetailsResponse) WithoutData() *ReturnSubmissionTaskDetailsResponse { + m.Data = nil + return m +} + +func (m *ReturnSubmissionTaskDetailsResponse) WithLinks(links Links) *ReturnSubmissionTaskDetailsResponse { + + m.Links = &links + + return m +} + +func (m *ReturnSubmissionTaskDetailsResponse) WithoutLinks() *ReturnSubmissionTaskDetailsResponse { + m.Links = nil + return m +} + +// Validate validates this return submission task details response +func (m *ReturnSubmissionTaskDetailsResponse) 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 *ReturnSubmissionTaskDetailsResponse) 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 +} + +func (m *ReturnSubmissionTaskDetailsResponse) 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 *ReturnSubmissionTaskDetailsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionTaskDetailsResponse) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionTaskDetailsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionTaskDetailsResponse) 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_relationships.go b/pkg/generated/models/return_submission_task_relationships.go new file mode 100644 index 00000000..cce0f6af --- /dev/null +++ b/pkg/generated/models/return_submission_task_relationships.go @@ -0,0 +1,179 @@ +// 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" +) + +// ReturnSubmissionTaskRelationships return submission task relationships +// swagger:model ReturnSubmissionTaskRelationships +type ReturnSubmissionTaskRelationships struct { + + // payment + Payment *RelationshipPayments `json:"payment,omitempty"` + + // payment return + PaymentReturn *RelationshipReturns `json:"payment_return,omitempty"` + + // return submission + ReturnSubmission *RelationshipReturnSubmissions `json:"return_submission,omitempty"` +} + +func ReturnSubmissionTaskRelationshipsWithDefaults(defaults client.Defaults) *ReturnSubmissionTaskRelationships { + return &ReturnSubmissionTaskRelationships{ + + Payment: RelationshipPaymentsWithDefaults(defaults), + + PaymentReturn: RelationshipReturnsWithDefaults(defaults), + + ReturnSubmission: RelationshipReturnSubmissionsWithDefaults(defaults), + } +} + +func (m *ReturnSubmissionTaskRelationships) WithPayment(payment RelationshipPayments) *ReturnSubmissionTaskRelationships { + + m.Payment = &payment + + return m +} + +func (m *ReturnSubmissionTaskRelationships) WithoutPayment() *ReturnSubmissionTaskRelationships { + m.Payment = nil + return m +} + +func (m *ReturnSubmissionTaskRelationships) WithPaymentReturn(paymentReturn RelationshipReturns) *ReturnSubmissionTaskRelationships { + + m.PaymentReturn = &paymentReturn + + return m +} + +func (m *ReturnSubmissionTaskRelationships) WithoutPaymentReturn() *ReturnSubmissionTaskRelationships { + m.PaymentReturn = nil + return m +} + +func (m *ReturnSubmissionTaskRelationships) WithReturnSubmission(returnSubmission RelationshipReturnSubmissions) *ReturnSubmissionTaskRelationships { + + m.ReturnSubmission = &returnSubmission + + return m +} + +func (m *ReturnSubmissionTaskRelationships) WithoutReturnSubmission() *ReturnSubmissionTaskRelationships { + m.ReturnSubmission = nil + return m +} + +// Validate validates this return submission task relationships +func (m *ReturnSubmissionTaskRelationships) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePayment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentReturn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReturnSubmission(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReturnSubmissionTaskRelationships) validatePayment(formats strfmt.Registry) error { + + if swag.IsZero(m.Payment) { // not required + return nil + } + + if m.Payment != nil { + if err := m.Payment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payment") + } + return err + } + } + + return nil +} + +func (m *ReturnSubmissionTaskRelationships) 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 *ReturnSubmissionTaskRelationships) validateReturnSubmission(formats strfmt.Registry) error { + + if swag.IsZero(m.ReturnSubmission) { // not required + return nil + } + + if m.ReturnSubmission != nil { + if err := m.ReturnSubmission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("return_submission") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReturnSubmissionTaskRelationships) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionTaskRelationships) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionTaskRelationships + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionTaskRelationships) 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_update.go b/pkg/generated/models/return_submission_task_update.go new file mode 100644 index 00000000..7ae5e42b --- /dev/null +++ b/pkg/generated/models/return_submission_task_update.go @@ -0,0 +1,344 @@ +// 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" +) + +// ReturnSubmissionTaskUpdate return submission task update +// swagger:model ReturnSubmissionTaskUpdate +type ReturnSubmissionTaskUpdate struct { + + // attributes + Attributes *ReturnSubmissionTaskUpdateAttributes `json:"attributes,omitempty"` + + // Unique resource ID + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Unique ID of the organisation this resource is created by + // Format: uuid + OrganisationID strfmt.UUID `json:"organisation_id,omitempty"` + + // type + // Enum: [return_submission_tasks] + Type string `json:"type,omitempty"` + + // Version number + // Minimum: 0 + Version *int64 `json:"version,omitempty"` +} + +func ReturnSubmissionTaskUpdateWithDefaults(defaults client.Defaults) *ReturnSubmissionTaskUpdate { + return &ReturnSubmissionTaskUpdate{ + + Attributes: ReturnSubmissionTaskUpdateAttributesWithDefaults(defaults), + + ID: defaults.GetStrfmtUUID("ReturnSubmissionTaskUpdate", "id"), + + OrganisationID: defaults.GetStrfmtUUID("ReturnSubmissionTaskUpdate", "organisation_id"), + + Type: defaults.GetString("ReturnSubmissionTaskUpdate", "type"), + + Version: defaults.GetInt64Ptr("ReturnSubmissionTaskUpdate", "version"), + } +} + +func (m *ReturnSubmissionTaskUpdate) WithAttributes(attributes ReturnSubmissionTaskUpdateAttributes) *ReturnSubmissionTaskUpdate { + + m.Attributes = &attributes + + return m +} + +func (m *ReturnSubmissionTaskUpdate) WithoutAttributes() *ReturnSubmissionTaskUpdate { + m.Attributes = nil + return m +} + +func (m *ReturnSubmissionTaskUpdate) WithID(id strfmt.UUID) *ReturnSubmissionTaskUpdate { + + m.ID = id + + return m +} + +func (m *ReturnSubmissionTaskUpdate) WithOrganisationID(organisationID strfmt.UUID) *ReturnSubmissionTaskUpdate { + + m.OrganisationID = organisationID + + return m +} + +func (m *ReturnSubmissionTaskUpdate) WithType(typeVar string) *ReturnSubmissionTaskUpdate { + + m.Type = typeVar + + return m +} + +func (m *ReturnSubmissionTaskUpdate) WithVersion(version int64) *ReturnSubmissionTaskUpdate { + + m.Version = &version + + return m +} + +func (m *ReturnSubmissionTaskUpdate) WithoutVersion() *ReturnSubmissionTaskUpdate { + m.Version = nil + return m +} + +// Validate validates this return submission task update +func (m *ReturnSubmissionTaskUpdate) 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.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 *ReturnSubmissionTaskUpdate) 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 *ReturnSubmissionTaskUpdate) 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 *ReturnSubmissionTaskUpdate) 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 +} + +var returnSubmissionTaskUpdateTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["return_submission_tasks"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + returnSubmissionTaskUpdateTypeTypePropEnum = append(returnSubmissionTaskUpdateTypeTypePropEnum, v) + } +} + +const ( + + // ReturnSubmissionTaskUpdateTypeReturnSubmissionTasks captures enum value "return_submission_tasks" + ReturnSubmissionTaskUpdateTypeReturnSubmissionTasks string = "return_submission_tasks" +) + +// prop value enum +func (m *ReturnSubmissionTaskUpdate) validateTypeEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, returnSubmissionTaskUpdateTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *ReturnSubmissionTaskUpdate) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *ReturnSubmissionTaskUpdate) 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 *ReturnSubmissionTaskUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionTaskUpdate) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionTaskUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionTaskUpdate) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + +// ReturnSubmissionTaskUpdateAttributes return submission task update attributes +// swagger:model ReturnSubmissionTaskUpdateAttributes +type ReturnSubmissionTaskUpdateAttributes struct { + + // Key Value map that contains the Task result. + Output map[string]interface{} `json:"output,omitempty"` + + // status + Status ReturnSubmissionTaskStatus `json:"status,omitempty"` +} + +func ReturnSubmissionTaskUpdateAttributesWithDefaults(defaults client.Defaults) *ReturnSubmissionTaskUpdateAttributes { + return &ReturnSubmissionTaskUpdateAttributes{ + + Output: defaults.GetMapStringInterface("ReturnSubmissionTaskUpdateAttributes", "output"), + + // TODO Status: ReturnSubmissionTaskStatus, + + } +} + +func (m *ReturnSubmissionTaskUpdateAttributes) WithOutput(output map[string]interface{}) *ReturnSubmissionTaskUpdateAttributes { + + m.Output = output + + return m +} + +func (m *ReturnSubmissionTaskUpdateAttributes) WithStatus(status ReturnSubmissionTaskStatus) *ReturnSubmissionTaskUpdateAttributes { + + m.Status = status + + return m +} + +// Validate validates this return submission task update attributes +func (m *ReturnSubmissionTaskUpdateAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReturnSubmissionTaskUpdateAttributes) 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 *ReturnSubmissionTaskUpdateAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReturnSubmissionTaskUpdateAttributes) UnmarshalBinary(b []byte) error { + var res ReturnSubmissionTaskUpdateAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReturnSubmissionTaskUpdateAttributes) 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 360bce79..0a32eae9 100644 --- a/pkg/generated/models/reversal_admission.go +++ b/pkg/generated/models/reversal_admission.go @@ -359,6 +359,9 @@ type ReversalAdmissionAttributes struct { // source gateway SourceGateway string `json:"source_gateway,omitempty"` + + // status + Status ReversalAdmissionStatus `json:"status,omitempty"` } func ReversalAdmissionAttributesWithDefaults(defaults client.Defaults) *ReversalAdmissionAttributes { @@ -369,6 +372,9 @@ func ReversalAdmissionAttributesWithDefaults(defaults client.Defaults) *Reversal SchemeStatusCodeDescription: defaults.GetString("ReversalAdmissionAttributes", "scheme_status_code_description"), SourceGateway: defaults.GetString("ReversalAdmissionAttributes", "source_gateway"), + + // TODO Status: ReversalAdmissionStatus, + } } @@ -393,8 +399,40 @@ func (m *ReversalAdmissionAttributes) WithSourceGateway(sourceGateway string) *R return m } +func (m *ReversalAdmissionAttributes) WithStatus(status ReversalAdmissionStatus) *ReversalAdmissionAttributes { + + m.Status = status + + return m +} + // Validate validates this reversal admission attributes func (m *ReversalAdmissionAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionAttributes) 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 } diff --git a/pkg/generated/models/reversal_admission_status.go b/pkg/generated/models/reversal_admission_status.go new file mode 100644 index 00000000..f026c703 --- /dev/null +++ b/pkg/generated/models/reversal_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" +) + +// ReversalAdmissionStatus Status of the reversal admission +// swagger:model ReversalAdmissionStatus +type ReversalAdmissionStatus string + +const ( + + // ReversalAdmissionStatusPending captures enum value "pending" + ReversalAdmissionStatusPending ReversalAdmissionStatus = "pending" + + // ReversalAdmissionStatusConfirmed captures enum value "confirmed" + ReversalAdmissionStatusConfirmed ReversalAdmissionStatus = "confirmed" +) + +// for schema +var reversalAdmissionStatusEnum []interface{} + +func init() { + var res []ReversalAdmissionStatus + if err := json.Unmarshal([]byte(`["pending","confirmed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reversalAdmissionStatusEnum = append(reversalAdmissionStatusEnum, v) + } +} + +func (m ReversalAdmissionStatus) validateReversalAdmissionStatusEnum(path, location string, value ReversalAdmissionStatus) error { + if err := validate.Enum(path, location, value, reversalAdmissionStatusEnum); err != nil { + return err + } + return nil +} + +// Validate validates this reversal admission status +func (m ReversalAdmissionStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReversalAdmissionStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionStatus) 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 index 47869fb7..af2c8727 100644 --- a/pkg/generated/models/reversal_admission_update.go +++ b/pkg/generated/models/reversal_admission_update.go @@ -289,6 +289,9 @@ type ReversalAdmissionUpdateAttributes struct { // source gateway SourceGateway string `json:"source_gateway,omitempty"` + + // status + Status ReversalAdmissionStatus `json:"status,omitempty"` } func ReversalAdmissionUpdateAttributesWithDefaults(defaults client.Defaults) *ReversalAdmissionUpdateAttributes { @@ -299,6 +302,9 @@ func ReversalAdmissionUpdateAttributesWithDefaults(defaults client.Defaults) *Re SchemeStatusCodeDescription: defaults.GetString("ReversalAdmissionUpdateAttributes", "scheme_status_code_description"), SourceGateway: defaults.GetString("ReversalAdmissionUpdateAttributes", "source_gateway"), + + // TODO Status: ReversalAdmissionStatus, + } } @@ -323,8 +329,40 @@ func (m *ReversalAdmissionUpdateAttributes) WithSourceGateway(sourceGateway stri return m } +func (m *ReversalAdmissionUpdateAttributes) WithStatus(status ReversalAdmissionStatus) *ReversalAdmissionUpdateAttributes { + + m.Status = status + + return m +} + // Validate validates this reversal admission update attributes func (m *ReversalAdmissionUpdateAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalAdmissionUpdateAttributes) 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 } diff --git a/pkg/generated/models/reversal_payment.go b/pkg/generated/models/reversal_payment.go index 4e50e8d8..24b0fb76 100644 --- a/pkg/generated/models/reversal_payment.go +++ b/pkg/generated/models/reversal_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" @@ -22,7 +23,7 @@ import ( type ReversalPayment struct { // attributes - Attributes interface{} `json:"attributes,omitempty"` + Attributes *ReversalPaymentAttributes `json:"attributes,omitempty"` // created on // Format: date-time @@ -57,7 +58,7 @@ type ReversalPayment struct { func ReversalPaymentWithDefaults(defaults client.Defaults) *ReversalPayment { return &ReversalPayment{ - // TODO Attributes: interface{}, + Attributes: ReversalPaymentAttributesWithDefaults(defaults), CreatedOn: defaults.GetStrfmtDateTimePtr("ReversalPayment", "created_on"), @@ -75,13 +76,18 @@ func ReversalPaymentWithDefaults(defaults client.Defaults) *ReversalPayment { } } -func (m *ReversalPayment) WithAttributes(attributes interface{}) *ReversalPayment { +func (m *ReversalPayment) WithAttributes(attributes ReversalPaymentAttributes) *ReversalPayment { - m.Attributes = attributes + m.Attributes = &attributes return m } +func (m *ReversalPayment) WithoutAttributes() *ReversalPayment { + m.Attributes = nil + return m +} + func (m *ReversalPayment) WithCreatedOn(createdOn strfmt.DateTime) *ReversalPayment { m.CreatedOn = &createdOn @@ -165,6 +171,10 @@ func (m *ReversalPayment) WithoutVersion() *ReversalPayment { func (m *ReversalPayment) 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) } @@ -199,6 +209,24 @@ func (m *ReversalPayment) Validate(formats strfmt.Registry) error { return nil } +func (m *ReversalPayment) 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 *ReversalPayment) validateCreatedOn(formats strfmt.Registry) error { if swag.IsZero(m.CreatedOn) { // not required @@ -320,6 +348,99 @@ func (m *ReversalPayment) Json() string { return string(json) } +// ReversalPaymentAttributes reversal payment attributes +// swagger:model ReversalPaymentAttributes +type ReversalPaymentAttributes struct { + + // All purpose list of key-value pairs. + // Max Items: 5 + UserDefinedData []*UserDefinedData `json:"user_defined_data,omitempty"` +} + +func ReversalPaymentAttributesWithDefaults(defaults client.Defaults) *ReversalPaymentAttributes { + return &ReversalPaymentAttributes{ + + UserDefinedData: make([]*UserDefinedData, 0), + } +} + +func (m *ReversalPaymentAttributes) WithUserDefinedData(userDefinedData []*UserDefinedData) *ReversalPaymentAttributes { + + m.UserDefinedData = userDefinedData + + return m +} + +// Validate validates this reversal payment attributes +func (m *ReversalPaymentAttributes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUserDefinedData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReversalPaymentAttributes) 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 *ReversalPaymentAttributes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReversalPaymentAttributes) UnmarshalBinary(b []byte) error { + var res ReversalPaymentAttributes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} +func (m *ReversalPaymentAttributes) Json() string { + json, err := json.MarshalIndent(m, " ", " ") + if err != nil { + log.Fatal(err) + } + return string(json) +} + // ReversalPaymentRelationships reversal payment relationships // swagger:model ReversalPaymentRelationships type ReversalPaymentRelationships struct { diff --git a/pkg/generated/models/ultimate_entity.go b/pkg/generated/models/ultimate_entity.go index a513887a..be8d70c2 100644 --- a/pkg/generated/models/ultimate_entity.go +++ b/pkg/generated/models/ultimate_entity.go @@ -49,6 +49,9 @@ type UltimateEntity struct { // Country of ultimate debtor/beneficiary address. ISO 3166 format country code Country string `json:"country,omitempty"` + // Country of residence of the ultimate beneficiary, ISO 3166 format country code + CountryOfResidence string `json:"country_of_residence,omitempty"` + // name Name string `json:"name,omitempty"` @@ -98,6 +101,8 @@ func UltimateEntityWithDefaults(defaults client.Defaults) *UltimateEntity { Country: defaults.GetString("UltimateEntity", "country"), + CountryOfResidence: defaults.GetString("UltimateEntity", "country_of_residence"), + Name: defaults.GetString("UltimateEntity", "name"), OrganisationIdentification: defaults.GetString("UltimateEntity", "organisation_identification"), @@ -186,6 +191,13 @@ func (m *UltimateEntity) WithCountry(country string) *UltimateEntity { return m } +func (m *UltimateEntity) WithCountryOfResidence(countryOfResidence string) *UltimateEntity { + + m.CountryOfResidence = countryOfResidence + + return m +} + func (m *UltimateEntity) WithName(name string) *UltimateEntity { m.Name = name